org.springframework.batch.core.JobExecutionException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • When running the following flow {code:java} new FlowBuilder<SimpleFlow>("splitFlow") .split(jobTaskExecutor) .add(flow1(), flow2(), flow3()) .end(); {code} The following exception is raised: {code} org.springframework.batch.core.JobExecutionException: Flow execution ended unexpectedly at org.springframework.batch.core.job.flow.FlowJob.doExecute(FlowJob.java:141) at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:301) at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:134) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) Caused by: org.springframework.batch.core.job.flow.FlowExecutionException: Ended flow=splitFlow at state=splitFlow.split1 with exception at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:160) at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:130) at org.springframework.batch.core.job.flow.support.state.FlowState.handle(FlowState.java:55) at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:151) at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:130) at org.springframework.batch.core.job.flow.FlowJob.doExecute(FlowJob.java:135) ... 5 more Caused by: java.lang.IllegalArgumentException: No start state was found. You must specify at least one step in a job. at org.springframework.batch.core.job.flow.support.SimpleFlow.initializeTransitions(SimpleFlow.java:242) at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:126) at org.springframework.batch.core.job.flow.support.state.SplitState$1.call(SplitState.java:93) at org.springframework.batch.core.job.flow.support.state.SplitState$1.call(SplitState.java:90) at java.util.concurrent.FutureTask.run(FutureTask.java:262) ... 3 more {code} Because the {{FlowBuild.SplitBuilder#add}} contains {code:java} State one = parent.currentState; Flow flow = null; if (!(one instanceof FlowState)) { FlowBuilder<Flow> stateBuilder = new FlowBuilder<Flow>(name + "_" + (counter++)); stateBuilder.currentState = one; flow = stateBuilder.build(); } {code} and `one` is null, an empty State is added to the flow. To fill the current state and avoid `one` from being null, the work around is to write: {code:java} new FlowBuilder<SimpleFlow>("splitFlow") .from(flow1()) .split(jobTaskExecutor) .add(flow2(), flow3()) .end(); {code} Please add a one != null in the if condition
    via by Gérald Quintana,
  • When running the following flow {code:java} new FlowBuilder<SimpleFlow>("splitFlow") .split(jobTaskExecutor) .add(flow1(), flow2(), flow3()) .end(); {code} The following exception is raised: {code} org.springframework.batch.core.JobExecutionException: Flow execution ended unexpectedly at org.springframework.batch.core.job.flow.FlowJob.doExecute(FlowJob.java:141) at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:301) at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:134) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) Caused by: org.springframework.batch.core.job.flow.FlowExecutionException: Ended flow=splitFlow at state=splitFlow.split1 with exception at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:160) at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:130) at org.springframework.batch.core.job.flow.support.state.FlowState.handle(FlowState.java:55) at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:151) at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:130) at org.springframework.batch.core.job.flow.FlowJob.doExecute(FlowJob.java:135) ... 5 more Caused by: java.lang.IllegalArgumentException: No start state was found. You must specify at least one step in a job. at org.springframework.batch.core.job.flow.support.SimpleFlow.initializeTransitions(SimpleFlow.java:242) at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:126) at org.springframework.batch.core.job.flow.support.state.SplitState$1.call(SplitState.java:93) at org.springframework.batch.core.job.flow.support.state.SplitState$1.call(SplitState.java:90) at java.util.concurrent.FutureTask.run(FutureTask.java:262) ... 3 more {code} Because the {{FlowBuild.SplitBuilder#add}} contains {code:java} State one = parent.currentState; Flow flow = null; if (!(one instanceof FlowState)) { FlowBuilder<Flow> stateBuilder = new FlowBuilder<Flow>(name + "_" + (counter++)); stateBuilder.currentState = one; flow = stateBuilder.build(); } {code} and `one` is null, an empty State is added to the flow. To fill the current state and avoid `one` from being null, the work around is to write: {code:java} new FlowBuilder<SimpleFlow>("splitFlow") .from(flow1()) .split(jobTaskExecutor) .add(flow2(), flow3()) .end(); {code} Please add a one != null in the if condition
    via by Gérald Quintana,
    • org.springframework.batch.core.JobExecutionException: Flow execution ended unexpectedly at org.springframework.batch.core.job.flow.FlowJob.doExecute(FlowJob.java:141) at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:301) at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:134) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) Caused by: org.springframework.batch.core.job.flow.FlowExecutionException: Ended flow=splitFlow at state=splitFlow.split1 with exception at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:160) at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:130) at org.springframework.batch.core.job.flow.support.state.FlowState.handle(FlowState.java:55) at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:151) at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:130) at org.springframework.batch.core.job.flow.FlowJob.doExecute(FlowJob.java:135) ... 5 more Caused by: java.lang.IllegalArgumentException: No start state was found. You must specify at least one step in a job. at org.springframework.batch.core.job.flow.support.SimpleFlow.initializeTransitions(SimpleFlow.java:242) at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:126) at org.springframework.batch.core.job.flow.support.state.SplitState$1.call(SplitState.java:93) at org.springframework.batch.core.job.flow.support.state.SplitState$1.call(SplitState.java:90) at java.util.concurrent.FutureTask.run(FutureTask.java:262) ... 3 more

    Users with the same issue

    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,