Is Java Batch (JSR 352) part of the SE JDK ? (BatchRuntime returns NULL for Joboperator)

1k views Asked by At

I have written a Java batch application using the JSR352 implementation from JavaSE. I have a Reader, Processor and Writer.

Since am running this java app from console in a JavaSE environment, I use the following code in my main(String[] args) method to start the job.

final JobOperator jobOperator = BatchRuntime.getJobOperator();
jobOperator.start("Job.xml", null);

but, the getJobOperator() returns NULL and get the following error message

WARNING: javax.batch.runtime.BatchRuntime The ServiceLoader was unable to find an implemenation for JobOperator. Check classpath for META-INF/services/javax.batch.operations.JobOperator file.

Should I write any implementation of the JobOperator interface ?

1

There are 1 answers

7
Scott Kurz On BEST ANSWER

The javax.batch.* APIs, though part of the EE 7 platform, were designed to be usable in SE (they don't inherently require a full EE platform). However, they are not designated as part of the SE platform, so they are not going to be part of a JDK. You'd need to use a Java Batch implementation, such as SpringBatch, or the Reference Implementation.