Results 1 to 8 of 8

Thread: Spring + Quartz + Tomcat = no shutdown

Hybrid View

  1. #1

    Default 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&#58;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.

  2. #2

    Default 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.
    Kees de Kooter

  3. #3

    Default 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&#58;quartz.properties</value></property>
    		<property name="triggers">
    			<list><ref bean="cronReportTrigger"/></list>
    		</property>
    	</bean>
    I tried this but sadly saw no difference.

  4. #4
    Join Date
    Feb 2006
    Posts
    2

    Default 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

  5. #5
    Join Date
    Sep 2004
    Location
    Copenhagen, Denmark
    Posts
    113

    Default

    Have you tried to upgrade to the latest Spring 1.26? It might be fixed there.
    Also you could try a never version of Quartz - it is shipped with Spring (the big .zip file)
    /Claus

  6. #6
    Join Date
    Feb 2006
    Posts
    2

    Default Spring + Quartz + Tomcat = no shutdown

    Sorry i just recognized that we changed to 1.25
    so thank you for the hint.
    fsamland

  7. #7
    Join Date
    Jul 2009
    Posts
    1

    Default 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>
      <...

Similar Threads

  1. Replies: 3
    Last Post: May 11th, 2005, 01:38 PM
  2. Replies: 14
    Last Post: Feb 21st, 2005, 05:41 PM
  3. Spring error with embedded Tomcat 5.0.27 in Eclipse 3.0
    By hqfz in forum SpringSource Tool Suite
    Replies: 0
    Last Post: Jan 13th, 2005, 09:35 AM
  4. Problem integrating spring with quartz
    By viniciusboson in forum Container
    Replies: 7
    Last Post: Nov 25th, 2004, 04:21 AM
  5. Replies: 1
    Last Post: Nov 10th, 2004, 03:40 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •