y_cat 2009-07-15 14:28
浏览 374
已采纳

使用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

!!!!!!!

  • 写回答

6条回答 默认 最新

  • iteye_5200 2009-07-15 15:42
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(5条)

报告相同问题?

悬赏问题

  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?
  • ¥100 求三轴之间相互配合画圆以及直线的算法
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发