Hi,
As of now, my job is configured to <batch:end on="FAILED"/> for step 1 and hence it completes with status COMPLETED if any exception occurs.
I would like the job to end with FAILED status so that it can be restarted? should I remove <batch:end on="FAILED"/> and will it stop automatically after first failure and not move to next step?
Code:Caused by: java.lang.IllegalStateException: Input resource must exist (reader is in 'strict' mode): URL [file:/C:/test.txt] at org.springframework.batch.item.file.FlatFileItemReader.doOpen(FlatFileItemReader.java:250) at org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader.open(AbstractItemCountingItemStreamItemReader.java:134) ... 26 more [SimpleAsyncTaskExecutor-2] ERROR org.springframework.batch.core.step.AbstractStep - Exception in afterStep callback java.lang.IllegalArgumentException: No records were loaded! at org.springframework.util.Assert.isTrue(Assert.java:65) at org.springframework.batch.core.listener.step.GenericStepExecutionListener.afterStep(GenericStepExecutionListener.java:37) at org.springframework.batch.core.listener.CompositeStepExecutionListener.afterStep(CompositeStepExecutionListener.java:62) at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:223) at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:135) [SimpleAsyncTaskExecutor-2] INFO org.springframework.batch.core.launch.support.SimpleJobLauncher - Job: [FlowJob: [name=loadFile]] completed with the following parameters: [{output.file=file:/C:/test503.TXT, input.file=file:/C:/test.TXT}] and the following status: [COMPLETED]


Reply With Quote
