spring batch - How to run the job within springbatchadmin.war from the command line? -


how run job within springbatchadmin.war command line?

i used following command in command prompt run job.

d:\apache-tomcat-6.0.35\webapps\springbatchadmin>java -classpath "lib\*;src" com.companyname.batch.batchlauncher job1cfg job1 

but got error , cannot run job.

please give me right directions.

if using tomcat deploying admin, .war file should have deployed folder start server once. can trace location of xml files inside folder, , execute jobs command-line.

eg: in case, xml files in folder,

tomcat\webapps\my_project_war\web-inf\classes\springbatch

so in case want run job (say 'abcjob') inside xml, 'xyz.xml',

use command,

java org.springframework.batch.core.launch.support.commandlinejobrunner "tomcat\webapps\my_project_war\web-inf\classes\springbatch\xyz.xml" "abcjob" parameter1=value1 etc 

while running command-line, can set classpath variable constant location, can run relative jobs reference location. (in case is'tomcat\webapps\my_project_war\web-inf\classes')

so use command,

java org.springframework.batch.core.launch.support.commandlinejobrunner "classpath*:springbatch/xyz.xml" "abcjob" parameter1=value1 

Comments