<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=jencompgeek" rel="nofollow">Jennifer Hickey</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-6663?redirect=false" rel="nofollow">SPR-6663</a></strong> and commented</p>
<p dir="auto">Just switched to the new <code class="notranslate">@Scheduled</code>, configured only with the default task:annotation-driven/.  I noticed that my <code class="notranslate">@Scheduled</code> task was being executed more frequently than expected. I have Spring/Struts integration that creates a child web app context on init of ActionServlet.  Looks like when the child app context is created, an event is published to the parent root WAC.  This event causes the ScheduledAnnotationBeanPostProcessor in the root WAC to execute ScheduledTaskRegistrar.afterPropertiesSet again, which schedules all tasks again.  So I end up with the same task scheduled to execute at a fixed rate twice.</p>
<p dir="auto">Stack trace on init of the Struts ActionServlet:<br>
ScheduledTaskRegistrar.afterPropertiesSet() line: 107<br>
ScheduledAnnotationBeanPostProcessor.onApplicationEvent(ContextRefreshedEvent) line: 135<br>
ScheduledAnnotationBeanPostProcessor.onApplicationEvent(ApplicationEvent) line: 1<br>
SimpleApplicationEventMulticaster.multicastEvent(ApplicationEvent) line: 97<br>
XmlWebApplicationContext(AbstractApplicationContext).publishEvent(ApplicationEvent) line: 294<br>
XmlWebApplicationContext(AbstractApplicationContext).publishEvent(ApplicationEvent) line: 296<br>
XmlWebApplicationContext(AbstractApplicationContext).finishRefresh() line: 858<br>
XmlWebApplicationContext(AbstractApplicationContext).refresh() line: 419<br>
ContextLoaderPlugIn.createWebApplicationContext(WebApplicationContext) line: 356<br>
ContextLoaderPlugIn.initWebApplicationContext() line: 297<br>
ContextLoaderPlugIn.init(ActionServlet, ModuleConfig) line: 227<br>
ActionServlet.initModulePlugIns(ModuleConfig) line: 871<br>
ActionServlet.init() line: 359<br>
ActionServlet(GenericServlet).init(ServletConfig) line: 212</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0 GA</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="398101633" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/11322" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/11322/hovercard" href="https://github.com/spring-projects/spring-framework/issues/11322">#11322</a> ScheduledAnnotationBeanPostProcessor registers schedules twice in web application (<em><strong>"duplicates"</strong></em>)</li>
</ul>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=kdonald" rel="nofollow">Keith Donald</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-5395?redirect=false" rel="nofollow">SPR-5395</a></strong> and commented</p>
<p dir="auto">I am seeing side-effects in an integration test that initializes a Spring ApplicationContext using <code class="notranslate">@ContextConfiguration</code>.  Specifically, close() on the context does not appear to be being called, ever.  I noticed this because one of my DispoableBeans is not receiving a destroy() callback and that is what is causing the side-effect [which pops up when a <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/test/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/test">@test</a> runs in another, unrelated TestCase class].</p>
<p dir="auto">I understand a test ApplicationContext is cached between test methods, but I would still expect the context to be closed after all tests have run, before moving on to the next test class in the suite.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0 M1</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="398087391" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/9379" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/9379/hovercard" href="https://github.com/spring-projects/spring-framework/issues/9379">#9379</a> Support for <code class="notranslate">@DirtiesContext</code> at the test class level (<em><strong>"duplicates"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398094206" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/10311" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/10311/hovercard" href="https://github.com/spring-projects/spring-framework/issues/10311">#10311</a> Reload the application context for each test in a class with a class level annotation</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398087391" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/9379" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/9379/hovercard" href="https://github.com/spring-projects/spring-framework/issues/9379">#9379</a> Support for <code class="notranslate">@DirtiesContext</code> at the test class level</li>
</ul>