0
当我尝试运行具有多个流程的作业时,在加载config.xml时出现以下错误。第一个流程被识别,而第二个流程未被识别。在Spring批处理作业中配置多个流程时出错
违规资源:class path resource [spring/batch/jobs/myAppConfig.xml];嵌套异常是org.springframework.beans.factory.parsing.BeanDefinitionParsingException:配置问题:该元件[job1Flow2]不可达
每个流具有一系列步骤和我有各种工作在该方法的步骤的各种组合是必要的。所以我想到将这些步骤作为流程实施,然后重新使用这些流程,这样我的工作就可以完成所需的所有步骤。
我的配置文件:
<batch:job id="job1" parent="parentJob">
<batch:flow parent="MyFlow1" id="job1Flow1"/>
<batch:flow parent="MyFlow2" id="job1Flow2"/>
</batch:job>
<batch:flow id="MyFlow1">
<batch:step id="step1" next="step2" parent="parentStep">
<batch:tasklet ref="bean1"/>
</batch:step>
<batch:step id="step2" parent="parentStep">
<batch:tasklet ref="bean2"/>
</batch:step>
</batch:flow>
<batch:flow id="MyFlow2">
<batch:step id="step3" next="step4" parent="parentStep">
<batch:tasklet ref="bean3"/>
</batch:step>
<batch:step id="step4" parent="parentStep">
<batch:tasklet ref="bean4"/>
</batch:step>
</batch:flow>
如果我评论第二流和运行作业运行成功。请让我知道是否有办法通过流程或任何其他方式完成我的任务。