Details

    • Type: Bug
    • Status: Verified (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 7.0.2.GA
    • Fix Version/s: 7.1.0.DR9
    • Component/s: Batch
    • Labels:
      None
    • Target Release:
    • Steps to Reproduce:
      Hide

      batch-jar-in-war

      1. Extract batch-jar-in-war.zip
      2. cd batch-jar-in-war/batch-jar/ then execute mvn clean install
      3. cd batch-jar-in-war/batch-war/ then execute mvn clean package wildfly:deploy
      4. Access web app: http://localhost:8080/batch-jar-in-war/index.jsf
      5. Click the Exec button to invoke a batch job in JAR or WAR.

      Then, you will see "javax.batch.operations.JobStartException: JBERET000601: Failed to get job xml file for job batchInJar.xml" when executing a batch job in jar inside WAR.

      batch-jar-in-ear

      1. Extract batch-jar-in-ear.zip
      2. cd batch-jar-in-ear/ then execute mvn clean install wildfly:deploy
      3. Access web app: http://localhost:8080/batch-jar-in-ear/index.jsf
      4. Click the Exec button to invoke a batch job in JAR or WAR.

      Then, you will see "javax.batch.operations.JobStartException: JBERET000601: Failed to get job xml file for job batchInJar.xml" when executing a batch job in jar inside EAR.

      Show
      batch-jar-in-war 1. Extract batch-jar-in-war.zip 2. cd batch-jar-in-war/batch-jar/ then execute mvn clean install 3. cd batch-jar-in-war/batch-war/ then execute mvn clean package wildfly:deploy 4. Access web app: http://localhost:8080/batch-jar-in-war/index.jsf 5. Click the Exec button to invoke a batch job in JAR or WAR. Then, you will see "javax.batch.operations.JobStartException: JBERET000601: Failed to get job xml file for job batchInJar.xml" when executing a batch job in jar inside WAR. batch-jar-in-ear 1. Extract batch-jar-in-ear.zip 2. cd batch-jar-in-ear/ then execute mvn clean install wildfly:deploy 3. Access web app: http://localhost:8080/batch-jar-in-ear/index.jsf 4. Click the Exec button to invoke a batch job in JAR or WAR. Then, you will see "javax.batch.operations.JobStartException: JBERET000601: Failed to get job xml file for job batchInJar.xml" when executing a batch job in jar inside EAR.
    • Workaround:
      Workaround Exists
    • Workaround Description:
      Hide

      Add META-INF/services/org.jberet.spi.JobXmlResolver with the following content to your batch jar file:

      org.jberet.tools.MetaInfBatchJobsJobXmlResolver
      
      Show
      Add META-INF/services/org.jberet.spi.JobXmlResolver with the following content to your batch jar file: org.jberet.tools.MetaInfBatchJobsJobXmlResolver

      Description

      META-INF/batch-jobs/batchInJar.xml in a batch jar file inside WAR is ignored and never loaded. This resulted in "javax.batch.operations.JobStartException: JBERET000601: Failed to get job xml file for job batchInJar.xml" when executing a batch job in jar inside WAR.

      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
              `-- ...
      

      It appears that org.wildfly.extension.batch.jberet.deployment.BatchEnvironmentProcessor and org.wildfly.extension.batch.jberet.deployment.WildFlyJobXmlResolver are never invoked for batch jar files under WAR's WEB-INF/lib. And same applies to batch jar files under EAR's lib. Therefore, any job xml in META-INF/batch-jobs is not scanned for such batch jar files.

      A same issue was reported in WFLY-4988.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  jamezp James Perkins
                  Reporter:
                  mmiura Masafumi Miura
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: