如果自定义异常设置步骤执行状态而不是ABANDONED

时间:2014-10-07 14:24:54

标签: spring-batch

我有一种情况,其中step可以抛出自定义异常并且异常执行作业停止。我面临的问题是,在'step2'中的异常,Spring Batch设置步骤状态'ABANDONED',我尝试通过afterStep方法覆盖步骤状态,并在afterStep方法中明确说明可用的SetpExecution实例上的状态。但是,在数据库表中,步骤'step2'的状态为'ABANDONED'。我需要将其设置为已完成,以便我可以重新启动作业并重新运行该步骤。有什么帮助吗?

以下是工作配置。

<batch:job id="TestJob" job-repository="jobRepository">
    <batch:step id="Step1">
        <tasklet ref="ValidatorTasklet" allow-start-if-complete="true" />
        <!-- <batch:end on="*" /> -->
        <batch:next on="*" to="step2" />
        <batch:next on="FAILED" to="sendErrorEmail" />
    </batch:step>

    <batch:step id="step2">
        <batch:tasklet transaction-manager="hibernateTransactionManager"
            allow-start-if-complete="true">
            <batch:chunk reader="HeaderReader" processor="HeaderProcessor"
                writer="hibernateItemWriter" commit-interval="1" />
        </batch:tasklet>
        <!-- <batch:end on="*" /> -->
        <batch:next on="*" to="step3" />
        <batch:next on="FAILED" to="sendErrorEmail" />
    </batch:step>

    <batch:step id="step3">
        <batch:tasklet transaction-manager="hibernateTransactionManager"
            allow-start-if-complete="true">
            <batch:chunk reader="TrailerReader" processor="TrailerProcessor"
                writer="hibernateItemWriter" commit-interval="1" />
        </batch:tasklet>
        <batch:end on="*" />
        <batch:next on="FAILED" to="sendErrorEmail" />
    </batch:step>
    <batch:step id="sendErrorEmail">
        <tasklet ref="SendErrorEmailTasklet" allow-start-if-complete="true" />
        <batch:fail on="*" exit-code="FAILED" />
    </batch:step>
</batch:job>

堆栈跟踪

2014-10-07 10:10:20,301 DEBUG [main] c.f.p.b.p.HeaderProcessor [OCLogger.java:154] HeaderProcessor.process HeaderProcDTO.toString HeaderProcDTO [FepFileId=0, abtEibfil01=null, bcbsPlanCd=277, fepJobRunDt=Tue Oct 07 10:10:20 EDT 2014, HdrProcTxt=PLANPDR_REQUEST_DETAILS, HeaderCd=PDEADRRH, PlanCntlId=1, PlanFileNm=Request_277_20141006020002.xml, PlanFileTs=2014-10-05 22:00:00.0, ProcJobId=149, TrailerProcDTO=null]
2014-10-07 10:10:20,301 DEBUG [main] o.s.b.c.s.t.TaskletStep [TaskletStep.java:437] Applying contribution: [StepContribution: read=1, written=0, filtered=0, readSkips=0, writeSkips=0, processSkips=0, exitStatus=EXECUTING]
2014-10-07 10:10:20,301 DEBUG [main] o.s.b.c.s.t.TaskletStep [TaskletStep.java:473] Rollback for Exception: java.lang.Exception: Custom Exception from HeaderProcessor.process
2014-10-07 10:10:20,306 DEBUG [main] o.s.t.s.TransactionTemplate [TransactionTemplate.java:162] Initiating transaction rollback on application exception
org.springframework.batch.core.step.tasklet.UncheckedTransactionException: java.lang.Exception: Custom Exception from HeaderProcessor.process
    at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:476) ~[spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:330) ~[spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133) ~[spring-tx-4.0.6.RELEASE.jar:4.0.6.RELEASE]
    at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:271) [spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:77) [spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:368) [spring-batch-infrastructure-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:215) [spring-batch-infrastructure-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.batch.repeat.support.RepeatTemplate.iterate(RepeatTemplate.java:144) [spring-batch-infrastructure-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.batch.core.step.tasklet.TaskletStep.doExecute(TaskletStep.java:257) [spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:198) [spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:148) [spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.batch.core.job.flow.JobFlowExecutor.executeStep(JobFlowExecutor.java:64) [spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.batch.core.job.flow.support.state.StepState.handle(StepState.java:67) [spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:162) [spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:141) [spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.batch.core.job.flow.FlowJob.doExecute(FlowJob.java:134) [spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:304) [spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:135) [spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:50) [spring-core-4.0.6.RELEASE.jar:4.0.6.RELEASE]
    at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:128) [spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at com.fepoc.batch.BatchApplication.execute(BatchApplication.java:94) [bin/:na]
    at com.fepoc.batch.BatchApplication.main(BatchApplication.java:127) [bin/:na]
Caused by: java.lang.Exception: Custom Exception from HeaderProcessor.process
    at com.fepoc.batch.processor.HeaderProcessor.process(HeaderProcessor.java:83) ~[bin/:na]
    at com.fepoc.batch.processor.HeaderProcessor.process(HeaderProcessor.java:1) ~[bin/:na]
    at org.springframework.batch.core.step.item.SimpleChunkProcessor.doProcess(SimpleChunkProcessor.java:126) ~[spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.batch.core.step.item.SimpleChunkProcessor.transform(SimpleChunkProcessor.java:293) ~[spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.batch.core.step.item.SimpleChunkProcessor.process(SimpleChunkProcessor.java:192) ~[spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.batch.core.step.item.ChunkOrientedTasklet.execute(ChunkOrientedTasklet.java:75) ~[spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:406) ~[spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    ... 21 common frames omitted
2014-10-07 10:10:20,306 DEBUG [main] o.s.o.h.HibernateTransactionManager [AbstractPlatformTransactionManager.java:847] Initiating transaction rollback
2014-10-07 10:10:20,307 DEBUG [main] o.s.o.h.HibernateTransactionManager [HibernateTransactionManager.java:571] Rolling back Hibernate transaction on Session [SessionImpl(PersistenceContext[entityKeys=[],collectionKeys=[]];ActionQueue[insertions=org.hibernate.engine.spi.ExecutableList@1f3b1f3b updates=org.hibernate.engine.spi.ExecutableList@316b316b deletions=org.hibernate.engine.spi.ExecutableList@314b314b orphanRemovals=org.hibernate.engine.spi.ExecutableList@33a533a5 collectionCreations=org.hibernate.engine.spi.ExecutableList@662e662e collectionRemovals=org.hibernate.engine.spi.ExecutableList@33373337 collectionUpdates=org.hibernate.engine.spi.ExecutableList@33573357 collectionQueuedOps=org.hibernate.engine.spi.ExecutableList@33853385 unresolvedInsertDependencies=UnresolvedEntityInsertActions[]])]
2014-10-07 10:10:20,317 DEBUG [main] o.s.o.h.HibernateTransactionManager [HibernateTransactionManager.java:633] Closing Hibernate Session [SessionImpl(PersistenceContext[entityKeys=[],collectionKeys=[]];ActionQueue[insertions=org.hibernate.engine.spi.ExecutableList@1f3b1f3b updates=org.hibernate.engine.spi.ExecutableList@316b316b deletions=org.hibernate.engine.spi.ExecutableList@314b314b orphanRemovals=org.hibernate.engine.spi.ExecutableList@33a533a5 collectionCreations=org.hibernate.engine.spi.ExecutableList@662e662e collectionRemovals=org.hibernate.engine.spi.ExecutableList@33373337 collectionUpdates=org.hibernate.engine.spi.ExecutableList@33573357 collectionQueuedOps=org.hibernate.engine.spi.ExecutableList@33853385 unresolvedInsertDependencies=UnresolvedEntityInsertActions[]])] after transaction
2014-10-07 10:10:20,319 DEBUG [main] o.s.b.r.s.RepeatTemplate [RepeatTemplate.java:292] Handling exception: java.lang.Exception, caused by: java.lang.Exception: Custom Exception from HeaderProcessor.process
2014-10-07 10:10:20,320 DEBUG [main] o.s.b.r.s.RepeatTemplate [RepeatTemplate.java:252] Handling fatal exception explicitly (rethrowing first of 1): java.lang.Exception: Custom Exception from HeaderProcessor.process
2014-10-07 10:10:20,321 ERROR [main] o.s.b.c.s.AbstractStep [AbstractStep.java:225] Encountered an error executing step readHeaderStep in job readHeaderJob
java.lang.Exception: Custom Exception from HeaderProcessor.process
    at com.fepoc.batch.processor.HeaderProcessor.process(HeaderProcessor.java:83) ~[bin/:na]
    at com.fepoc.batch.processor.HeaderProcessor.process(HeaderProcessor.java:1) ~[bin/:na]
    at org.springframework.batch.core.step.item.SimpleChunkProcessor.doProcess(SimpleChunkProcessor.java:126) ~[spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.batch.core.step.item.SimpleChunkProcessor.transform(SimpleChunkProcessor.java:293) ~[spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.batch.core.step.item.SimpleChunkProcessor.process(SimpleChunkProcessor.java:192) ~[spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.batch.core.step.item.ChunkOrientedTasklet.execute(ChunkOrientedTasklet.java:75) ~[spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:406) ~[spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:330) ~[spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133) ~[spring-tx-4.0.6.RELEASE.jar:4.0.6.RELEASE]
    at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:271) ~[spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:77) ~[spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:368) ~[spring-batch-infrastructure-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:215) ~[spring-batch-infrastructure-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.batch.repeat.support.RepeatTemplate.iterate(RepeatTemplate.java:144) ~[spring-batch-infrastructure-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.batch.core.step.tasklet.TaskletStep.doExecute(TaskletStep.java:257) ~[spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:198) ~[spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:148) [spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.batch.core.job.flow.JobFlowExecutor.executeStep(JobFlowExecutor.java:64) [spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.batch.core.job.flow.support.state.StepState.handle(StepState.java:67) [spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:162) [spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:141) [spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.batch.core.job.flow.FlowJob.doExecute(FlowJob.java:134) [spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:304) [spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:135) [spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:50) [spring-core-4.0.6.RELEASE.jar:4.0.6.RELEASE]
    at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:128) [spring-batch-core-3.0.1.RELEASE.jar:3.0.1.RELEASE]
    at com.fepoc.batch.BatchApplication.execute(BatchApplication.java:94) [bin/:na]
    at com.fepoc.batch.BatchApplication.main(BatchApplication.java:127) [bin/:na]
2014-10-07 10:10:20,322 DEBUG [main] c.f.p.b.p.HeaderProcessor [OCLogger.java:154] HeaderProcessor.afterStep jobId : 149 Step Name : readHeaderStep Plan Code : 277
2014-10-07 10:10:20,322 DEBUG [main] c.f.p.b.p.HeaderProcessor [OCLogger.java:154] HeaderProcessor.afterStep HeaderProcDTO.toString HeaderProcDTO [FepFileId=0, abtEibfil01=null, bcbsPlanCd=277, fepJobRunDt=Tue Oct 07 10:10:20 EDT 2014, HdrProcTxt=PLANPDR_REQUEST_DETAILS, HeaderCd=PDEADRRH, PlanCntlId=1, PlanFileNm=Request_277_20141006020002.xml, PlanFileTs=2014-10-05 22:00:00.0, ProcJobId=149, TrailerProcDTO=null]
2014-10-07 10:10:20,323 DEBUG [main] o.s.j.d.DataSourceTransactionManager [AbstractPlatformTransactionManager.java:367] Creating new transaction with name [org.springframework.batch.core.repository.support.SimpleJobRepository.updateExecutionContext]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT
2014-10-07 10:10:20,324 DEBUG [main] o.s.j.d.DataSourceTransactionManager [DataSourceTransactionManager.java:206] Acquired Connection [jdbc:sqlserver://FEPSQLVS2\sqlserver2:1433;authenticationScheme=nativeAuthentication;xopenStates=false;sendTimeAsDatetime=true;trustServerCertificate=false;sendStringParametersAsUnicode=true;selectMethod=direct;responseBuffering=adaptive;packetSize=8000;multiSubnetFailover=false;loginTimeout=15;lockTimeout=-1;lastUpdateCount=true;encrypt=false;disableStatementPooling=true;databaseName=OCPRCDEV;applicationName=Microsoft JDBC Driver for SQL Server;applicationIntent=readwrite;, UserName=OCPRCDEV_app, Microsoft JDBC Driver 4.0 for SQL Server] for JDBC transaction
2014-10-07 10:10:20,325 DEBUG [main] o.s.j.d.DataSourceTransactionManager [DataSourceTransactionManager.java:223] Switching JDBC Connection [jdbc:sqlserver://FEPSQLVS2\sqlserver2:1433;authenticationScheme=nativeAuthentication;xopenStates=false;sendTimeAsDatetime=true;trustServerCertificate=false;sendStringParametersAsUnicode=true;selectMethod=direct;responseBuffering=adaptive;packetSize=8000;multiSubnetFailover=false;loginTimeout=15;lockTimeout=-1;lastUpdateCount=true;encrypt=false;disableStatementPooling=true;databaseName=OCPRCDEV;applicationName=Microsoft JDBC Driver for SQL Server;applicationIntent=readwrite;, UserName=OCPRCDEV_app, Microsoft JDBC Driver 4.0 for SQL Server] to manual commit
2014-10-07 10:10:20,326 DEBUG [main] o.s.j.c.JdbcTemplate [JdbcTemplate.java:908] Executing prepared SQL update
2014-10-07 10:10:20,326 DEBUG [main] o.s.j.c.JdbcTemplate [JdbcTemplate.java:627] Executing prepared SQL statement [UPDATE BATCH_STEP_EXECUTION_CONTEXT SET SHORT_CONTEXT = ?, SERIALIZED_CONTEXT = ? WHERE STEP_EXECUTION_ID = ?]
2014-10-07 10:10:20,329 DEBUG [main] o.s.j.c.JdbcTemplate [JdbcTemplate.java:918] SQL update affected 1 rows
2014-10-07 10:10:20,330 DEBUG [main] o.s.j.d.DataSourceTransactionManager [AbstractPlatformTransactionManager.java:755] Initiating transaction commit
2014-10-07 10:10:20,330 DEBUG [main] o.s.j.d.DataSourceTransactionManager [DataSourceTransactionManager.java:266] Committing JDBC transaction on Connection [jdbc:sqlserver://FEPSQLVS2\sqlserver2:1433;authenticationScheme=nativeAuthentication;xopenStates=false;sendTimeAsDatetime=true;trustServerCertificate=false;sendStringParametersAsUnicode=true;selectMethod=direct;responseBuffering=adaptive;packetSize=8000;multiSubnetFailover=false;loginTimeout=15;lockTimeout=-1;lastUpdateCount=true;encrypt=false;disableStatementPooling=true;databaseName=OCPRCDEV;applicationName=Microsoft JDBC Driver for SQL Server;applicationIntent=readwrite;, UserName=OCPRCDEV_app, Microsoft JDBC Driver 4.0 for SQL Server]
2014-10-07 10:10:20,333 DEBUG [main] o.s.j.d.DataSourceTransactionManager [DataSourceTransactionManager.java:324] Releasing JDBC Connection [jdbc:sqlserver://FEPSQLVS2\sqlserver2:1433;authenticationScheme=nativeAuthentication;xopenStates=false;sendTimeAsDatetime=true;trustServerCertificate=false;sendStringParametersAsUnicode=true;selectMethod=direct;responseBuffering=adaptive;packetSize=8000;multiSubnetFailover=false;loginTimeout=15;lockTimeout=-1;lastUpdateCount=true;encrypt=false;disableStatementPooling=true;databaseName=OCPRCDEV;applicationName=Microsoft JDBC Driver for SQL Server;applicationIntent=readwrite;, UserName=OCPRCDEV_app, Microsoft JDBC Driver 4.0 for SQL Server] after transaction
2014-10-07 10:10:20,333 DEBUG [main] o.s.j.d.DataSourceUtils [DataSourceUtils.java:327] Returning JDBC Connection to DataSource
2014-10-07 10:10:20,334 DEBUG [main] o.s.j.d.DataSourceTransactionManager [AbstractPlatformTransactionManager.java:367] Creating new transaction with name [org.springframework.batch.core.repository.support.SimpleJobRepository.update]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT
2014-10-07 10:10:20,334 DEBUG [main] o.s.j.d.DataSourceTransactionManager [DataSourceTransactionManager.java:206] Acquired Connection [jdbc:sqlserver://FEPSQLVS2\sqlserver2:1433;authenticationScheme=nativeAuthentication;xopenStates=false;sendTimeAsDatetime=true;trustServerCertificate=false;sendStringParametersAsUnicode=true;selectMethod=direct;responseBuffering=adaptive;packetSize=8000;multiSubnetFailover=false;loginTimeout=15;lockTimeout=-1;lastUpdateCount=true;encrypt=false;disableStatementPooling=true;databaseName=OCPRCDEV;applicationName=Microsoft JDBC Driver for SQL Server;applicationIntent=readwrite;, UserName=OCPRCDEV_app, Microsoft JDBC Driver 4.0 for SQL Server] for JDBC transaction
2014-10-07 10:10:20,335 DEBUG [main] o.s.j.d.DataSourceTransactionManager [DataSourceTransactionManager.java:223] Switching JDBC Connection [jdbc:sqlserver://FEPSQLVS2\sqlserver2:1433;authenticationScheme=nativeAuthentication;xopenStates=false;sendTimeAsDatetime=true;trustServerCertificate=false;sendStringParametersAsUnicode=true;selectMethod=direct;responseBuffering=adaptive;packetSize=8000;multiSubnetFailover=false;loginTimeout=15;lockTimeout=-1;lastUpdateCount=true;encrypt=false;disableStatementPooling=true;databaseName=OCPRCDEV;applicationName=Microsoft JDBC Driver for SQL Server;applicationIntent=readwrite;, UserName=OCPRCDEV_app, Microsoft JDBC Driver 4.0 for SQL Server] to manual commit
2014-10-07 10:10:20,336 DEBUG [main] o.s.b.c.r.d.JdbcStepExecutionDao [JdbcStepExecutionDao.java:273] Truncating long message before update of StepExecution, original message is: java.lang.Exception: Custom Exception from HeaderProcessor.process
    at com.fepoc.batch.processor.HeaderProcessor.process(HeaderProcessor.java:83)
    at com.fepoc.batch.processor.HeaderProcessor.process(HeaderProcessor.java:1)
    at org.springframework.batch.core.step.item.SimpleChunkProcessor.doProcess(SimpleChunkProcessor.java:126)
    at org.springframework.batch.core.step.item.SimpleChunkProcessor.transform(SimpleChunkProcessor.java:293)
    at org.springframework.batch.core.step.item.SimpleChunkProcessor.process(SimpleChunkProcessor.java:192)
    at org.springframework.batch.core.step.item.ChunkOrientedTasklet.execute(ChunkOrientedTasklet.java:75)
    at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:406)
    at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:330)
    at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
    at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:271)
    at org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:77)
    at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:368)
    at org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:215)
    at org.springframework.batch.repeat.support.RepeatTemplate.iterate(RepeatTemplate.java:144)
    at org.springframework.batch.core.step.tasklet.TaskletStep.doExecute(TaskletStep.java:257)
    at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:198)
    at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:148)
    at org.springframework.batch.core.job.flow.JobFlowExecutor.executeStep(JobFlowExecutor.java:64)
    at org.springframework.batch.core.job.flow.support.state.StepState.handle(StepState.java:67)
    at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:162)
    at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:141)
    at org.springframework.batch.core.job.flow.FlowJob.doExecute(FlowJob.java:134)
    at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:304)
    at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:135)
    at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:50)
    at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:128)
    at com.fepoc.batch.BatchApplication.execute(BatchApplication.java:94)
    at com.fepoc.batch.BatchApplication.main(BatchApplication.java:127)

0 个答案:

没有答案