<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=axelfont" rel="nofollow">Axel Fontaine</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-6901?redirect=false" rel="nofollow">SPR-6901</a></strong> and commented</p>
<p dir="auto">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.</p>
<p dir="auto">The server hangs after having logged the following statement:<br>
Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@d81cda: defining beans []; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@1d49247</p>
<p dir="auto">Manually defining a task scheduler and setting the threads to run as daemon provides a workaround:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;task:scheduled-tasks scheduler=&quot;taskScheduler&quot;&gt;
	&lt;task:scheduled ref=&quot;myTask&quot; method=&quot;run&quot; cron=&quot;0 0 0 * * ?&quot;/&gt;
&lt;/task:scheduled-tasks&gt;

&lt;bean id=&quot;taskScheduler&quot; class=&quot;org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler&quot;&gt;
	&lt;property name=&quot;daemon&quot; value=&quot;true&quot;/&gt;
&lt;/bean&gt;"><pre class="notranslate"><code class="notranslate">&lt;task:scheduled-tasks scheduler="taskScheduler"&gt;
	&lt;task:scheduled ref="myTask" method="run" cron="0 0 0 * * ?"/&gt;
&lt;/task:scheduled-tasks&gt;

&lt;bean id="taskScheduler" class="org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler"&gt;
	&lt;property name="daemon" value="true"/&gt;
&lt;/bean&gt;
</code></pre></div>
<p dir="auto">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.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0.1</p>
<p dir="auto"><strong>Reference URL:</strong> <a href="http://forum.springsource.org/showthread.php?t=83687" rel="nofollow">http://forum.springsource.org/showthread.php?t=83687</a></p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398103645" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/11620" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/11620/hovercard" href="https://github.com/spring-projects/spring-framework/issues/11620">#11620</a> TaskExecutor created with task:executor not shutdown when context closes (<em><strong>"duplicates"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398103645" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/11620" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/11620/hovercard" href="https://github.com/spring-projects/spring-framework/issues/11620">#11620</a> TaskExecutor created with task:executor not shutdown when context closes</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398105377" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/11890" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/11890/hovercard" href="https://github.com/spring-projects/spring-framework/issues/11890">#11890</a> Tomcat does not shutdown correctly when using <code class="notranslate">@Scheduled</code></li>
</ul>
<p dir="auto"><strong>Referenced from:</strong> commits <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/8d7df01d73bd2ef4d440c230c0e3d444e0abc185/hovercard" href="https://github.com/spring-projects/spring-framework/commit/8d7df01d73bd2ef4d440c230c0e3d444e0abc185"><tt>8d7df01</tt></a>, <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/bca067abb2e9cb44031899134b44df09055c7e9b/hovercard" href="https://github.com/spring-projects/spring-framework/commit/bca067abb2e9cb44031899134b44df09055c7e9b"><tt>bca067a</tt></a></p>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=bozho" rel="nofollow">Bozhidar Bozhanov</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-8607?redirect=false" rel="nofollow">SPR-8607</a></strong> and commented</p>
<p dir="auto">(This is not an issue for the code or the framework, so this might not be the right place for it, but I don't see where to report it)</p>
<p dir="auto">The issue reporting interfaces has some serious drawbacks:</p>
<ul dir="auto">
<li>you can't edit your own bug report. If you mistype something in the title, or want to add a stacktrace/code to the description, you can't.</li>
<li>you can't edit your own comments below the issue</li>
<li>Tomcat has a stable version 7 for a year already and it does not appear in the list of tomcat versions. Perhaps it's the same for other containers/servers.</li>
<li>Affects version/s does not provide an option for "SNAPSHOT". I'm using the snapshot builds, but have to report M2</li>
</ul>
<hr>
<p dir="auto">This issue is a sub-task of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398111136" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/12773" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/12773/hovercard" href="https://github.com/spring-projects/spring-framework/issues/12773">#12773</a></p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398118170" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/13889" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/13889/hovercard" href="https://github.com/spring-projects/spring-framework/issues/13889">#13889</a> Unable to edit JIRA issue description after creation (<em><strong>"is duplicated by"</strong></em>)</li>
</ul>
<p dir="auto">2 votes, 4 watchers</p>