spring -report.xml
<bean id="scheduleReportEmailJob" class="org.springframework.scheduling.quartz.JobDetailBean"> <property name="jobClass" value="schedule.ReportQuartzJobBean"/> <property name="jobDataAsMap"> <map> <entry key="reportService" value-ref="reportService"/> </map> </property> </bean> <bean id="cronEmailTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean"> <property name="jobDetail" ref="scheduleReportEmailJob"/> <property name="cronExpression" value="0 0,15,30,45 * ? * MON-FRI"/> </bean> <bean id="scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="triggers"> <list> <ref bean="cronEmailTrigger"/> </list> </property> <property name="quartzProperties"> <props> <prop key="org.quartz.scheduler.instanceName">Reports</prop> <prop key="org.quartz.scheduler.instanceId">FirstInstance</prop> <prop key="org.quartz.scheduler.rmi.export">false</prop> <prop key="org.quartz.scheduler.rmi.proxy">false</prop> <prop key="org.quartz.threadPool.class">org.quartz.simpl.SimpleThreadPool</prop> <prop key="org.quartz.threadPool.threadCount">1</prop> <prop key="org.quartz.jobStore.class">org.quartz.simpl.RAMJobStore</prop> <prop key="org.quartz.scheduler.jobFactory.class">org.quartz.simpl.SimpleJobFactory</prop> </props> </property> </bean>
private static BeanFactory factory = new ClassPathXmlApplicationContext("spring-report.xml");
When i start tomcat
2011-02-07 06:46:57,005(ISO8601) [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Invoking afterPropertiesSet() on bean with name 'scheduler' 2011-02-07 06:46:57,083(ISO8601) [main] INFO org.quartz.core.SchedulerSignalerImpl - Initialized Scheduler Signaller of type: class org.quartz.core.Schedu lerSignalerImpl 2011-02-07 06:46:57,083(ISO8601) [main] INFO org.quartz.core.QuartzScheduler - Quartz Scheduler v.1.6.3 created. 2011-02-07 06:46:57,084(ISO8601) [main] INFO org.quartz.core.QuartzScheduler - JobFactory set to: org.quartz.simpl.SimpleJobFactory@3dd510be 2011-02-07 06:46:57,085(ISO8601) [main] INFO org.quartz.simpl.RAMJobStore - RAMJobStore initialized. 2011-02-07 06:46:57,085(ISO8601) [main] INFO org.quartz.impl.StdSchedulerFactory - Quartz scheduler 'Reports' initialized from an externally provided prop erties instance. 2011-02-07 06:46:57,085(ISO8601) [main] INFO org.quartz.impl.StdSchedulerFactory - Quartz scheduler version: 1.6.3 2011-02-07 06:46:57,087(ISO8601) [main] INFO org.quartz.core.QuartzScheduler - JobFactory set to: org.springframework.scheduling.quartz.AdaptableJobFactor y@206fa7ec 2011-02-07 06:46:57,094(ISO8601) [main] INFO org.springframework.scheduling.quartz.SchedulerFactoryBean - Starting Quartz Scheduler now 2011-02-07 06:46:57,094(ISO8601) [main] INFO org.quartz.core.QuartzScheduler - Scheduler Reports_$_FirstInstance started. 2011-02-07 06:46:57,139(ISO8601) [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'sc heduler' 2011-02-07 06:46:57,140(ISO8601) [main] DEBUG org.springframework.context.support.ClassPathXmlApplicationContext - Publishing event in context [org.springf ramework.context.support.ClassPathXmlApplicationContext@4275b35 ]: org.springframework.context.event.ContextRefreshedEvent[source=org.springframework.context.s upport.ClassPathXmlApplicationContext@4275b35 : display name [org .springframework.context.support.ClassPathXmlApplicationContext@ 4275b35]; startup date [Mon Fe b 07 06:46:55 EST 2011]; root of context hierarchy]
Tasks are launched twice some time after I started tomcat, if I delete the entire cache from the working directory and the exploded military file and redeploy it, it starts the work only once. any ideas? perhaps bean caching?
@jhouse re deploy seems to be the problems that I inserted a thread dump after redistributing it, what are my options?
@jhouse
"Reports_QuartzSchedulerThread" prio = 10 tid = 0x00002aab0c10b000 nid = 0x1dc0 in Object.wait () [0x0000000044501000] java.lang.Thread.State: TIMED_WAITING (on the object’s monitor) in java.lang.Object.wait (native method) <0x00002aaac9e6d298> (object java.lang.Object) on org.quartz.core.QuartzSchedulerThread.run (QuartzSchedulerThread.java:433) - blocked <0x00002aaac9e6d298> (object java.lang.Object)
"Reports_Worker-1" prio = 10 tid = 0x00002aab0c10a800 nid = 0x1dbf in Object.wait () [0x0000000044400000] java.lang.Thread.State: TIMED_WAITING (on the monitor of the object) in java.lang.Object.wait (native method) - waiting on <0x00002aaac9e4c980> (org.quartz.simpl.SimpleThreadPool $ WorkerThread) on org.quartz.simpl.SimpleThreadPool $ WorkerThread.run (SimpleThreadPool.javahaps19) - blocked <0x00002aaac9e4c980> (org.qureadThread.slim )
"Reports_QuartzSchedulerThread" prio = 10 tid = 0x00002aab0841b800 nid = 0x1da3 in Object.wait () [0x0000000041715000] java.lang.Thread.State: TIMED_WAITING (on the object’s monitor) in java.lang.Object.wait (on its own method) - wait <0x00002aaac4fc71d0> (object java.lang.Object) on org.quartz.core.QuartzSchedulerThread.run (QuartzSchedulerThread.java:433) - blocked <0x00002aaac4fc71d0> (object java.lang.Object)
"Reports_Worker-1" prio = 10 tid = 0x00002aab091a3000 nid = 0x1da2 in Object.wait () [0x0000000041614000] java.lang.Thread.State: TIMED_WAITING (on the monitor of the object) in java.lang.Object.wait (native method) - waiting on <0x00002aaac4e21b10> (org.quartz.simpl.SimpleThreadPool $ WorkerThread) on org.quartz.simpl.SimpleThreadPool $ WorkerThread.run (SimpleThreadPool.javahaps19) - blocked <0x00002aaac4e21b10> (org.quartzThreadplplpl )
If I stop the server, then check the dump of the stream that it is empty, and then start (without clearing) the server, there are repeating threads in the stream file that are executed