Skip to content

Tomcat does not shutdown correctly when using task:scheduled-taks [SPR-6901] #11566

@spring-projects-issues

Description

@spring-projects-issues

Axel Fontaine opened SPR-6901 and commented

Using the regular task:scheduler element in conjunction with the task:scheduled-tasks element, results, at least with Tomcat, in a server that is unable to shut down.

The server hangs after having logged the following statement:
Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@d81cda: defining beans []; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@1d49247

Manually defining a task scheduler and setting the threads to run as daemon provides a workaround:

<task:scheduled-tasks scheduler="taskScheduler">
	<task:scheduled ref="myTask" method="run" cron="0 0 0 * * ?"/>
</task:scheduled-tasks>

<bean id="taskScheduler" class="org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler">
	<property name="daemon" value="true"/>
</bean>

However this is only a workaround, and the default behavior should work out of the box. As you can see from the forum post reference, I am not the only one facing this issue.


Affects: 3.0.1

Reference URL: http://forum.springsource.org/showthread.php?t=83687

Issue Links:

Referenced from: commits 8d7df01, bca067a

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions