org.springframework.batch.core.JobInterruptedException: Job interrupted by step execution

Spring JIRA | Jimmy Praet | 5 years ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Stopping a job is not an exceptional situation, it is regular business functionality and should not be logged at LOG.error level. Stopping a job via the JobOpertor API now results in a JobInterruptedException being thrown as following stacktrace indicates: 28-okt-2011 20:38:58 org.springframework.batch.core.repository.support.SimpleJobRepository checkForInterruption INFO: Parent JobExecution is stopped, so passing message on to StepExecution 28-okt-2011 20:38:58 org.springframework.batch.core.step.ThreadStepInterruptionPolicy isInterrupted INFO: Step interrupted through StepExecution 28-okt-2011 20:38:58 org.springframework.batch.core.step.AbstractStep execute SEVERE: Encountered an error executing the step org.springframework.batch.core.JobInterruptedException: Job interrupted status detected. at org.springframework.batch.core.step.ThreadStepInterruptionPolicy.checkInterrupted(ThreadStepInterruptionPolicy.java:42) at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:277) at org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:76) at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:367) at org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:214) at org.springframework.batch.repeat.support.RepeatTemplate.iterate(RepeatTemplate.java:143) at org.springframework.batch.core.step.tasklet.TaskletStep.doExecute(TaskletStep.java:250) at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:195) at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:135) at org.springframework.batch.core.job.flow.JobFlowExecutor.executeStep(JobFlowExecutor.java:61) 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.FlowJob.doExecute(FlowJob.java:135) at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:281) at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:120) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) 28-okt-2011 20:38:58 org.springframework.batch.core.repository.support.SimpleJobRepository checkForInterruption INFO: Parent JobExecution is stopped, so passing message on to StepExecution 28-okt-2011 20:38:58 org.springframework.batch.core.job.AbstractJob execute SEVERE: Encountered interruption executing job org.springframework.batch.core.JobInterruptedException: Job interrupted by step execution at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:151) at org.springframework.batch.core.job.flow.JobFlowExecutor.executeStep(JobFlowExecutor.java:61) 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.FlowJob.doExecute(FlowJob.java:135) at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:281) at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:120) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) 28-okt-2011 20:38:58 org.springframework.batch.core.launch.support.SimpleJobLauncher$1 run INFO: Job: [FlowJob: [name=testjob]] completed with the following parameters: [{date=1319827116535}] and the following status: [STOPPED]

    Spring JIRA | 5 years ago | Jimmy Praet
    org.springframework.batch.core.JobInterruptedException: Job interrupted by step execution
  2. 0

    Stopping a job is not an exceptional situation, it is regular business functionality and should not be logged at LOG.error level. Stopping a job via the JobOpertor API now results in a JobInterruptedException being thrown as following stacktrace indicates: 28-okt-2011 20:38:58 org.springframework.batch.core.repository.support.SimpleJobRepository checkForInterruption INFO: Parent JobExecution is stopped, so passing message on to StepExecution 28-okt-2011 20:38:58 org.springframework.batch.core.step.ThreadStepInterruptionPolicy isInterrupted INFO: Step interrupted through StepExecution 28-okt-2011 20:38:58 org.springframework.batch.core.step.AbstractStep execute SEVERE: Encountered an error executing the step org.springframework.batch.core.JobInterruptedException: Job interrupted status detected. at org.springframework.batch.core.step.ThreadStepInterruptionPolicy.checkInterrupted(ThreadStepInterruptionPolicy.java:42) at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:277) at org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:76) at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:367) at org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:214) at org.springframework.batch.repeat.support.RepeatTemplate.iterate(RepeatTemplate.java:143) at org.springframework.batch.core.step.tasklet.TaskletStep.doExecute(TaskletStep.java:250) at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:195) at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:135) at org.springframework.batch.core.job.flow.JobFlowExecutor.executeStep(JobFlowExecutor.java:61) 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.FlowJob.doExecute(FlowJob.java:135) at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:281) at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:120) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) 28-okt-2011 20:38:58 org.springframework.batch.core.repository.support.SimpleJobRepository checkForInterruption INFO: Parent JobExecution is stopped, so passing message on to StepExecution 28-okt-2011 20:38:58 org.springframework.batch.core.job.AbstractJob execute SEVERE: Encountered interruption executing job org.springframework.batch.core.JobInterruptedException: Job interrupted by step execution at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:151) at org.springframework.batch.core.job.flow.JobFlowExecutor.executeStep(JobFlowExecutor.java:61) 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.FlowJob.doExecute(FlowJob.java:135) at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:281) at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:120) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) 28-okt-2011 20:38:58 org.springframework.batch.core.launch.support.SimpleJobLauncher$1 run INFO: Job: [FlowJob: [name=testjob]] completed with the following parameters: [{date=1319827116535}] and the following status: [STOPPED]

    Spring JIRA | 5 years ago | Jimmy Praet
    org.springframework.batch.core.JobInterruptedException: Job interrupted by step execution

  1. Tahir 5 times, last 6 months ago

Root Cause Analysis

  1. org.springframework.batch.core.JobInterruptedException

    Job interrupted by step execution

    at org.springframework.batch.core.job.SimpleStepHandler.handleStep()
  2. Spring Batch Core
    SimpleJobLauncher$1.run
    1. org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:151)
    2. org.springframework.batch.core.job.flow.JobFlowExecutor.executeStep(JobFlowExecutor.java:61)
    3. org.springframework.batch.core.job.flow.support.state.StepState.handle(StepState.java:60)
    4. org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:144)
    5. org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:124)
    6. org.springframework.batch.core.job.flow.FlowJob.doExecute(FlowJob.java:135)
    7. org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:281)
    8. org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:120)
    8 frames
  3. Java RT
    Thread.run
    1. java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    3. java.lang.Thread.run(Thread.java:662)
    3 frames