亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

春季批處理中的多個作業無法使用 xml 設置

春季批處理中的多個作業無法使用 xml 設置

米脂 2022-08-03 10:38:23
我有彈簧批處理設置,我正在嘗試并行運行兩個作業。我有一個工作正常,但在添加第二個工作時,它停止工作。作業設置如下:<job id="job">    <split id="split_1" task-executor="taskExecutor" next="step_4">        <flow>            <step id="step_1">                <tasklet ref="taskletStep_1"/>            </step>        </flow>        <flow>            <step id="step_2">                <tasklet ref="taskletStep_2"/>            </step>        </flow>        <flow>            <step id="step_3">                <tasklet ref="taskletStep_3"/>            </step>        </flow>    </split>    <step id="step_4">                <tasklet ref="taskletStep_3"/>    </step></job><job id="job2">    <split id="split_2" task-executor="taskExecutor" next="step_8">        <flow>            <step id="step_5">                <tasklet ref="taskletStep_4"/>            </step>        </flow>        <flow>            <step id="step_6">                <tasklet ref="taskletStep_5"/>            </step>        </flow>        <flow>            <step id="step_7">                <tasklet ref="taskletStep_6"/>            </step>        </flow>    </split>    <step id="step_8">        <tasklet ref="taskletStep_6"/>    </step></job>當它與一個工作一起工作時,它工作正常。當我添加第二個作業時,第一個作業工作正常,但第二個作業呈現:INFO 40904 --- [nio-8181-exec-1] c.j.b.p.c.JobLauncherController          : The Job must not be null.作業啟動器設置如下所示:@RestControllerpublic class JobLauncherController {    @Autowired    JobLauncher jobLauncher;    @Autowired    Job job;    Job job2;    @RequestMapping("/launchjob")    public String handle() throws Exception {        Logger logger = LoggerFactory.getLogger(this.getClass());        try {            JobParameters jobParameters = new JobParametersBuilder().addLong("time", System.currentTimeMillis())                    .toJobParameters();            jobLauncher.run(job, jobParameters);            jobLauncher.run(job2, jobParameters);        } catch (Exception e) {            logger.info(e.getMessage());        }        return "Done";    }}有什么建議來解決這個問題嗎?不知道我錯過了什么。
查看完整描述

1 回答

?
收到一只叮咚

TA貢獻1821條經驗 獲得超5個贊

您缺少 上的注釋。@Autowiredjob2



查看完整回答
反對 回復 2022-08-03
  • 1 回答
  • 0 關注
  • 84 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號