java ee - Invoke batch job from EJB -


i trying invoke batch job ejb. batch job based on javax.batch-api-1.0.jar, not spring. in ejb, use following lines invoke batch job:

joboperator joboperator = batchruntime.getjoboperator(); properties props = new properties(); long execid=joboperator.start("mybatch-job", props); 

however, failed. debug shows batchruntime.getjoboperator() returns null. tell me why invocation failed? thanks.

===== problem should failed inject joboperator ejb. don't know how fix it. tried using @inject,

@inject joboperator joboperator;  ...  properties props = new properties(); joboperator.start("mybatch-job", props); 

and add jobproducer class:

@named public class jobproducers {      @produces     @default     public joboperator getjoboperator() {         return batchruntime.getjoboperator();     } } 

however, still doesn't work.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -