JobOperator could not be instantiated

Viewed 2785

When I try to run this code to execute a batchjob:

JobOperator jo = BatchRuntime.getJobOperator();
Properties props = new Properties();
long jobId = jo.start("tweetimport", props);

I keep getting an error. When I tried to run it from the servlet I got this error:

Severe:   Could not instantiate service: com.ibm.jbatch.container.impl.BatchKernelImpl due to exception:java.lang.reflect.InvocationTargetException
Warning:   StandardWrapperValve[KwetterServlet]: Servlet.service() for servlet KwetterServlet threw exception
java.util.ServiceConfigurationError: javax.batch.operations.JobOperator: Provider com.ibm.jbatch.container.api.impl.JobOperatorImpl could not be instantiated

When I run it from a normal java class I get this errror:

mrt 21, 2016 10:19:08 AM javax.batch.runtime.BatchRuntime getJobOperator
WARNING: The ServiceLoader was unable to find an implementation for JobOperator. Check classpath for META-INF/services/javax.batch.operations.JobOperator file.
Exception in thread "main" java.lang.NullPointerException

I have this tweetimport.xml file in Other Sources > src/main/resources > META-INF.batch-jobs

<job id="tweetimport" xmlns="http://xmlns.jcp.org/xml/ns/javaee" version="1.0">
<properties>
    <property name="input_file" value="/KwetterBackend/kwetter-input.json"/>
</properties>
<step id="process">
    <chunk item-count="100">
        <reader ref="TweetReader"></reader>
        <processor ref="TweetProcessor"></processor>
        <writer ref="TweetWriter"></writer>
    </chunk>
</step>

I can't figure out why I'm getting this error. The link to my project

1 Answers
Related