Doing Two Jobs Using Quartz in Java

I have a quartz encoded as follows, and the first job does fine:

JobDetail jd = null;
CronTrigger ct = null;   
jd = new JobDetail("Job1", "Group1",  Job1.class);
ct = new CronTrigger("cronTrigger1","Group1","0/5 * * * * ?");
scheduler.scheduleJob(jd, ct);
jd = new JobDetail("Job2", "Group2",  Job2.class);
ct = new CronTrigger("cronTrigger2","Group2","0/20 * * * * ?");
scheduler.scheduleJob(jd, ct);

But I find that Job2, which is a completely separate job from Job1, will not be executed.

The scheduler starts using a listener in Java. I also tried using scheduler.addJob (jd, true); but nothing changes. I am running Java through the JVM on Windows 7.

+5
source share
1 answer

, ? Job1.class Job2.class, ? , , Job2? Job2, ?

, Job2 .

+1

All Articles