2014-10-08 57 views
0

命令與應用開始打造專業化的工作:批處理作業不與停止commandLineJobRunner停止

java -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9875 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.password.file=C:/Users/rishabh/Desktop/jmxremote.password -Dcom.sun.management.jmxremote.access.file=C:/Users/rishabh/Desktop/jmx.access -cp C:\Users\rishabh\slave-example-0.0.1-SNAPSHOT.jar org.springframework.batch.core.launch.support.CommandLineJobRunner application-context.xml sampleJob correlationId=71925ee3-4879-4dee-8177-fa347893df88 

現在,當我試圖阻止這項工作,像這樣「 - 停止」的說法:

java -cp C:\Users\rishabh.pandey\slave-example-0.0.1-SNAPSHOT.jar org.springframework.batch.core.launch.support.CommandLineJobRunner -stop application-context.xml sampleJob 

這給出:

作業在錯誤中終止沒有找到job的運行執行= sampleJob with JobexecutionNotRun ningException

請提供示例命令示例。我還希望存儲庫狀態對作業數據穩定。

回答

0

我獲取了correlationId存儲庫,然後使用特定的correlationId運行該命令。 早些時候,我使用的是作業名稱和新的correlationId,並且正在使用不在作業存儲庫中的correlationID。