Uploaded image for project: 'JBeret'
  1. JBeret
  2. JBERET-255

ClassNotFoundException while accessing persistent user data

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 1.0.2.Final
    • jberet-core
    • None
    • Hide

      testJob:

      
      <job id="testJob" xmlns="http://xmlns.jcp.org/xml/ns/javaee" version="1.0">
      	<flow id="test">
      		<step id="step1" next="step2">
      			<batchlet ref="storesPersistentDataBatchlet" />
      		</step>
      		<step id="step2" >
      			<batchlet ref="testBatchlet">
      				<properties>
      					<property name="fromStep" value="step1" />
      					<property name="throwException" value="#{jobParameters['throwException']}" />
      				</properties>
      			</batchlet>
      		</step>
      	</flow>
      </job>
      

      step1: stores persistent user data
      step2: reads persistent user data from step1

      To create a test constellation for a job restart step2 can forced to throw an exception.

      Steps to reproduce:

      • start Wildfly
      • start testJob with parameter throwException = "true"
      • stop Wildfly
      • start Wildfly again
      • restart testJob with parameter throwException = "false"

      then we get:
      07:07:03,056 ERROR [org.jberet] (Batch Thread - 1) JBERET000007: Failed to run job testJob, test, org.jberet.job.model.Flow@372b1ee0: javax.batch.operations.BatchRuntimeException: JBERET000626: Failed to run SELECT STEP_EXECUTION.* FROM STEP_EXECUTION INNER JOIN JOB_EXECUTION ON STEP_EXECUTION.JOBEXECUTIONID = JOB_EXECUTION.JOBEXECUTIONID WHERE JOB_EXECUTION.JOBINSTANCEID=? AND STEP_EXECUTION.STEPNAME=? ORDER BY STEP_EXECUTION.STEPEXECUTIONID DESC
      at org.jberet.repository.JdbcRepository.findOriginalStepExecutionForRestart(JdbcRepository.java:695) [jberet-core-1.0.2.Final.jar:1.0.2.Final]
      at org.jberet.runtime.context.StepContextImpl.<init>(StepContextImpl.java:51) [jberet-core-1.0.2.Final.jar:1.0.2.Final]
      at org.jberet.runtime.runner.CompositeExecutionRunner.runStep(CompositeExecutionRunner.java:156) [jberet-core-1.0.2.Final.jar:1.0.2.Final]
      at org.jberet.runtime.runner.CompositeExecutionRunner.runFromHeadOrRestartPoint(CompositeExecutionRunner.java:88) [jberet-core-1.0.2.Final.jar:1.0.2.Final]
      at org.jberet.runtime.runner.FlowExecutionRunner.run(FlowExecutionRunner.java:47) [jberet-core-1.0.2.Final.jar:1.0.2.Final]
      at org.jberet.runtime.runner.CompositeExecutionRunner.runFlow(CompositeExecutionRunner.java:200) [jberet-core-1.0.2.Final.jar:1.0.2.Final]
      at org.jberet.runtime.runner.CompositeExecutionRunner.runFromHeadOrRestartPoint(CompositeExecutionRunner.java:95) [jberet-core-1.0.2.Final.jar:1.0.2.Final]
      at org.jberet.runtime.runner.JobExecutionRunner.run(JobExecutionRunner.java:58) [jberet-core-1.0.2.Final.jar:1.0.2.Final]
      at org.wildfly.jberet.services.BatchEnvironmentService$WildFlyBatchEnvironment$1.run(BatchEnvironmentService.java:144) [wildfly-jberet-8.2.0.Final.jar:8.2.0.Final]
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [rt.jar:1.8.0_45]
      at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_45]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_45]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_45]
      at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_45]
      at org.jboss.threads.JBossThread.run(JBossThread.java:122)
      Caused by: java.lang.ClassNotFoundException: de.alvara.batch.base.UserData from [Module "org.jberet.jberet-core:main" from local module loader @7591083d (finder: local module finder @77a567e1 (roots: D:\development\jbossDev\server\wildfly-8.2.0.Final-alvara-20150927\modules,D:\development\jbossDev\server\wildfly-8.2.0.Final-alvara-20150927\modules\system\layers\base))]
      at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213) [jboss-modules.jar:1.3.3.Final]
      at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.3.Final]
      at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.3.Final]
      at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.3.Final]
      at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.3.Final]
      at java.lang.Class.forName0(Native Method) [rt.jar:1.8.0_45]
      at java.lang.Class.forName(Class.java:348) [rt.jar:1.8.0_45]
      at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:626) [rt.jar:1.8.0_45]
      at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1613) [rt.jar:1.8.0_45]
      at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1518) [rt.jar:1.8.0_45]
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1774) [rt.jar:1.8.0_45]
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351) [rt.jar:1.8.0_45]
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371) [rt.jar:1.8.0_45]
      at org.jberet.util.BatchUtil.bytesToSerializableObject(BatchUtil.java:111) [jberet-core-1.0.2.Final.jar:1.0.2.Final]
      at org.jberet.repository.JdbcRepository.createStepExecutionsFromResultSet(JdbcRepository.java:746) [jberet-core-1.0.2.Final.jar:1.0.2.Final]
      at org.jberet.repository.JdbcRepository.findOriginalStepExecutionForRestart(JdbcRepository.java:693) [jberet-core-1.0.2.Final.jar:1.0.2.Final]
      ... 14 more

      If we don't stop and start Wildfly the error does not occur.

      Show
      testJob: <job id= "testJob" xmlns= "http://xmlns.jcp.org/xml/ns/javaee" version= "1.0" > <flow id= "test" > <step id= "step1" next= "step2" > <batchlet ref= "storesPersistentDataBatchlet" /> </step> <step id= "step2" > <batchlet ref= "testBatchlet" > <properties> <property name= "fromStep" value= "step1" /> <property name= "throwException" value= "#{jobParameters[ 'throwException' ]}" /> </properties> </batchlet> </step> </flow> </job> step1: stores persistent user data step2: reads persistent user data from step1 To create a test constellation for a job restart step2 can forced to throw an exception. Steps to reproduce: start Wildfly start testJob with parameter throwException = "true" stop Wildfly start Wildfly again restart testJob with parameter throwException = "false" then we get: 07:07:03,056 ERROR [org.jberet] (Batch Thread - 1) JBERET000007: Failed to run job testJob, test, org.jberet.job.model.Flow@372b1ee0: javax.batch.operations.BatchRuntimeException: JBERET000626: Failed to run SELECT STEP_EXECUTION.* FROM STEP_EXECUTION INNER JOIN JOB_EXECUTION ON STEP_EXECUTION.JOBEXECUTIONID = JOB_EXECUTION.JOBEXECUTIONID WHERE JOB_EXECUTION.JOBINSTANCEID=? AND STEP_EXECUTION.STEPNAME=? ORDER BY STEP_EXECUTION.STEPEXECUTIONID DESC at org.jberet.repository.JdbcRepository.findOriginalStepExecutionForRestart(JdbcRepository.java:695) [jberet-core-1.0.2.Final.jar:1.0.2.Final] at org.jberet.runtime.context.StepContextImpl.<init>(StepContextImpl.java:51) [jberet-core-1.0.2.Final.jar:1.0.2.Final] at org.jberet.runtime.runner.CompositeExecutionRunner.runStep(CompositeExecutionRunner.java:156) [jberet-core-1.0.2.Final.jar:1.0.2.Final] at org.jberet.runtime.runner.CompositeExecutionRunner.runFromHeadOrRestartPoint(CompositeExecutionRunner.java:88) [jberet-core-1.0.2.Final.jar:1.0.2.Final] at org.jberet.runtime.runner.FlowExecutionRunner.run(FlowExecutionRunner.java:47) [jberet-core-1.0.2.Final.jar:1.0.2.Final] at org.jberet.runtime.runner.CompositeExecutionRunner.runFlow(CompositeExecutionRunner.java:200) [jberet-core-1.0.2.Final.jar:1.0.2.Final] at org.jberet.runtime.runner.CompositeExecutionRunner.runFromHeadOrRestartPoint(CompositeExecutionRunner.java:95) [jberet-core-1.0.2.Final.jar:1.0.2.Final] at org.jberet.runtime.runner.JobExecutionRunner.run(JobExecutionRunner.java:58) [jberet-core-1.0.2.Final.jar:1.0.2.Final] at org.wildfly.jberet.services.BatchEnvironmentService$WildFlyBatchEnvironment$1.run(BatchEnvironmentService.java:144) [wildfly-jberet-8.2.0.Final.jar:8.2.0.Final] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [rt.jar:1.8.0_45] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_45] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_45] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_45] at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_45] at org.jboss.threads.JBossThread.run(JBossThread.java:122) Caused by: java.lang.ClassNotFoundException: de.alvara.batch.base.UserData from [Module "org.jberet.jberet-core:main" from local module loader @7591083d (finder: local module finder @77a567e1 (roots: D:\development\jbossDev\server\wildfly-8.2.0.Final-alvara-20150927\modules,D:\development\jbossDev\server\wildfly-8.2.0.Final-alvara-20150927\modules\system\layers\base))] at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213) [jboss-modules.jar:1.3.3.Final] at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.3.Final] at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.3.Final] at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.3.Final] at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.3.Final] at java.lang.Class.forName0(Native Method) [rt.jar:1.8.0_45] at java.lang.Class.forName(Class.java:348) [rt.jar:1.8.0_45] at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:626) [rt.jar:1.8.0_45] at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1613) [rt.jar:1.8.0_45] at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1518) [rt.jar:1.8.0_45] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1774) [rt.jar:1.8.0_45] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351) [rt.jar:1.8.0_45] at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371) [rt.jar:1.8.0_45] at org.jberet.util.BatchUtil.bytesToSerializableObject(BatchUtil.java:111) [jberet-core-1.0.2.Final.jar:1.0.2.Final] at org.jberet.repository.JdbcRepository.createStepExecutionsFromResultSet(JdbcRepository.java:746) [jberet-core-1.0.2.Final.jar:1.0.2.Final] at org.jberet.repository.JdbcRepository.findOriginalStepExecutionForRestart(JdbcRepository.java:693) [jberet-core-1.0.2.Final.jar:1.0.2.Final] ... 14 more If we don't stop and start Wildfly the error does not occur.

      We use persistent user data to provide information from one step to a following step. This works fine, except during restarting the job after a restart of the Wildfly.

      When we get a ClassNotFoundException concerning our persistent user data class.

        1. testJob.xml
          0.5 kB
        2. TestBatchlet.java
          2 kB
        3. StoresPersistentDataBatchlet.java
          0.6 kB

              cfang@redhat.com Cheng Fang
              gvwolf3d Gunther vw (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: