6 Replies Latest reply on Jan 10, 2018 5:33 PM by nicolas duminil

    JBERET000627: Unexpected XML element 'job' at location [row,col {unknown-source}]: [2,1]"}

    nicolas duminil Master

      Hi,

       

      I'm trying to deploy an EAR on Wildfly 10.1.0. The EAR contains and EJB-JAR which tries to start a Java EE Batch job. the EAR structure is as follows:

       

      bank-ear.ear
      |--lib
      |--META-INF
      |--bank-facade.jar
      |--|--META-INF
      |--|--|--batch-jobs
      |--|--|--|--bank-job.xml
      The code is as follows:

      @Singleton

      @Startup

      public class BankBatchStarter

      {

        private static final Logger slf4jLogger = LoggerFactory.getLogger(BankBatchStarter.class);

       

        @Inject

        @ConfigProperty(name = "bank.money-transfer.batch.starter.jobID")

        private String jobID;

       

       

        @PostConstruct

        public void onStartup()

        {

          slf4jLogger.info("*** BankBatchStarter.onStartup(): starting job {}", jobID);

          BatchRuntime.getJobOperator().start(jobID, null);

        }

      }

       

      The following exception is raised at deploy time:

      12:08:40,015 INFO  [fr.simplex_software.bank.session.BankBatchStarter] (ServerService Thread Pool -- 129) *** BankBatchStarter.onStartup(): starting job bank-job

      12:08:40,018 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 129) MSC000001: Failed to start service jboss.deployment.subunit."bank-master.ear"."bank-facade.jar".component.BankBatchStarter.START: org.jboss.msc.service.StartException in service jboss.deployment.subunit."bank-master.ear"."bank-facade.jar".component.BankBatchStarter.START: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance

      at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:57)

      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

      at java.util.concurrent.FutureTask.run(FutureTask.java:266)

      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

      at java.lang.Thread.run(Thread.java:748)

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

      Caused by: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance

      at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:163)

      at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:134)

      at org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:88)

      at org.jboss.as.ejb3.component.singleton.SingletonComponent.getComponentInstance(SingletonComponent.java:124)

      at org.jboss.as.ejb3.component.singleton.SingletonComponent.start(SingletonComponent.java:138)

      at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:54)

      ... 6 more

      Caused by: javax.ejb.EJBException: javax.batch.operations.JobStartException: JBERET000603: Failed to parse batch XML META-INF/batch.xml

      at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:187)

      at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:277)

      at org.jboss.as.ejb3.tx.CMTTxInterceptor.requiresNew(CMTTxInterceptor.java:349)

      at org.jboss.as.ejb3.tx.LifecycleCMTTxInterceptor.processInvocation(LifecycleCMTTxInterceptor.java:68)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

      at org.jboss.as.weld.injection.WeldInjectionContextInterceptor.processInvocation(WeldInjectionContextInterceptor.java:43)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

      at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

      at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

      at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

      at org.jboss.as.ejb3.component.singleton.StartupCountDownInterceptor.processInvocation(StartupCountDownInterceptor.java:25)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

      at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)

      at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

      at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

      at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:161)

      ... 11 more

      Caused by: javax.batch.operations.JobStartException: JBERET000603: Failed to parse batch XML META-INF/batch.xml

      at org.jberet.creation.ArchiveXmlLoader.loadBatchXml(ArchiveXmlLoader.java:57)

      at org.jberet.runtime.context.JobContextImpl.<init>(JobContextImpl.java:68)

      at org.jberet.operations.JobOperatorImpl.startJobExecution(JobOperatorImpl.java:376)

      at org.jberet.operations.JobOperatorImpl.access$000(JobOperatorImpl.java:64)

      at org.jberet.operations.JobOperatorImpl$2.invoke(JobOperatorImpl.java:128)

      at org.jberet.operations.JobOperatorImpl$2.invoke(JobOperatorImpl.java:124)

      at org.jberet.operations.JobOperatorImpl.invokeTransaction(JobOperatorImpl.java:396)

      at org.jberet.operations.JobOperatorImpl.start(JobOperatorImpl.java:124)

      at org.jberet.operations.JobOperatorImpl.start(JobOperatorImpl.java:104)

      at fr.simplex_software.bank.session.BankBatchStarter.onStartup(BankBatchStarter.java:26)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

      at java.lang.reflect.Method.invoke(Method.java:498)

      at org.jboss.as.ee.component.ManagedReferenceLifecycleMethodInterceptor.processInvocation(ManagedReferenceLifecycleMethodInterceptor.java:96)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

      at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doLifecycleInterception(Jsr299BindingsInterceptor.java:114)

      at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:103)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

      at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)

      at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:73)

      at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

      at org.jboss.as.weld.injection.WeldInjectionInterceptor.processInvocation(WeldInjectionInterceptor.java:53)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

      at org.jboss.as.ee.component.AroundConstructInterceptorFactory$1.processInvocation(AroundConstructInterceptorFactory.java:28)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

      at org.jboss.as.weld.injection.WeldInterceptorInjectionInterceptor.processInvocation(WeldInterceptorInjectionInterceptor.java:56)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

      at org.jboss.as.weld.ejb.Jsr299BindingsCreateInterceptor.processInvocation(Jsr299BindingsCreateInterceptor.java:100)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

      at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

      at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:275)

      ... 29 more

      Caused by: javax.batch.operations.BatchRuntimeException: JBERET000627: Unexpected XML element 'job' at location [row,col {unknown-source}]: [2,1]

      at org.jberet.job.model.JobParser.parseBatchArtifacts(JobParser.java:135)

      at org.jberet.creation.ArchiveXmlLoader.loadBatchXml(ArchiveXmlLoader.java:55)

      ... 62 more

       

       

      12:08:40,019 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 45) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "bank-master.ear")]) - failure description: {

          "WFLYCTL0080: Failed services" => {"jboss.deployment.subunit.\"bank-master.ear\".\"bank-facade.jar\".component.BankBatchStarter.START" => "org.jboss.msc.service.StartException in service jboss.deployment.subunit.\"bank-master.ear\".\"bank-facade.jar\".component.BankBatchStarter.START: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance

          Caused by: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance

          Caused by: javax.ejb.EJBException: javax.batch.operations.JobStartException: JBERET000603: Failed to parse batch XML META-INF/batch.xml

          Caused by: javax.batch.operations.JobStartException: JBERET000603: Failed to parse batch XML META-INF/batch.xml

          Caused by: javax.batch.operations.BatchRuntimeException: JBERET000627: Unexpected XML element 'job' at location [row,col {unknown-source}]: [2,1]"},

          "WFLYCTL0412: Required services that are not installed:" => ["jboss.deployment.subunit.\"bank-master.ear\".\"bank-facade.jar\".component.BankBatchStarter.START"],

          "WFLYCTL0180: Services with missing/unavailable dependencies" => undefined

      }

      12:08:40,020 ERROR [org.jboss.as.server] (management-handler-thread - 45) WFLYSRV0021: Deploy of deployment "bank-master.ear" was rolled back with the following failure message:

      {

          "WFLYCTL0080: Failed services" => {"jboss.deployment.subunit.\"bank-master.ear\".\"bank-facade.jar\".component.BankBatchStarter.START" => "org.jboss.msc.service.StartException in service jboss.deployment.subunit.\"bank-master.ear\".\"bank-facade.jar\".component.BankBatchStarter.START: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance

          Caused by: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance

          Caused by: javax.ejb.EJBException: javax.batch.operations.JobStartException: JBERET000603: Failed to parse batch XML META-INF/batch.xml

          Caused by: javax.batch.operations.JobStartException: JBERET000603: Failed to parse batch XML META-INF/batch.xml

          Caused by: javax.batch.operations.BatchRuntimeException: JBERET000627: Unexpected XML element 'job' at location [row,col {unknown-source}]: [2,1]"},

          "WFLYCTL0412: Required services that are not installed:" => ["jboss.deployment.subunit.\"bank-master.ear\".\"bank-facade.jar\".component.BankBatchStarter.START"],

          "WFLYCTL0180: Services with missing/unavailable dependencies" => undefined

      }

       

      It seems that the cause is: JBERET000627: Unexpected XML element 'job' at location [row,col {unknown-source}]: [2,1]"}

       

      Here is the content of the bank-job.xml file:

       

      <?xml version="1.0" encoding="UTF-8"?>

      <job id="bank-job" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/jobXML_1_0.xsd"

        version="1.0">

        <flow id="money-transfer">

          <step id="unmarshall-files">

            <batchlet ref="moneyTransferBatchlet" />

          </step>

        </flow>

      </job>

       

      The funny thing is that the exception message mentions the file batch.xml. I'm not sure where from this name comes. Am I doing something wrong here ?

       

      Many thanks in advance,

       

      Nicolas