tags:

views:

31

answers:

0

Working with Java Quartz, I was able to schedule one job. Then I tried something like the following code to be able to add an other job. Now neither seems to trigger at the defined time. What am I doing wrong?

I want to use approach like following, not xml configuration.

   scheduler = StdSchedulerFactory.getDefaultScheduler();


   JobDetail jobFull = new JobDetail("job1", "group1", IntegrationJobFull.class);
   JobDetail jobPartial = new JobDetail("job2", "group1", IntegrationJobPartial.class);

   CronTrigger triggerFull = new CronTrigger("trigger1", "group1", "job1", "group1", "0 15 3 * * ?");
   CronTrigger triggerPartial = new CronTrigger("trigger2", "group1", "job2", "group1", "* 0,30 * * * ?");

   scheduler.addJob(jobFull, false);
   scheduler.addJob(jobPartial, false);

   scheduler.scheduleJob(triggerFull);
   scheduler.scheduleJob(triggerPartial);

   scheduler.start();