"javax.batch.operations.NoSuchJobException: WFLYBATCH000005: The job name '<batch-job-name>' was not found for the deployment" happens when querying batch jobs in a sub-deployment or libary jar in EAP 7.0.x/7.1.x

Solution Unverified - Updated -

Issue

As mentioned in this knowledge article, we are now able to start a batch job in a sub-deployment or library jar after upgrading to EAP 7.0.6 or later.

However, javax.batch.operations.NoSuchJobException: WFLYBATCH000005: The job name '<batch-job-name>' was not found for the deployment. happens when the application queries the batch job by executing javax.batch.operations.JobOperator API like javax.batch.operations.JobOperator#getJobInstance().

javax.batch.operations.NoSuchJobException: WFLYBATCH000005: The job name '<batch-job-name>' was not found for the deployment.
   at org.wildfly.extension.batch.jberet.deployment.JobOperatorService.validateJob(JobOperatorService.java:404)
   at org.wildfly.extension.batch.jberet.deployment.JobOperatorService.getJobInstance(JobOperatorService.java:282)
   at org.jberet.operations.DelegatingJobOperator.getJobInstance(DelegatingJobOperator.java:87)
   at com.redhat.jboss.support.example.service.BatchService.getJobName(BatchService.java:26)
   at com.redhat.jboss.support.example.controller.BatchTestController.getJobName(BatchTestController.java:57)
   ....

Environment

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

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In