org.springframework.batch.core.step.AbstractStep$FatalException: Fatal failure detected

Spring JIRA | Praveen Kumar Battu | 7 years ago
  1. 0

    [BATCH-1307] MapJobRepository with multi-threaded parallel steps (split in job) - Spring JIRA

    spring.io | 1 year ago
    org.springframework.batch.core.step.AbstractStep$FatalException: Fatal failure detected
  2. 0

    I am trying to execute a job which is divided into two different steps. Step1: Read the data from a xml file (using JAXB for un-marshaling of the xml data) Step 2: Business processing of the Data (which intern contains multiple steps), As each business processing steps are independent to each other, due to this I am parallel process them using <split> and <flow> elements as described below. <job id="ParallelJobProcessing" job-repository="jobRepository"> <step id="main" next="split1"> <tasklet> <chunk reader="eventLogReader" processor="eventLogProcessor" writer="dummyFlatFileWriter" commit-interval="12000" /> </tasklet> </step> <split id="split1" task-executor="asyncTaskExecutor" > <flow> <step id="totalEventCount"> <tasklet ref="totalEventCountTaskRef"/> </step> </flow> <flow> <step id="allowedEventCount"> <tasklet ref="allowedEventCountref"/> </step> </flow> </split> <listeners> <listener ref="jobTimeRecorderRef" /> </listeners> </job> <beans:bean id="asyncTaskExecutor" class="org.springframework.core.task.SimpleAsyncTaskExecutor" /> When I add a Task Executor to split tag I am receiving following exception, please let me know what needs to be done to solve the above issue. org.springframework.transaction.IllegalTransactionStateException: Transaction is already completed - do not call commit or rollback more than once per transaction at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:795) at org.springframework.batch.core.step.tasklet.TaskletStep.rollback(TaskletStep.java:368) at org.springframework.batch.core.step.tasklet.TaskletStep.access$1000(TaskletStep.java:68) at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:309) at org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:67) at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:352) at org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:212) at org.springframework.batch.repeat.support.RepeatTemplate.iterate(RepeatTemplate.java:143) at org.springframework.batch.core.step.tasklet.TaskletStep.doExecute(TaskletStep.java:239) at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:197) at org.springframework.batch.core.job.AbstractJob.handleStep(AbstractJob.java:348) at org.springframework.batch.core.job.flow.FlowJob.access$100(FlowJob.java:43) at org.springframework.batch.core.job.flow.FlowJob$JobFlowExecutor.executeStep(FlowJob.java:137) at org.springframework.batch.core.job.flow.support.state.StepState.handle(StepState.java:60) at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:144) at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:124) at org.springframework.batch.core.job.flow.support.state.SplitState$1.call(SplitState.java:82) at org.springframework.batch.core.job.flow.support.state.SplitState$1.call(SplitState.java:80) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.lang.Thread.run(Unknown Source) 15:59:35,484 DEBUG TaskletStep:299 - Saving step execution after commit: StepExecution: id=2, name=allowedEventCount, status=STARTED, exitStatus=EXECUTING, readCount=0, filterCount=0, writeCount=0 readSkipCount=0, writeSkipCount=0, commitCount=1, rollbackCount=0, exitDescription= 15:59:35,484 DEBUG ResourcelessTransactionManager:371 - Creating new transaction with name [org.springframework.batch.core.repository.JobRepository.update]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT 15:59:35,484 ERROR AbstractStep:213 - Encountered an error executing the step: class org.springframework.batch.core.step.AbstractStep$FatalException: Fatal failure detected org.springframework.batch.core.step.AbstractStep$FatalException: Fatal failure detected at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:303) at org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:67) at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:352) at org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:212) at org.springframework.batch.repeat.support.RepeatTemplate.iterate(RepeatTemplate.java:143) at org.springframework.batch.core.step.tasklet.TaskletStep.doExecute(TaskletStep.java:239) at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:197) at org.springframework.batch.core.job.AbstractJob.handleStep(AbstractJob.java:348) at org.springframework.batch.core.job.flow.FlowJob.access$100(FlowJob.java:43) at org.springframework.batch.core.job.flow.FlowJob$JobFlowExecutor.executeStep(FlowJob.java:137) at org.springframework.batch.core.job.flow.support.state.StepState.handle(StepState.java:60) at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:144) at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:124) at org.springframework.batch.core.job.flow.support.state.SplitState$1.call(SplitState.java:82) at org.springframework.batch.core.job.flow.support.state.SplitState$1.call(SplitState.java:80) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: org.springframework.dao.OptimisticLockingFailureException: Attempt to update step execution id=1 with wrong version (1), where current version is 0 at org.springframework.batch.core.repository.dao.MapStepExecutionDao.updateStepExecution(MapStepExecutionDao.java:86) at org.springframework.batch.core.repository.support.SimpleJobRepository.update(SimpleJobRepository.java:167) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy2.update(Unknown Source) at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:300) ... 17 more Please find the attachments (normal log and error log) for the complete log information without task-executor and with.

    Spring JIRA | 7 years ago | Praveen Kumar Battu
    org.springframework.batch.core.step.AbstractStep$FatalException: Fatal failure detected
  3. 0

    I am trying to execute a job which is divided into two different steps. Step1: Read the data from a xml file (using JAXB for un-marshaling of the xml data) Step 2: Business processing of the Data (which intern contains multiple steps), As each business processing steps are independent to each other, due to this I am parallel process them using <split> and <flow> elements as described below. <job id="ParallelJobProcessing" job-repository="jobRepository"> <step id="main" next="split1"> <tasklet> <chunk reader="eventLogReader" processor="eventLogProcessor" writer="dummyFlatFileWriter" commit-interval="12000" /> </tasklet> </step> <split id="split1" task-executor="asyncTaskExecutor" > <flow> <step id="totalEventCount"> <tasklet ref="totalEventCountTaskRef"/> </step> </flow> <flow> <step id="allowedEventCount"> <tasklet ref="allowedEventCountref"/> </step> </flow> </split> <listeners> <listener ref="jobTimeRecorderRef" /> </listeners> </job> <beans:bean id="asyncTaskExecutor" class="org.springframework.core.task.SimpleAsyncTaskExecutor" /> When I add a Task Executor to split tag I am receiving following exception, please let me know what needs to be done to solve the above issue. org.springframework.transaction.IllegalTransactionStateException: Transaction is already completed - do not call commit or rollback more than once per transaction at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:795) at org.springframework.batch.core.step.tasklet.TaskletStep.rollback(TaskletStep.java:368) at org.springframework.batch.core.step.tasklet.TaskletStep.access$1000(TaskletStep.java:68) at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:309) at org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:67) at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:352) at org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:212) at org.springframework.batch.repeat.support.RepeatTemplate.iterate(RepeatTemplate.java:143) at org.springframework.batch.core.step.tasklet.TaskletStep.doExecute(TaskletStep.java:239) at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:197) at org.springframework.batch.core.job.AbstractJob.handleStep(AbstractJob.java:348) at org.springframework.batch.core.job.flow.FlowJob.access$100(FlowJob.java:43) at org.springframework.batch.core.job.flow.FlowJob$JobFlowExecutor.executeStep(FlowJob.java:137) at org.springframework.batch.core.job.flow.support.state.StepState.handle(StepState.java:60) at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:144) at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:124) at org.springframework.batch.core.job.flow.support.state.SplitState$1.call(SplitState.java:82) at org.springframework.batch.core.job.flow.support.state.SplitState$1.call(SplitState.java:80) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.lang.Thread.run(Unknown Source) 15:59:35,484 DEBUG TaskletStep:299 - Saving step execution after commit: StepExecution: id=2, name=allowedEventCount, status=STARTED, exitStatus=EXECUTING, readCount=0, filterCount=0, writeCount=0 readSkipCount=0, writeSkipCount=0, commitCount=1, rollbackCount=0, exitDescription= 15:59:35,484 DEBUG ResourcelessTransactionManager:371 - Creating new transaction with name [org.springframework.batch.core.repository.JobRepository.update]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT 15:59:35,484 ERROR AbstractStep:213 - Encountered an error executing the step: class org.springframework.batch.core.step.AbstractStep$FatalException: Fatal failure detected org.springframework.batch.core.step.AbstractStep$FatalException: Fatal failure detected at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:303) at org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:67) at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:352) at org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:212) at org.springframework.batch.repeat.support.RepeatTemplate.iterate(RepeatTemplate.java:143) at org.springframework.batch.core.step.tasklet.TaskletStep.doExecute(TaskletStep.java:239) at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:197) at org.springframework.batch.core.job.AbstractJob.handleStep(AbstractJob.java:348) at org.springframework.batch.core.job.flow.FlowJob.access$100(FlowJob.java:43) at org.springframework.batch.core.job.flow.FlowJob$JobFlowExecutor.executeStep(FlowJob.java:137) at org.springframework.batch.core.job.flow.support.state.StepState.handle(StepState.java:60) at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:144) at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:124) at org.springframework.batch.core.job.flow.support.state.SplitState$1.call(SplitState.java:82) at org.springframework.batch.core.job.flow.support.state.SplitState$1.call(SplitState.java:80) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: org.springframework.dao.OptimisticLockingFailureException: Attempt to update step execution id=1 with wrong version (1), where current version is 0 at org.springframework.batch.core.repository.dao.MapStepExecutionDao.updateStepExecution(MapStepExecutionDao.java:86) at org.springframework.batch.core.repository.support.SimpleJobRepository.update(SimpleJobRepository.java:167) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy2.update(Unknown Source) at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:300) ... 17 more Please find the attachments (normal log and error log) for the complete log information without task-executor and with.

    Spring JIRA | 7 years ago | Praveen Kumar Battu
    org.springframework.batch.core.step.AbstractStep$FatalException: Fatal failure detected
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Commit failed while step execution data was already updated. Reverting to old version. - Spring batch

    Stack Overflow | 2 years ago | user3839699
    org.springframework.dao.OptimisticLockingFailureException: Attempt to update step execution id=1 with wrong version (1), where current version is 2
  6. 0

    Spring Batch - Parallel Processing - Split flow

    Stack Overflow | 2 years ago | chandra
    org.springframework.batch.core.step.AbstractStep$FatalException: Fatal failure detected

  1. Tahir 141 times, last 3 months ago
2 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.springframework.dao.OptimisticLockingFailureException

    Attempt to update step execution id=1 with wrong version (1), where current version is 0

    at org.springframework.batch.core.repository.dao.MapStepExecutionDao.updateStepExecution()
  2. Spring Batch Core
    SimpleJobRepository.update
    1. org.springframework.batch.core.repository.dao.MapStepExecutionDao.updateStepExecution(MapStepExecutionDao.java:86)
    2. org.springframework.batch.core.repository.support.SimpleJobRepository.update(SimpleJobRepository.java:167)
    2 frames
  3. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    4. java.lang.reflect.Method.invoke(Unknown Source)
    4 frames
  4. Spring AOP
    ReflectiveMethodInvocation.proceed
    1. org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
    2. org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
    3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
    3 frames
  5. Spring Tx
    TransactionInterceptor.invoke
    1. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
    1 frame
  6. Spring AOP
    JdkDynamicAopProxy.invoke
    1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    2 frames
  7. Unknown
    $Proxy2.update
    1. $Proxy2.update(Unknown Source)
    1 frame
  8. Spring Batch Core
    StepContextRepeatCallback.doInIteration
    1. org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:300)
    2. org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:67)
    2 frames
  9. Spring Batch Infrastructure
    RepeatTemplate.iterate
    1. org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:352)
    2. org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:212)
    3. org.springframework.batch.repeat.support.RepeatTemplate.iterate(RepeatTemplate.java:143)
    3 frames
  10. Spring Batch Core
    SplitState$1.call
    1. org.springframework.batch.core.step.tasklet.TaskletStep.doExecute(TaskletStep.java:239)
    2. org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:197)
    3. org.springframework.batch.core.job.AbstractJob.handleStep(AbstractJob.java:348)
    4. org.springframework.batch.core.job.flow.FlowJob.access$100(FlowJob.java:43)
    5. org.springframework.batch.core.job.flow.FlowJob$JobFlowExecutor.executeStep(FlowJob.java:137)
    6. org.springframework.batch.core.job.flow.support.state.StepState.handle(StepState.java:60)
    7. org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:144)
    8. org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:124)
    9. org.springframework.batch.core.job.flow.support.state.SplitState$1.call(SplitState.java:82)
    10. org.springframework.batch.core.job.flow.support.state.SplitState$1.call(SplitState.java:80)
    10 frames
  11. Java RT
    Thread.run
    1. java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    2. java.util.concurrent.FutureTask.run(Unknown Source)
    3. java.lang.Thread.run(Unknown Source)
    3 frames