SchedulerFactory schFactory = new StdSchedulerFactory();
Scheduler sched = null;
CronTrigger cronTrigger = null;
try {
sched = schFactory.getScheduler();
JobDetail jobDetail = new JobDetail("job1", "group1",SchedulerPBGC.class);
String cronTimerStr = "* 16 15 * * ? *";
LOG.warn("CRON TRIGGER FORMAT FOR PROCESSING PB GC DATA:"+cronTimerStr);
cronTrigger = new CronTrigger("SchedTrigger", "Group1", cronTimerStr);
sched.scheduleJob(jobDetail, cronTrigger);
sched.start();
LOG.warn("SCHEDULER REGISTERED FOR PROCESSING PB GC DATA : TIME :"+cronTimerStr);
} catch (SchedulerException se) {
LOG.error("SchedulerException Message::"+se.getLocalizedMessage());
}
2012-06-20 15:16:50,001 DefaultQuartzScheduler_Worker-1 WARN test.SchedulerPBGC - ----------PB GC SCHEDULER EXECUTION STARTED-----------------------
2012-06-20 15:16:50,001 DefaultQuartzScheduler_Worker-1 WARN test.SchedulerPBGC - The value of NO_OF_BEFORE_DAY_TO_RUN must be less then zero ..to start the scheduler
2012-06-20 15:16:50,001 DefaultQuartzScheduler_Worker-1 WARN test.SchedulerPBGC - ----------PB GC SCHEDULER EXECUTION COMPLETED-----------------------
2012-06-20 15:16:51,001 DefaultQuartzScheduler_Worker-2 WARN test.SchedulerPBGC - ----------PB GC SCHEDULER EXECUTION STARTED-----------------------
2012-06-20 15:16:51,001 DefaultQuartzScheduler_Worker-2 WARN test.SchedulerPBGC - The value of NO_OF_BEFORE_DAY_TO_RUN must be less then zero ..to start the scheduler
2012-06-20 15:16:51,001 DefaultQuartzScheduler_Worker-2 WARN test.SchedulerPBGC - ----------PB GC SCHEDULER EXECUTION COMPLETED-----------------------
2012-06-20 15:16:52,001 DefaultQuartzScheduler_Worker-3 WARN test.SchedulerPBGC - ----------PB GC SCHEDULER EXECUTION STARTED-----------------------
2012-06-20 15:16:52,001 DefaultQuartzScheduler_Worker-3 WARN test.SchedulerPBGC - The value of NO_OF_BEFORE_DAY_TO_RUN must be less then zero ..to start the scheduler
2012-06-20 15:16:52,001 DefaultQuartzScheduler_Worker-3 WARN test.SchedulerPBGC - ----------PB GC SCHEDULER EXECUTION COMPLETED-----------------------
2012-06-20 15:16:53,001 DefaultQuartzScheduler_Worker-4 WARN test.SchedulerPBGC - ----------PB GC SCHEDULER EXECUTION STARTED-----------------------
2012-06-20 15:16:53,001 DefaultQuartzScheduler_Worker-4 WARN test.SchedulerPBGC - The value of NO_OF_BEFORE_DAY_TO_RUN must be less then zero ..to start the scheduler
2012-06-20 15:16:53,001 DefaultQuartzScheduler_Worker-4 WARN test.SchedulerPBGC - ----------PB GC SCHEDULER EXECUTION COMPLETED-----------------------
2012-06-20 15:16:54,001 DefaultQuartzScheduler_Worker-5 WARN test.SchedulerPBGC - ----------PB GC SCHEDULER EXECUTION STARTED-----------------------
2012-06-20 15:16:54,001 DefaultQuartzScheduler_Worker-5 WARN test.SchedulerPBGC - The value of NO_OF_BEFORE_DAY_TO_RUN must be less then zero ..to start the scheduler
2012-06-20 15:16:54,001 DefaultQuartzScheduler_Worker-5 WARN test.SchedulerPBGC - ----------PB GC SCHEDULER EXECUTION COMPLETED-----------------------
2012-06-20 15:16:55,001 DefaultQuartzScheduler_Worker-6 WARN test.SchedulerPBGC - ----------PB GC SCHEDULER EXECUTION STARTED-----------------------
2012-06-20 15:16:55,001 DefaultQuartzScheduler_Worker-6 WARN test.SchedulerPBGC - The value of NO_OF_BEFORE_DAY_TO_RUN must be less then zero ..to start the scheduler
2012-06-20 15:16:55,001 DefaultQuartzScheduler_Worker-6 WARN test.SchedulerPBGC - ----------PB GC SCHEDULER EXECUTION COMPLETED-----------------------
2012-06-20 15:16:56,001 DefaultQuartzScheduler_Worker-7 WARN test.SchedulerPBGC - ----------PB GC SCHEDULER EXECUTION STARTED-----------------------
2012-06-20 15:16:56,001 DefaultQuartzScheduler_Worker-7 WARN test.SchedulerPBGC - The value of NO_OF_BEFORE_DAY_TO_RUN must be less then zero ..to start the scheduler
2012-06-20 15:16:56,001 DefaultQuartzScheduler_Worker-7 WARN test.SchedulerPBGC - ----------PB GC SCHEDULER EXECUTION COMPLETED-----------------------
2012-06-20 15:16:57,001 DefaultQuartzScheduler_Worker-8 WARN test.SchedulerPBGC - ----------PB GC SCHEDULER EXECUTION STARTED-----------------------
2012-06-20 15:16:57,001 DefaultQuartzScheduler_Worker-8 WARN test.SchedulerPBGC - The value of NO_OF_BEFORE_DAY_TO_RUN must be less then zero ..to start the scheduler
2012-06-20 15:16:57,001 DefaultQuartzScheduler_Worker-8 WARN test.SchedulerPBGC - ----------PB GC SCHEDULER EXECUTION COMPLETED-----------------------
2012-06-20 15:16:58,001 DefaultQuartzScheduler_Worker-9 WARN test.SchedulerPBGC - ----------PB GC SCHEDULER EXECUTION STARTED-----------------------
2012-06-20 15:16:58,001 DefaultQuartzScheduler_Worker-9 WARN test.SchedulerPBGC - The value of NO_OF_BEFORE_DAY_TO_RUN must be less then zero ..to start the scheduler
2012-06-20 15:16:58,001 DefaultQuartzScheduler_Worker-9 WARN test.SchedulerPBGC - ----------PB GC SCHEDULER EXECUTION COMPLETED-----------------------
2012-06-20 15:16:59,001 DefaultQuartzScheduler_Worker-10 WARN test.SchedulerPBGC - ----------PB GC SCHEDULER EXECUTION STARTED-----------------------
2012-06-20 15:16:59,001 DefaultQuartzScheduler_Worker-10 WARN test.SchedulerPBGC - The value of NO_OF_BEFORE_DAY_TO_RUN must be less then zero ..to start the scheduler
2012-06-20 15:16:59,001 DefaultQuartzScheduler_Worker-10 WARN test.SchedulerPBGC - ----------PB GC SCHEDULER EXECUTION COMPLETED--------------------
如何将CronTimer迭代器设置为1?或者如何停止排定程序多次执行作业。
有什么建议吗?谢谢,古扬·沙阿。
我找到解决办法了..
我使用的cron语法是:String cronTimerStr=“*16 15**?*”;
这里在15:16时间,Quartz将每秒初始化所有可能的工人。所以假设在这一分钟内(@16分钟和60秒),它将初始化最多60个线程。
我正在使用Quartz调度器,但我不知道如何并行运行作业。配置文件中有什么东西可以允许我这样做吗?
我有一个使用Quartz1.6.6的Java应用程序。它被部署到Weblogic上,Weblogic的体系结构包括两个应用服务器。 令人困惑的是,我有另一个Java应用程序,其中包含了Quartz调度,它似乎运行得非常愉快。另一个应用程序有一个相同的机制,每分钟触发一个触发器,从日志中我可以看到该作业每60秒只运行一次。 昨天下午作业已运行的次数示例: 15:10:46,984 15:10:49,
问题内容: 对于我的应用程序,我创建作业并使用CronTriggers计划它们。每个作业只有一个触发器,并且作业名称和触发器名称都相同。没有作业共享触发器。 现在,当我创建像这样的cron触发器 “ 0/1 * * 吗?” 它指示作业每秒钟执行一次,效果很好。 当我第一次通过以下方式暂停工作时,问题就出现了: 然后假设50秒后恢复工作: 我看到的是,在这50秒钟中,作业没有按要求执行。但是当我恢复
我使用Quartz1.5.2和Spring3.2.1来做调度器任务,在我的应用程序中,我需要在某个时候重新安排任务,但我发现每次重新安排任务时,它都会在第一次执行两次。 下面是我的Quartz+Spring配置文件: 我把它作为一个web应用程序,下面是web.xml的代码:
一旦我在Quartz中启用集群,它就会将cron作业分发到集群中的各个服务器。这在正常情况下是很好的,但实际上有一个作业我希望在集群中的每台服务器上执行,每次调度它运行时。 是否有方法标记quartz cron作业以指示它应该在集群中的所有服务器上运行?
我正在尝试使用Quartz来调度运行在GlassFish上的web应用程序中的作业。我在用RamjobStore。问题是,有时调度的作业没有被执行,即使它是在过去或将来被调度的。作业数量非常少,排定程序上一直排定的作业总数不到20个,同时保证最多运行1个作业,所以我假设线程计数不是问题,我可以将它设置为ThreadCount1,它仍然可以工作。在servlet被销毁之前,调度程序也不会被关闭。那么