Announcement Announcement Module
Collapse
No announcement yet.
JobInterruptedException when stopping a job Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JobInterruptedException when stopping a job

    Stopping a job via the JobOpertor API results in a JobInterruptedException being thrown as following stacktrace indicates:
    Code:
    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]
    I am wondering why an exception is being used for this? Stopping a job is not an exceptional situation, it is regular business functionality. If it is done for technical reasons to be able to exit regular control flow, than surely the exception should not be logged as severity LOG.error but rather as LOG.info?
Working...
X