Spring + Quartz + Tomcat = no shutdown
Not sure if this is the right forum for this but ...
I have Spring 1.2.0, the included Quartz jar and Tomcat 5.28 on WinXP. I have configured a task to run using the Quartz scheduler
Code:
<bean id="quartz" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="waitForJobsToCompleteOnShutdown"><value>true</value></property>
<property name="configLocation"><value>classpath:quartz.properties</value></property>
<property name="triggers">
<list><ref bean="cronReportTrigger"/></list>
</property>
</bean>
quartz.properties ...
Code:
org.quartz.threadPool.class=org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount=2
org.quartz.threadPool.threadPriority=4
and noticed that Tomcat won't shutdown on command anymore. Neither shutdown script or the eclipse tomcat plug-in work If I look at this in eclipse using the Tomcat plug in I see
Thread [DestroyJavaVM]
Thread [Quartz-Scheduler_QuartzSchedulerThread]
Thread [Quartz-Scheduler_Worker-0]
Thread [http-8080-Processor3]
Thread [TP-Processor4]
all listed as Running after a shutdown.
I tried setting waitForJobsToCompleteOnShutdown to false (since the job runs for 5 seconds, only once a day) but this made no difference.
Any one else see this effect?
ps Tomcat shutsdown fine if I comment out the Quartz stuff.
Re: Spring + Quartz + Tomcat = no shutdown
I had the same problem. I fixed it by adding
Code:
destroy-method="destroy"
to the SchedulerFactoryBean definition. This way spring closes down the scheduler when the application is stopped.
Re: Spring + Quartz + Tomcat = no shutdown
Quote:
Originally Posted by kdkooter
I had the same problem. I fixed it by adding
Code:
destroy-method="destroy"
to the SchedulerFactoryBean definition. This way spring closes down the scheduler when the application is stopped.
Hi, Thanks for the reply, I missed that in the documentation.
Is this correct?
Code:
<bean id="quartz"
class="org.springframework.scheduling.quartz.SchedulerFactoryBean"
destroy-method="destroy"
>
<property name="waitForJobsToCompleteOnShutdown"><value>true</value></property>
<property name="configLocation"><value>classpath:quartz.properties</value></property>
<property name="triggers">
<list><ref bean="cronReportTrigger"/></list>
</property>
</bean>
I tried this but sadly saw no difference.
Spring + Quartz + Tomcat = no shutdown
I have the same Problem as ahumphr decribed above.
When i try to shutdown tomcat follwing thread are still alive:
QuartzScheduler_Worker-0
QuartzScheduler_Worker-1
QuartzScheduler_QuartzSchedulerThread
http-processor
TP-Processor
DestoryJavaVm
i can have this problem in IDE and on production server (Windows/Solaris)
I'm using Spring 1.2.0 and Tomcat 5.0.28
here my bean configuration:
<bean id="quartz"
class="org.springframework.scheduling.quartz.Sched ulerFactoryBean"
destroy-method="destroy"
>
<property name="waitForJobsToCompleteOnShutdown"><value>true </value></property>
<property name="configLocation"><value>classpath:quartz.prop erties</value></property>
<property name="triggers">
<list><ref bean="cronReportTrigger"/></list>
</property>
</bean>
the given destroy-method is not called during shutdown process.
I hope someone can help
Regards
fsamland
Spring + Quartz + Tomcat = no shutdown
Sorry i just recognized that we changed to 1.25
so thank you for the hint.
fsamland
Here's what worked for me...
Code:
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="quartzProperties">
<props>
<prop key="org.quartz.threadPool.threadCount">1</prop>
</props>
</property>
<...