Announcement Announcement Module
Collapse
No announcement yet.
Spring + Quartz on Tomcat issue Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring + Quartz on Tomcat issue

    Hi,

    I am using Spring for (among others) configuring Quartz for a scheduled task in a web application.
    Here is my configuration:

    Code:
    <bean id="automatedArchivingAgentJobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
    	<property name="targetObject" ref="automatedArchivingAgent" />
    	<property name="targetMethod" value="run" />
    	<property name="concurrent" value="false" />
    </bean>
    
    <bean id="automatedArchivingAgentTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
    	<property name="jobDetail" ref="automatedArchivingAgentJobDetail" />
    	<property name="cronExpression" value="0 0 0 ? * SAT" />
    </bean>
    
    <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean" destroy-method="destroy">
    	<property name="triggers">
    		<list>
    			<ref bean="automatedArchivingAgentTrigger" />
    		</list>
    	</property>
    	<property name="quartzProperties">
    		<props>		
    			<prop key="org.quartz.threadPool.threadCount">1</prop>
    		</props>
    	</property>
    	<property name="waitForJobsToCompleteOnShutdown" value="true" />
    </bean>
    I am testing the application in Tomcat.
    The problem is that when stopping / restarting the server, I get a warning that says:

    SEVERE: The web application [/App] appears to have started a thread named [org.springframework.scheduling.quartz.SchedulerFac toryBean#0_Worker-1] but has failed to stop it. This is very likely to create a memory leak.
    I read the SchedulerFactoryBean documentation and then searched the web, but couldn't find a fix for the problem.

    The steps I took:
    • Added the destroy-method="destroy" attribute to the SchedulerFactoryBean.
    • Set the "waitForJobsToCompleteOnShutdown" property to true.
    • Set "org.quartz.threadPool.threadCount" to 1 as I don't need multiple threads for my task.

    Unfortunately, none of those fixed the problem.

    I am using:
    Spring 3.0.5
    Quartz 1.6.3
    JDK 1.6.0.22
    Tomcat 6.0.32

  • #2
    Any help?

    After several restarts, the server is not stopping anymore, it just waits, printing nothing.

    I would be glad to provide more information.

    Comment

    Working...
    X