1 Reply Latest reply on Feb 20, 2015 5:21 AM by Kohei Nozaki

    Error Running Batch Job in WildFly 8.2 Java EE 7 Eclipse Dynamic Web Project

    Prerak Tiwari Newbie

      I am trying to run Batch Jobs through Servlet. When the following statement executesJobOperator jo = BatchRuntime.getJobOperator();, I am getting below error:


      ERROR [io.undertow.request] (default task-8) UT005023: Exception handling request to /BatchProcessing/batchprocessing: java.util.ServiceConfigurationError: javax.batch.operations.JobOperator: Provider org.jberet.operations.JobOperatorImpl could not be instantiated: 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.
        at java
      .util.ServiceLoader.fail(ServiceLoader.java:224) [rt.jar:1.7.0_51]
        at java
      .util.ServiceLoader.access$100(ServiceLoader.java:181) [rt.jar:1.7.0_51]
        at java
      .util.ServiceLoader$LazyIterator.next(ServiceLoader.java:377) [rt.jar:1.7.0_51]
        at java
      .util.ServiceLoader$1.next(ServiceLoader.java:445) [rt.jar:1.7.0_51]
        at javax
      .batch.runtime.BatchRuntime.getJobOperator(BatchRuntime.java:57) [jboss-batch-api_1.0_spec-1.0.0.Final.jar:1.0.0.Final]
        at com
      .tcs.servlets.BatchServlets.doPost(BatchServlets.java:43) [classes:]
        at com
      .tcs.servlets.BatchServlets.doGet(BatchServlets.java:29) [classes:]
        at javax
      .servlet.http.HttpServlet.service(HttpServlet.java:687) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]
        at javax
      .servlet.http.HttpServlet.service(HttpServlet.java:790) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]
        at io
      .undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
        at io
      .undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
        at io
      .undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
        at org
      .wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
        at io
      .undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
        at io
      .undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
        at io
      .undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
        at io
      .undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
        at io
      .undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
        at io
      .undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:63) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
        at io
      .undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
        at io
      .undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
        at io
      .undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
        at io
      .undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
        at org
      .wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
        at io
      .undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
        at io
      .undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
        at io
      .undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:261) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
        at io
      .undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:247) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
        at io
      .undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:76) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
        at io
      .undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:166) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
        at io
      .undertow.server.Connectors.executeRootHandler(Connectors.java:197) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
        at io
      .undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:759) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
        at java
      .util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_51]
        at java
      .util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_51]
        at java
      .lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_51]
      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.
        at org
      .wildfly.jberet.services.BatchEnvironmentService$WildFlyBatchEnvironment.getArtifactFactory(BatchEnvironmentService.java:131) [wildfly-jberet-8.2.0.Final.jar:8.2.0.Final]
        at org
      .wildfly.jberet.DelegatingBatchEnvironment.getArtifactFactory(DelegatingBatchEnvironment.java:51) [wildfly-jberet-8.2.0.Final.jar:8.2.0.Final]
        at org
      .jberet.operations.JobOperatorImpl.<init>(JobOperatorImpl.java:69) [jberet-core-1.0.2.Final.jar:1.0.2.Final]
        at sun
      .reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.7.0_51]
        at sun
      .reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [rt.jar:1.7.0_51]
        at sun
      .reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.7.0_51]
        at java
      .lang.reflect.Constructor.newInstance(Constructor.java:526) [rt.jar:1.7.0_51]
        at java
      .lang.Class.newInstance(Class.java:374) [rt.jar:1.7.0_51]
        at java
      .util.ServiceLoader$LazyIterator.next(ServiceLoader.java:373) [rt.jar:1.7.0_51]
        
      ... 32 more


      I have placed job.xml file in "WebContent/META-INF/batch-jobs/" folder. Don't know what is wrong with the configuration. I have attached the code which I used. Any help is appreciated.