Quartz调度程序 - Cron Not Running

时间:2011-05-12 11:41:49

标签: cron quartz-scheduler

我正在尝试运行一个调度程序,它将更新数据库表中的日期。 cron正在启动,但它没有开始工作!

我的cron文件 - >

    package Crons.Schedulers;


import org.quartz.CronTrigger;
import org.quartz.Scheduler;
import org.quartz.SchedulerFactory;
import org.quartz.impl.StdSchedulerFactory;
import org.quartz.JobDetail;


public class WeeklySchedule{
  public WeeklySchedule()throws Exception {
    SchedulerFactory sf=new StdSchedulerFactory();
    Scheduler sched=sf.getScheduler();
    sched.start();
    JobDetail jd=new JobDetail("WeeklyTask","Weekly",WeeklyJob.class);
    CronTrigger ct=new CronTrigger("cronTrigger","group2","0 57 16 * * ?");
    sched.scheduleJob(jd,ct);

  }
  public static void main(String args[]){
    try{    
    new WeeklySchedule();
    }catch(Exception e){}
  }
}

显示的输出是 - >

    INFO  SimpleThreadPool(initialize:247) - Job execution threads will use class loader of thread: main
INFO  QuartzScheduler(<init>:195) - Quartz Scheduler v.1.5.2 created.
INFO  RAMJobStore(initialize:138) - RAMJobStore initialized.
INFO  StdSchedulerFactory(instantiate:1014) - Quartz scheduler 'DefaultQuartzScheduler' initialized from default resource file in Quartz package: 'quartz.properties'
INFO  StdSchedulerFactory(instantiate:1018) - Quartz scheduler version: 1.5.2
INFO  QuartzScheduler(start:400) - Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED started.

我不知道出了什么问题因为我第一次使用石英。 可能的原因是什么?

提前致谢。

1 个答案:

答案 0 :(得分:1)

这一行

CronTrigger ct=new CronTrigger("cronTrigger","group2","0 57 16 * * ?");

说你的工作将从16:57开始。请参阅此Quartz CronTrigger Tutorial