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条)

报告相同问题?

悬赏问题

  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波
  • ¥15 针对曲面部件的制孔路径规划,大家有什么思路吗
  • ¥15 钢筋实图交点识别,机器视觉代码
  • ¥15 如何在Linux系统中,但是在window系统上idea里面可以正常运行?(相关搜索:jar包)
  • ¥50 400g qsfp 光模块iphy方案
  • ¥15 两块ADC0804用proteus仿真时,出现异常
  • ¥15 关于风控系统,如何去选择