1 Reply Latest reply on Feb 23, 2015 10:12 AM by Prerak Tiwari

    Problems running a batch job - beans.xml not found

    Miroslav Vaško Newbie

      Hello,

       

      I'm getting a weird error, when trying to run a batchlet. The project runs without problems on Glassfish 4. The stack is:

       

      19:39:22,943 INFO  [org.jboss.as.server] (management-handler-thread - 3) JBAS018562: Redeployed "movies.war"

      19:39:35,988 INFO  [stdout] (batch-batch - 1) Found 1139 movies on HDD.

      19:39:35,989 INFO  [com.zemiak.movies.batch.service.Listener] (batch-batch - 1) End step newmovies-prepare

      19:39:35,990 INFO  [stdout] (batch-batch - 2) Found 1139 movies on HDD.

      19:39:35,990 INFO  [com.zemiak.movies.batch.service.Listener] (batch-batch - 2) End step newmovies-prepare

      19:39:35,992 INFO  [stdout] (batch-batch - 3) Found 1139 movies on HDD.

      19:39:35,992 INFO  [com.zemiak.movies.batch.service.Listener] (batch-batch - 3) End step newmovies-prepare

      19:39:35,997 WARN  [org.jberet] (batch-batch - 3) JBERET000001: Failed to run batchlet org.jberet.job.model.RefArtifact@5c4b9a3c: java.lang.IllegalStateException: JBERET000600: Failed to create artifact with ref name PrepareLogFile.  Ensure CDI beans.xml is present and batch.xml, if any, is configured properly.

        at org.jberet.runtime.context.JobContextImpl.createArtifact(JobContextImpl.java:195) [jberet-core-1.0.0.Final.jar:1.0.0.Final]

        at org.jberet.runtime.runner.BatchletRunner.run(BatchletRunner.java:45) [jberet-core-1.0.0.Final.jar:1.0.0.Final]

        at org.jberet.runtime.runner.StepExecutionRunner.runBatchletOrChunk(StepExecutionRunner.java:207) [jberet-core-1.0.0.Final.jar:1.0.0.Final]

        at org.jberet.runtime.runner.StepExecutionRunner.run(StepExecutionRunner.java:131) [jberet-core-1.0.0.Final.jar:1.0.0.Final]

        at org.jberet.runtime.runner.CompositeExecutionRunner.runStep(CompositeExecutionRunner.java:162) [jberet-core-1.0.0.Final.jar:1.0.0.Final]

        at org.jberet.runtime.runner.CompositeExecutionRunner.runJobElement(CompositeExecutionRunner.java:126) [jberet-core-1.0.0.Final.jar:1.0.0.Final]

        at org.jberet.runtime.runner.StepExecutionRunner.run(StepExecutionRunner.java:177) [jberet-core-1.0.0.Final.jar:1.0.0.Final]

        at org.jberet.runtime.runner.CompositeExecutionRunner.runStep(CompositeExecutionRunner.java:162) [jberet-core-1.0.0.Final.jar:1.0.0.Final]

        at org.jberet.runtime.runner.CompositeExecutionRunner.runFromHeadOrRestartPoint(CompositeExecutionRunner.java:88) [jberet-core-1.0.0.Final.jar:1.0.0.Final]

        at org.jberet.runtime.runner.FlowExecutionRunner.run(FlowExecutionRunner.java:47) [jberet-core-1.0.0.Final.jar:1.0.0.Final]

        at org.jberet.runtime.runner.CompositeExecutionRunner.runFlow(CompositeExecutionRunner.java:198) [jberet-core-1.0.0.Final.jar:1.0.0.Final]

        at org.jberet.runtime.runner.CompositeExecutionRunner.runFromHeadOrRestartPoint(CompositeExecutionRunner.java:93) [jberet-core-1.0.0.Final.jar:1.0.0.Final]

        at org.jberet.runtime.runner.JobExecutionRunner.run(JobExecutionRunner.java:58) [jberet-core-1.0.0.Final.jar:1.0.0.Final]

        at org.wildfly.jberet.services.BatchEnvironmentService$WildFlyBatchEnvironment$1.run(BatchEnvironmentService.java:149) [wildfly-jberet-8.0.0.Final.jar:8.0.0.Final]

        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [rt.jar:1.8.0]

        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0]

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0]

        at java.lang.Thread.run(Thread.java:744) [rt.jar:1.8.0]

        at org.jboss.threads.JBossThread.run(JBossThread.java:122)

      Caused by: org.jboss.weld.exceptions.IllegalStateException: WELD-001333: BeanManager method getBeans() is not available after shutdown

        at org.jboss.weld.bean.builtin.BeanManagerProxy.checkContainerValidated(BeanManagerProxy.java:157) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]

        at org.jboss.weld.bean.builtin.BeanManagerProxy.getBeans(BeanManagerProxy.java:97) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]

        at org.wildfly.jberet.WildFlyArtifactFactory.getBean(WildFlyArtifactFactory.java:59) [wildfly-jberet-8.0.0.Final.jar:8.0.0.Final]

        at org.wildfly.jberet.WildFlyArtifactFactory.create(WildFlyArtifactFactory.java:53) [wildfly-jberet-8.0.0.Final.jar:8.0.0.Final]

        at org.jberet.creation.ArtifactFactoryWrapper.create(ArtifactFactoryWrapper.java:39) [jberet-core-1.0.0.Final.jar:1.0.0.Final]

        at org.jberet.runtime.context.JobContextImpl.createArtifact(JobContextImpl.java:193) [jberet-core-1.0.0.Final.jar:1.0.0.Final]

        ... 19 more

       

      The source lives at https://github.com/zemiak/movies

      Do I need to copy beans.xml somewhere else in the WAR so the "jberet" is able to find it?

       

      Thanks for any hints!