Announcement Announcement Module
Collapse
No announcement yet.
[ExitStatus] works only with COMPLETED WITH SKIPS Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • [ExitStatus] works only with COMPLETED WITH SKIPS

    Hi again,

    well, recently i've run through the need of defining my own status
    Code:
    new ExitStatus("COMPLETED WITH FAILURES")
    and i've got the configuration of my job as follows :
    HTML Code:
    <job id="myJob" job-repository="jobRepository" restartable="true">
    	<step id="firstStepMaster">
    		<partition step="firstStep"  partitioner="partitioner">
    			<handler grid-size="5" task-executor="taskExecutor" />
    		</partition>
    		<next on="COMPLETED WITH FAILURES" to="secondStepMaster"/>
    	</step>
    	<step id="secondStepMaster">
    		<partition step="secondStep"  partitioner="secondPartitioner">
    			<handler grid-size="5" task-executor="taskExecutor" />
    		</partition>
    		<end on="COMPLETED"/>
    	</step>
    </job>
    when my first step ends with a COMPLETED WITH FAILURES, i get the following error right after the first step has finished :
    Code:
    ERROR org.springframework.batch.core.step.AbstractStep - Encountered an error saving batch meta data.This job is now in an unknown state and should not be restarted.
    ERROR org.springframework.batch.core.step.AbstractStep - Encountered an error executing the step
    org.springframework.batch.core.JobExecutionException: Partition handler returned an unsuccessful step
    	at org.springframework.batch.core.partition.support.PartitionStep.doExecute(PartitionStep.java:110)
    	at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:196)
    	at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:115)
    	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:99)
    	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 org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
    	at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:114)
    	at org.springframework.batch.core.launch.support.CommandLineJobRunner.start(CommandLineJobRunner.java:300)
    	at org.springframework.batch.core.launch.support.CommandLineJobRunner.main(CommandLineJobRunner.java:464)
    if i change my return status to "COMPLETED WITH SKIPS", my second step starts with no problems and no exceptions are thrown.
    But if i change my return status to anything else "COMPLETED WITH ANYTHING", "COMPLETED WITH SPAGHETTI" i get the same error...

    does someone know what might goes wrong here?

    Thanks

  • #2
    Hi,
    I want to process multiple files simultaneously and store data into DB.
    If I test my example with stand alone java class then I get same error as mentionde above.
    May somebody please share example for the same along with simple standalone java test class.


    Regards,

    Comment


    • #3
      It looks like the database schema might declare the ExitStatus.code to be shorter than your custom status values. You probably just need to update your table definitions for BATCH_JOB_EXECUTION and BATCH_STEP_EXECUTION.

      Comment

      Working...
      X