Deploying JSR 352 job as a module

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Deploying JSR 352 job as a module

Gunnar Morling
Hi,

Is there any example which shows how to deploy a JSR 352 batch job via a module added to WildFly rather than through a deployed application? This batch job should then be usable from applications which declare a dependency to that module.

Trying this, I'm getting an error saying that the batch job's XML descriptor cannot be found [1]. I.e. the module with the batch job is visible to the deployed application (as the MassIndexer class can be accessed), but then JBeret cannot "see" the job XML descriptor within that module.

Is there anything I can configure in the module.xml of the batch job's module for exposing its contents to JBeret?

The use case is Hibernate Search where a GSoC student is working on a JSR 352 batch job for re-indexing entities. This job eventually should be part of Hibernate Search's modules, allowing users to run it if Hibernate Search is enabled for their application.

Thanks for any pointers,

--Gunnar

[1] Exception: javax.batch.operations.JobStartException: JBERET000601: Failed to get job xml file for job mass-index.xml
    at org.jberet.creation.ArchiveXmlLoader.getJobXml(ArchiveXmlLoader.java:129)
    at org.jberet.creation.ArchiveXmlLoader.loadJobXml(ArchiveXmlLoader.java:91)
    at org.jberet.operations.JobOperatorImpl.start(JobOperatorImpl.java:102)
    at org.hibernate.search.jsr352.MassIndexer.start(MassIndexer.java:90)
    at org.hibernate.search.jsr352.PerformanceIT.testNewMassIndexer(PerformanceIT.java:167)
    ...

_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev
Reply | Threaded
Open this post in threaded view
|

Re: Deploying JSR 352 job as a module

Jan Martiška
Does the dependency on the module include a dependency on its META-INF directory? AFAIK, META-INF contents are by default not visible to applications' classloaders. I think you need a "meta-inf=import" attribute or so in jboss-deployment-structure.xml, or the "meta-inf" flag if you are declaring the dependency in MANIFEST.MF.

Jan

On Thu, Aug 18, 2016 at 9:59 AM, Gunnar Morling <[hidden email]> wrote:
Hi,

Is there any example which shows how to deploy a JSR 352 batch job via a module added to WildFly rather than through a deployed application? This batch job should then be usable from applications which declare a dependency to that module.

Trying this, I'm getting an error saying that the batch job's XML descriptor cannot be found [1]. I.e. the module with the batch job is visible to the deployed application (as the MassIndexer class can be accessed), but then JBeret cannot "see" the job XML descriptor within that module.

Is there anything I can configure in the module.xml of the batch job's module for exposing its contents to JBeret?

The use case is Hibernate Search where a GSoC student is working on a JSR 352 batch job for re-indexing entities. This job eventually should be part of Hibernate Search's modules, allowing users to run it if Hibernate Search is enabled for their application.

Thanks for any pointers,

--Gunnar

[1] Exception: javax.batch.operations.JobStartException: JBERET000601: Failed to get job xml file for job mass-index.xml
    at org.jberet.creation.ArchiveXmlLoader.getJobXml(ArchiveXmlLoader.java:129)
    at org.jberet.creation.ArchiveXmlLoader.loadJobXml(ArchiveXmlLoader.java:91)
    at org.jberet.operations.JobOperatorImpl.start(JobOperatorImpl.java:102)
    at org.hibernate.search.jsr352.MassIndexer.start(MassIndexer.java:90)
    at org.hibernate.search.jsr352.PerformanceIT.testNewMassIndexer(PerformanceIT.java:167)
    ...

_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev


_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev
Reply | Threaded
Open this post in threaded view
|

Re: Deploying JSR 352 job as a module

James Perkins
In reply to this post by Gunnar Morling
You might need to implement an SPI [1] that would expose the job XML. WildFly will look for SPI's and use those to validate and get the job XML data.


On Thu, Aug 18, 2016 at 12:59 AM, Gunnar Morling <[hidden email]> wrote:
Hi,

Is there any example which shows how to deploy a JSR 352 batch job via a module added to WildFly rather than through a deployed application? This batch job should then be usable from applications which declare a dependency to that module.

Trying this, I'm getting an error saying that the batch job's XML descriptor cannot be found [1]. I.e. the module with the batch job is visible to the deployed application (as the MassIndexer class can be accessed), but then JBeret cannot "see" the job XML descriptor within that module.

Is there anything I can configure in the module.xml of the batch job's module for exposing its contents to JBeret?

The use case is Hibernate Search where a GSoC student is working on a JSR 352 batch job for re-indexing entities. This job eventually should be part of Hibernate Search's modules, allowing users to run it if Hibernate Search is enabled for their application.

Thanks for any pointers,

--Gunnar

[1] Exception: javax.batch.operations.JobStartException: JBERET000601: Failed to get job xml file for job mass-index.xml
    at org.jberet.creation.ArchiveXmlLoader.getJobXml(ArchiveXmlLoader.java:129)
    at org.jberet.creation.ArchiveXmlLoader.loadJobXml(ArchiveXmlLoader.java:91)
    at org.jberet.operations.JobOperatorImpl.start(JobOperatorImpl.java:102)
    at org.hibernate.search.jsr352.MassIndexer.start(MassIndexer.java:90)
    at org.hibernate.search.jsr352.PerformanceIT.testNewMassIndexer(PerformanceIT.java:167)
    ...

_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev



--
James R. Perkins
JBoss by Red Hat

_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev
Reply | Threaded
Open this post in threaded view
|

Re: Deploying JSR 352 job as a module

Gunnar Morling
Jan, James,

Thanks for your help, that looks promising. Mincong, the GSoC student, will give your proposals a try tonight.

--Gunnar


2016-08-18 18:32 GMT+02:00 James Perkins <[hidden email]>:
You might need to implement an SPI [1] that would expose the job XML. WildFly will look for SPI's and use those to validate and get the job XML data.


On Thu, Aug 18, 2016 at 12:59 AM, Gunnar Morling <[hidden email]> wrote:
Hi,

Is there any example which shows how to deploy a JSR 352 batch job via a module added to WildFly rather than through a deployed application? This batch job should then be usable from applications which declare a dependency to that module.

Trying this, I'm getting an error saying that the batch job's XML descriptor cannot be found [1]. I.e. the module with the batch job is visible to the deployed application (as the MassIndexer class can be accessed), but then JBeret cannot "see" the job XML descriptor within that module.

Is there anything I can configure in the module.xml of the batch job's module for exposing its contents to JBeret?

The use case is Hibernate Search where a GSoC student is working on a JSR 352 batch job for re-indexing entities. This job eventually should be part of Hibernate Search's modules, allowing users to run it if Hibernate Search is enabled for their application.

Thanks for any pointers,

--Gunnar

[1] Exception: javax.batch.operations.JobStartException: JBERET000601: Failed to get job xml file for job mass-index.xml
    at org.jberet.creation.ArchiveXmlLoader.getJobXml(ArchiveXmlLoader.java:129)
    at org.jberet.creation.ArchiveXmlLoader.loadJobXml(ArchiveXmlLoader.java:91)
    at org.jberet.operations.JobOperatorImpl.start(JobOperatorImpl.java:102)
    at org.hibernate.search.jsr352.MassIndexer.start(MassIndexer.java:90)
    at org.hibernate.search.jsr352.PerformanceIT.testNewMassIndexer(PerformanceIT.java:167)
    ...

_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev



--
James R. Perkins
JBoss by Red Hat


_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev