This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.
There used to be a Quartz sample job before M2, but it was really much more an example of Spring-Quartz integration rather than anything Spring Batch specific.
If you need something quickly take a look at the Quartz chapter in Spring documentation and it should be mostly a copy-paste issue. Or you can start a Jira issue - I should be able to attach an example file within next week.
Writing a job in Quartz would be the same procedure as the crontab above, only you would use the quartz Native job as your quartz job, with the spring batch command line launcher as it's process to be executed.
You could also use Spring's quartz integration to inject a Spring Batch JobLauncher, although every job launched this way will be in the same jvm.
Exception in thread "Sched1_QuartzSchedulerThread" java.lang.NoSuchMethodError: org.quartz.SchedulerException: method <init>(Ljava/lang/String;Ljava/lang/Throwable;)V not found
At 6AM every weekday morning, launch "myJob" from file "myJob.xml"
If you don't know what this is, don't worry.
It is a sample entry ("crontab" entry) to configure the built-in *NIX scheduling utility known as "cron" -- this is perhaps the simplest scheduler available to non-Microsoft users so I felt it would be a good example. Again, don't worry if it doesn't apply to you.
Last edited by dkaminsky; Jan 15th, 2008, 02:48 PM.
Reason: added original post
Could someone show and example how to setup the classpath that includes all the proper deployment artifacts to make a batch applicaiton run under crontab?
One way is to use maven to launch the job - just add the snippet below to your pom.xml and use "mvn exec:exec -Djob.name=myJob -Djob.configuration.path=path/to/myJob.xml" as command (or you can hardcode the parameters).
<!-- automatically creates the classpath using all project dependencies,
also adding the project build directory -->
<!-- job configuration file -->
<!-- job name -->
Last edited by robert.kasanicky; Jan 17th, 2008, 04:03 AM.
Reason: removed redundant arguments from plugin config