1

I got this package:

ApplicationEAR
--ModuleWeb.war
--ModuleBatch.jar
 +--batch-jobs
   +--mybatch.xml
  --batch.xml
--ModuleJpa.jar

In .war module there is a REST service I want to use to call mybatch.xml job. Here is a bit of code:

JobOperator jo = BatchRuntime.getJobOperator();
long id = jo.start("mybatch", null);

When I call my service, I got this exception:

...
Caused by: java.lang.IllegalStateException: JBAS020560: BeanManager service was not added on the deployment. Ensure the deployment has a META-INF/batch.xml file or the META-INF/batch-jobs directory contains batch configuration files.
...

Do I have to change package structure? Does JobOperator must be stick to batch files and folder?

Francesco
  • 1,742
  • 5
  • 44
  • 78
  • Which application server are you using? In my case, I managed to make a deployment as you describe, but using Wildfly9 as application server... see my [answer](http://stackoverflow.com/questions/33814576/jsr-352-wildfly9-jberet-how-to-call-a-batch-job-that-it-is-not-contained-at) ... The solution is detailed for a war, but it can be extended for a ear deployment also... – Carlitos Way Dec 01 '15 at 02:47
  • As the error message says, the specification guarantees the ability to load from **META-INF/batch-jobs** but specific implementations may define other mechanisms. Not sure which you're using. – Scott Kurz Jan 21 '16 at 21:48

0 Answers0