I also have been experiencing my tasks executing twice - its been going on for some time but have only recently found out. Here's my environment and the logs.
spring: 2.0.3
quartz: 1.6.0
Code:
<bean name="jobDetail" class="org.springframework.scheduling.quartz.JobDetailBean">
<property name="jobClass" value="com.service.threads.TaskJob"/>
<property name="jobDataAsMap">
<map>
<entry key="taskService"><ref bean="taskServiceTarget"/></entry>
</map>
</property>
</bean>
<bean name="expiryJobDetail" class="org.springframework.scheduling.quartz.JobDetailBean">
<property name="jobClass" value="com.service.threads.ExpiryJob"/>
<property name="jobDataAsMap">
<map>
<entry key="userService"><ref bean="userService"/></entry>
<entry key="contactService"><ref bean="contactService"/></entry>
</map>
</property>
</bean>
<bean id="cronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="jobDetail"/>
<property name="cronExpression" value="0 0/5 * * * ?"/>
</bean>
<bean id="expiryCronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="expiryJobDetail"/>
<property name="cronExpression" value="0 0 11 * * ?"/>
</bean>
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="configLocation">
<value>/WEB-INF/quartz.properties</value>
</property>
<property name="triggers">
<list>
<ref bean="cronTrigger"/>
<ref bean="expiryCronTrigger"/>
</list>
</property>
</bean>
quartz.properties
Code:
org.quartz.threadPool.class=org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.ThreadCount=1
org.quartz.threadPool.threadPriority=4
org.quartz.plugin.triggHistory.class = org.quartz.plugins.history.LoggingTriggerHistoryPlugin
org.quartz.plugin.triggHistory.triggerFiredMessage = Trigger {1}.{0} fired job {6}.{5} at: {4, date, HH:mm:ss dd/MMM/yyyy}
org.quartz.plugin.triggHistory.triggerCompleteMessage = Trigger {1}.{0} completed firing job {6}.{5} at {4, date, HH:mm:ss dd/MMM/yyyy} with resulting trigger instruction code: {9}
and the logs...
Code:
2007-04-23 14:50:00,012 INFO [org.quartz.plugins.history.LoggingTriggerHistoryPlugin] - Trigger DEFAULT.cronTrigger fired job DEFAULT.jobDetail at: 14:50:00 23/Apr/2007
2007-04-23 14:50:00,016 INFO [org.quartz.plugins.history.LoggingTriggerHistoryPlugin] - Trigger DEFAULT.cronTrigger fired job DEFAULT.jobDetail at: 14:50:00 23/Apr/2007
2007-04-23 14:50:00,024 INFO [org.quartz.plugins.history.LoggingTriggerHistoryPlugin] - Trigger DEFAULT.cronTrigger completed firing job DEFAULT.jobDetail at 14:50:00 23/Apr/2007 with resulting trigger instruction code: DO NOTHING
2007-04-23 14:50:00,068 INFO [org.quartz.plugins.history.LoggingTriggerHistoryPlugin] - Trigger DEFAULT.cronTrigger completed firing job DEFAULT.jobDetail at 14:50:00 23/Apr/2007 with resulting trigger instruction code: DO NOTHING
2007-04-23 14:55:00,014 INFO [org.quartz.plugins.history.LoggingTriggerHistoryPlugin] - Trigger DEFAULT.cronTrigger fired job DEFAULT.jobDetail at: 14:55:00 23/Apr/2007
2007-04-23 14:55:00,018 INFO [org.quartz.plugins.history.LoggingTriggerHistoryPlugin] - Trigger DEFAULT.cronTrigger fired job DEFAULT.jobDetail at: 14:55:00 23/Apr/2007
2007-04-23 14:55:00,028 INFO [org.quartz.plugins.history.LoggingTriggerHistoryPlugin] - Trigger DEFAULT.cronTrigger completed firing job DEFAULT.jobDetail at 14:55:00 23/Apr/2007 with resulting trigger instruction code: DO NOTHING
2007-04-23 14:55:00,076 INFO [org.quartz.plugins.history.LoggingTriggerHistoryPlugin] - Trigger DEFAULT.cronTrigger completed firing job DEFAULT.jobDetail at 14:55:00 23/Apr/2007 with resulting trigger instruction code: DO NOTHING
As you can see at each 5 minute intervals 2 jobs are fired. Although the logs don't show it - the other job (ExpiryJob) also repeats when its due - 11am.
Can anyone suggest a starting point to unravel this?
Regards,
adam