Having thought that the duplicate log problem had fixed itself, I now notice that whilst my log file doesn't show jobs duplicating in itself, it does duplicate jobs in a different log file (log.1)!
The files show the same times with different threads executing! (I assume they are different threads because of the @address is different). And my error - which needs fixing fundamentally - is caused by these duplicate jobs.
Can anyone suggest where to start looking?
log
Code:
2007-05-05 09:50:00,020 INFO [org.quartz.plugins.history.LoggingTriggerHistoryPlugin] - Trigger DEFAULT.cronTrigger fired job DEFAULT.jobDetail at: 09:50:00 05/May/2007
2007-05-05 09:50:00,024 INFO [org.quartz.plugins.history.LoggingTriggerHistoryPlugin] - Trigger DEFAULT.cronTrigger completed firing job DEFAULT.jobDetail at 09:50:00 05/May/2007 with resulting trigger instruction code: DO NOTHING
2007-05-05 09:55:00,021 INFO [org.quartz.plugins.history.LoggingTriggerHistoryPlugin] - Trigger DEFAULT.cronTrigger fired job DEFAULT.jobDetail at: 09:55:00 05/May/2007
2007-05-05 09:55:00,023 INFO [org.quartz.plugins.history.LoggingTriggerHistoryPlugin] - Trigger DEFAULT.cronTrigger completed firing job DEFAULT.jobDetail at 09:55:00 05/May/2007 with resulting trigger instruction code: DO NOTHING
2007-05-05 10:00:00,014 INFO [org.quartz.plugins.history.LoggingTriggerHistoryPlugin] - Trigger DEFAULT.cronTrigger fired job DEFAULT.jobDetail at: 10:00:00 05/May/2007
2007-05-05 10:00:00,023 INFO [com.service.threads.TaskJob] - task to assess (by thread: com.service.threads.TaskJob@2933dc): user_event_type_utc_version_processing 56, 200, 2, 2007-05-05T10:00:00.000+01:00, 0, false
2007-05-05 10:00:00,059 INFO [com.service.threads.TaskJob] - handling task (by thread: com.service.threads.TaskJob@2933dc): user_event_type_utc_version_processing 56, 200, 2, 2007-05-05T10:00:00.000+01:00, 2, true
2007-05-05 10:00:00,112 INFO [com.service.TaskServiceImpl] - sending task email: user_event_reminderUtc_others 56, 200, 2007-05-05T10:00:00.000+01:00, : x@x.com
2007-05-05 10:00:00,112 INFO [com.service.TaskServiceImpl] - attempting to parse: SimpleMailMessage: from=reminder@co.uk; replyTo=x@x.com; to=x@x.com; cc=; bcc=; sentDate=null; subject=Birthday: Adrian: 12 May 2007; text=Birthday: Adrian: 12 May 2007
2007-05-05 10:00:00,237 INFO [com.service.TaskServiceImpl] - sent: SimpleMailMessage: from=reminder@co.uk; replyTo=x@x.com; to=x@x.com; cc=; bcc=; sentDate=null; subject=Birthday: Adrian: 12 May 2007; text=Birthday: Adrian: 12 May 2007
2007-05-05 10:00:00,249 WARN [org.hibernate.util.JDBCExceptionReporter] - SQL Error: 1062, SQLState: 23000
2007-05-05 10:00:00,249 ERROR [org.hibernate.util.JDBCExceptionReporter] - Duplicate entry '56-200-2007-05-05 10:00:00' for key 1
2007-05-05 10:00:00,249 ERROR [org.hibernate.event.def.AbstractFlushingEventListener] - Could not synchronize database state with session
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
log.1
Code:
2007-05-05 09:50:00,021 INFO [org.quartz.plugins.history.LoggingTriggerHistoryPlugin] - Trigger DEFAULT.cronTrigger fired job DEFAULT.jobDetail at: 09:50:00 05/May/2007
2007-05-05 09:50:00,026 INFO [org.quartz.plugins.history.LoggingTriggerHistoryPlugin] - Trigger DEFAULT.cronTrigger completed firing job DEFAULT.jobDetail at 09:50:00 05/May/2007 with resulting trigger instruction code: DO NOTHING
2007-05-05 09:55:00,013 INFO [org.quartz.plugins.history.LoggingTriggerHistoryPlugin] - Trigger DEFAULT.cronTrigger fired job DEFAULT.jobDetail at: 09:55:00 05/May/2007
2007-05-05 09:55:00,016 INFO [org.quartz.plugins.history.LoggingTriggerHistoryPlugin] - Trigger DEFAULT.cronTrigger completed firing job DEFAULT.jobDetail at 09:55:00 05/May/2007 with resulting trigger instruction code: DO NOTHING
2007-05-05 10:00:00,016 INFO [org.quartz.plugins.history.LoggingTriggerHistoryPlugin] - Trigger DEFAULT.cronTrigger fired job DEFAULT.jobDetail at: 10:00:00 05/May/2007
2007-05-05 10:00:00,024 INFO [com.service.threads.TaskJob] - task to assess (by thread: com.service.threads.TaskJob@10bd379): user_event_type_utc_version_processing 56, 200, 2, 2007-05-05T10:00:00.000+01:00, 0, false
2007-05-05 10:00:00,075 INFO [com.service.threads.TaskJob] - handling task (by thread: com.service.threads.TaskJob@10bd379): user_event_type_utc_version_processing 56, 200, 2, 2007-05-05T10:00:00.000+01:00, 2, true
2007-05-05 10:00:00,115 INFO [com.service.TaskServiceImpl] - sending task email: user_event_reminderUtc_others 56, 200, 2007-05-05T10:00:00.000+01:00, : x@x.com
2007-05-05 10:00:00,115 INFO [com.service.TaskServiceImpl] - attempting to parse: SimpleMailMessage: from=reminder@co.uk; replyTo=x@x.com; to=x@x.com; cc=; bcc=; sentDate=null; subject=Birthday: Adrian: 12 May 2007; text=Birthday: Adrian: 12 May 2007
2007-05-05 10:00:00,214 INFO [com.service.TaskServiceImpl] - sent: SimpleMailMessage: from=reminder@co.uk; replyTo=x@x.com; to=x@x.com; cc=; bcc=; sentDate=null; subject=Birthday: Adrian: 12 May 2007; text=Birthday: Adrian: 12 May 2007
2007-05-05 10:00:00,221 INFO [com.service.threads.TaskJob] - resetting task: user_event_type_utc_version_processing 56, 200, 2, 2007-05-05T10:00:00.000+01:00, 2, true
2007-05-05 10:00:00,239 INFO [com.service.threads.TaskJob] - reset task to (if same details, will be dropped): user_event_type_utc_version_processing 56, 200, 2, 2008-05-05T09:00:00.000Z, 3, false
2007-05-05 10:00:00,239 INFO [org.quartz.plugins.history.LoggingTriggerHistoryPlugin] - Trigger DEFAULT.cronTrigger completed firing job DEFAULT.jobDetail at 10:00:00 05/May/2007 with resulting trigger instruction code: DO NOTHING
here's my log properties file
Code:
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=log
log4j.appender.file.MaxFileSize=512KB
log4j.appender.file.MaxBackupIndex=5
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d %p [%c] - %m%n
log4j.rootLogger=WARN, file
# duplicate jobs
log4j.category.org.quartz=INFO
log4j.category.com.service.threads.TaskJob=INFO
log4j.category.com.service.threads.ExpiryJob=INFO
log4j.category.com.service.threads.SendMessageThread=INFO
log4j.category.com.service.TaskServiceImpl=INFO
log4j.category.com.service.mobile.MobileProviderServiceClickATell=INFO
threading context
Code:
<!-- THREADS -->
<bean id="sendMessageThread" class="com.service.threads.SendMessageThread">
<property name="taskExecutor"><ref bean="taskExecutor"/></property>
<property name="taskService"><ref bean="taskServiceTarget"/></property>
<property name="sendMessageService"><ref bean="sendMessageService"/></property>
</bean>
<bean id="taskExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
<property name="corePoolSize" value="5"/>
<property name="maxPoolSize" value="10"/>
</bean>