使用quartz时遇到的问题

相关配置文件如下

(1)web.xml中相关配置
<!-- qutarz loader configuration -->

QuartzInitializer

org.quartz.ee.servlet.QuartzInitializerServlet


shutdown-on-unload
true


config-file
quartz.properties

2

(2)quartz.properties文件内容

Configure Main Scheduler Properties

org.quartz.scheduler.instanceName = DataTransmit

org.quartz.scheduler.instanceId = one

Configure ThreadPool

org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool

org.quartz.threadPool.threadCount = 5

org.quartz.threadPool.threadPriority = 4

Configure JobStore

org.quartz.jobStore.misfireThreshold = 5000

org.quartz.jobStore.class = org.quartz.simpl.RAMJobStore

===========================================================================

Configure SchedulerPlugins ===============================================

===========================================================================

org.quartz.plugin.triggHistory.class =org.quartz.plugins.history.LoggingTriggerHistoryPlugin

org.quartz.plugin.triggHistory.triggerFiredMessage = Trigger{1}.{0}firedjob{6}.{5}at:{4,date,HH:mm:ssMM/dd/yyyy}

org.quartz.plugin.triggHistory.triggerCompleteMessage = Trigger{1}.{0}completedfiringjob{6}.{5}at{4,date,HH:mm:ssMM/dd/yyyy}withresultingtriggerinstructioncode:{9}

org.quartz.plugin.jobInitializer.class = org.quartz.plugins.xml.JobInitializationPlugin

org.quartz.plugin.jobInitializer.fileName =/quartz_reminder.xml

org.quartz.plugin.jobInitializer.overWriteExistingJobs = false

org.quartz.plugin.jobInitializer.failOnFileNotFound = true

org.quartz.plugin.shutdownhook.class = org.quartz.plugins.management.ShutdownHookPlugin

org.quartz.plugin.shutdownhook.cleanShutdown = true

(3)quartz_reminder.xml文件内容

<?xml version="1.0" encoding="UTF-8"?>



<!-- 每日更新表情计数 -->




jobDetail4Day

DEFAULT

com.cycnet.schedule.UpdateFellingCount







trigger4Day

DEFAULT

updatePerDay

DEFAULT
<!-- 每天晚上0点触发此任务 -->

0 0 23 * * ?





!!遇到问题 :
当我改变 我的操作系统 的日期时
会在一个我不期望的时间(不是 0 0 23 * * ? 这个表达式表述的时间内) 调用 UpdateFellingCount(Job导出类) 的excute方法
请各位帮忙看下是什么原因,是不是我的配置文件有问题
谢谢

[b]问题补充:[/b]
相关配置文件如下

(1)web.xml中相关配置
<!-- qutarz loader configuration -->

QuartzInitializer

org.quartz.ee.servlet.QuartzInitializerServlet


shutdown-on-unload
true


config-file
quartz.properties

2

(2)quartz.properties文件内容

Configure Main Scheduler Properties

org.quartz.scheduler.instanceName = DataTransmit

org.quartz.scheduler.instanceId = one

Configure ThreadPool

org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool

org.quartz.threadPool.threadCount = 5

org.quartz.threadPool.threadPriority = 4

Configure JobStore

org.quartz.jobStore.misfireThreshold = 5000

org.quartz.jobStore.class = org.quartz.simpl.RAMJobStore

===========================================================================

Configure SchedulerPlugins ===============================================

===========================================================================

org.quartz.plugin.triggHistory.class =org.quartz.plugins.history.LoggingTriggerHistoryPlugin

org.quartz.plugin.triggHistory.triggerFiredMessage = Trigger{1}.{0}firedjob{6}.{5}at:{4,date,HH:mm:ssMM/dd/yyyy}

org.quartz.plugin.triggHistory.triggerCompleteMessage = Trigger{1}.{0}completedfiringjob{6}.{5}at{4,date,HH:mm:ssMM/dd/yyyy}withresultingtriggerinstructioncode:{9}

org.quartz.plugin.jobInitializer.class = org.quartz.plugins.xml.JobInitializationPlugin

org.quartz.plugin.jobInitializer.fileName =/quartz_reminder.xml

org.quartz.plugin.jobInitializer.overWriteExistingJobs = false

org.quartz.plugin.jobInitializer.failOnFileNotFound = true

org.quartz.plugin.shutdownhook.class = org.quartz.plugins.management.ShutdownHookPlugin

org.quartz.plugin.shutdownhook.cleanShutdown = true

(3)quartz_reminder.xml文件内容

<?xml version="1.0" encoding="UTF-8"?>



<!-- 每日更新表情计数 -->




jobDetail4Day

DEFAULT

com.cycnet.schedule.UpdateFellingCount







trigger4Day

DEFAULT

updatePerDay

DEFAULT
<!-- 每天晚上0点触发此任务 -->

0 0 23 * * ?





!!遇到问题 :
当我改变 我的操作系统 的日期时
会在一个我不期望的时间(不是 0 0 23 * * ? 这个表达式表述的时间内) 调用 UpdateFellingCount(Job导出类) 的excute方法
请各位帮忙看下是什么原因,是不是我的配置文件有问题
谢谢

补充:quartz版本是1.6.0

[b]问题补充:[/b]
不改变是正常的吗?
pan_java (初级程序员) 2009-07-15

不太清楚,因为程序刚写完,应用还没有在晚上运行过

重新启动一下服务器
rain2005 (高级程序员) 2009-07-15

重启后无果

再问一下,怎么回复 答案啊?
javaeye做的不是很人性化, :(

[b]问题补充:[/b]
遇到了更奇怪的问题
我设置了每10秒执行一次(0/10 * * * * ?)
可以正常执行,
我修改为每分钟的20秒时执行一次(20 * * * * ?)
然后重启服务,还是每10秒执行一次,
更改excute方法
System.out.println("in the UpdateFellingCount !!! " + new Date()); (更改前) ------>>>>>>>(更改后)
System.out.println("in the UpdateFellingCount !!! " + new Date() + "!!!!");
然后重新部署应用,清空tomcat的work目录,重启Eclipse,
结果还是每10秒执行一次,console内容如下:
in the UpdateFellingCount !!! Wed Jul 15 15:35:00 CST 2009
in the UpdateFellingCount !!! Wed Jul 15 15:35:10 CST 2009
in the UpdateFellingCount !!! Wed Jul 15 15:35:20 CST 2009
in the UpdateFellingCount !!! Wed Jul 15 15:35:30 CST 2009
in the UpdateFellingCount !!! Wed Jul 15 15:35:40 CST 2009
in the UpdateFellingCount !!! Wed Jul 15 15:35:50 CST 2009
in the UpdateFellingCount !!! Wed Jul 15 15:36:00 CST 2009
in the UpdateFellingCount !!! Wed Jul 15 15:36:10 CST 2009

!!!!!!!

看看这个帖子http://robbin.iteye.com/blog/40989

要程序启动一下服务器

重新启动一下服务器

不改变是正常的吗?

设当前可以测试的时间,看一下.

这种情况是肯定啊,因为线程运行是有操作系统直接调度的,主要是线程还在内存里面,所以关掉服务器也没有用的啊。