Unable to load job xml in jar files inside WAR (and EAR) in EAP 7.0.x

Solution Unverified - Updated -

Issue

META-INF/batch-jobs/batchInJar.xml in a batch jar file inside WAR is ignored and never loaded. This resulted in the following exception when executing a batch job in jar inside WAR.

javax.batch.operations.JobStartException: JBERET000601: Failed to get job xml file for job batchInJar.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 service.BatchService.start(BatchService.java:11)
    at controller.BatchTestController.batchInJarStart(BatchTestController.java:27)
        ...(snip)...

Here's an example directory structure of the war file and the jar file included in the war file:

[1] batch-jar-in-war.war
    |-- index.xhtml
    |-- META-INF
    |   `-- MANIFEST.MF
    `-- WEB-INF
        |-- classes
        |   |-- ...
        |   `-- META-INF
        |       `-- batch-jobs
        |           `-- batchInWar.xml <-- This job xml works
        |-- faces-config.xml
        |-- lib
        |   `-- simpleBatch-1.0.jar --- [2]
        `-- web.xml
[2] simpleBatch-1.0.jar
    |-- META-INF
    |   |-- batch-jobs
    |   |   `-- batchInJar.xml  <-- This job xml is unable to load
    |-- processor
    |   `-- ...
    |-- reader
    |   `-- ...
    |-- service
    |   `-- ...
    `-- writer
        `-- ...

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 7.0.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content