Hi all,
I have a job that is set as restartable. I execute the following command line,with a single parameter, and it happily goes off and starts churning. (My jar manifest's Main-Class is org.springframework.batch.core.launch.support.Comm andLineJobRunner.) Then, I intentionally kill it via ctrl-c, hoping to test restartability.Code:java -jar myjar.jar app-config.xml loadBarData tradingDate=2011-04-14
Next, I issue the same command as before except with the -restart option at the end, and I get the following error:Uh, the last job was killed by me and didn't complete! Why does Spring Batch think that the job completed? Alternatively, why can't I restart a job that is marked as restartable? Here's my <job>:Code:ERROR 2011-04-28 23:27:09,735 [main] - Job Terminated in error: No failed or stopped execution found for job=loadBarData org.springframework.batch.core.launch.JobExecutionNotFailedException: No failed or stopped execution found for job=loadBarData at org.springframework.batch.core.launch.support.CommandLineJobRunner.start(CommandLineJobRunner.java:327) at org.springframework.batch.core.launch.support.CommandLineJobRunner.main(CommandLineJobRunner.java:574) ERROR 2011-04-28 23:27:09,735 [main] - Job Terminated in error: No failed or stopped execution found for job=loadBarData org.springframework.batch.core.launch.JobExecutionNotFailedException: No failed or stopped execution found for job=loadBarData at org.springframework.batch.core.launch.support.CommandLineJobRunner.start(CommandLineJobRunner.java:327) at org.springframework.batch.core.launch.support.CommandLineJobRunner.main(CommandLineJobRunner.java:574) ERROR 2011-04-28 23:27:09,735 [main] - Job Terminated in error: No failed or stopped execution found for job=loadBarData org.springframework.batch.core.launch.JobExecutionNotFailedException: No failed or stopped execution found for job=loadBarData at org.springframework.batch.core.launch.support.CommandLineJobRunner.start(CommandLineJobRunner.java:327) at org.springframework.batch.core.launch.support.CommandLineJobRunner.main(CommandLineJobRunner.java:574)It's evident to me that chunks are being committed ok, but I'm killing it right in the middle of a chunk.Code:<job id="loadBarData" job-repository="jobRepository" restartable="true" xmlns="http://www.springframework.org/schema/batch"> <step id="processInstrumentData"> <tasklet transaction-manager="marketTransactionManager"> <chunk reader="instrumentReader" processor="instrumentProcessor" writer="incomingBarWriter" commit-interval="1"> </chunk> </tasklet> </step> <listeners> <listener ref="mailingJobExecutionListener" /> </listeners> </job>
Thanks,
Matthew


Reply With Quote