<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=andypiper" rel="nofollow">Andy Piper</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-5348?redirect=false" rel="nofollow">SPR-5348</a></strong> and commented</p>
<p dir="auto">In AbstractApplicationContext the isActive flag is set in prepareRefresh(), however the multicaster is not initialized until later in refresh(), thus if you have error handling code which does:</p>
<p dir="auto">if (context.isActive()) {<br>
context.close();<br>
}</p>
<p dir="auto">you end up with this error:</p>
<p dir="auto">&lt;09-Dec-2008 11:00:32 o'clock GMT&gt; &lt;Error&gt; &lt;org.springframework.osgi.context.sup<br>
port.OsgiBundleXmlApplicationContext&gt; &lt;BEA-000000&gt; &lt;Exception thrown from Applic<br>
ationListener handling ContextClosedEvent<br>
java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - c<br>
all 'refresh' before multicasting events via the context: org.springframework.os<br>
gi.context.support.OsgiBundleXmlApplicationContext@9d4d84: display name [OsgiBun<br>
dleXmlApplicationContext(bundle=helloworld, config=osgibundle:/META-INF/spring/*<br>
.xml)]; startup date [Tue Dec 09 11:00:31 GMT 2008]; root of context hierarchy<br>
at org.springframework.context.support.AbstractApplicationContext.getApp<br>
licationEventMulticaster(AbstractApplicationContext.java:287)<br>
at org.springframework.context.support.AbstractApplicationContext.publis<br>
hEvent(AbstractApplicationContext.java:274)<br>
at org.springframework.context.support.AbstractApplicationContext.doClos<br>
e(AbstractApplicationContext.java:819)<br>
at org.springframework.osgi.context.support.AbstractOsgiBundleApplicatio<br>
nContext.doClose(AbstractOsgiBundleApplicationContext.java:206)<br>
at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp<br>
plicationContext.access$501(AbstractDelegatedExecutionApplicationContext.java:68<br>
)<br>
at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp<br>
plicationContext$2.run(AbstractDelegatedExecutionApplicationContext.java:217)<br>
at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCus<br>
tomTCCL(PrivilegedUtils.java:85)<br>
at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp<br>
plicationContext.normalClose(AbstractDelegatedExecutionApplicationContext.java:2<br>
13)<br>
at org.springframework.osgi.extender.internal.dependencies.startup.Depen<br>
dencyWaiterApplicationContextExecutor.close(DependencyWaiterApplicationContextEx<br>
ecutor.java:345)<br>
at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp<br>
plicationContext.doClose(AbstractDelegatedExecutionApplicationContext.java:228)<br>
at org.springframework.context.support.AbstractApplicationContext.close(<br>
AbstractApplicationContext.java:794)<br>
at org.springframework.osgi.extender.internal.activator.ContextLoaderLis<br>
tener$3.run(ContextLoaderListener.java:832)<br>
at org.springframework.osgi.extender.internal.util.concurrent.RunnableTi<br>
medExecution$MonitoredRunnable.run(RunnableTimedExecution.java:60)<br>
at org.springframework.scheduling.timer.DelegatingTimerTask.run(Delegati<br>
ngTimerTask.java:66)<br>
at java.util.TimerThread.mainLoop(Timer.java:512)<br>
at java.util.TimerThread.run(Timer.java:462)</p>
<p dir="auto">Spring-DM has exactly this kind of code and fails in exactly this way.</p>
<p dir="auto">Either the event should be silently dropped or isActive should be set at the end of refresh()</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.5.6</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="398092283" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/10018" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/10018/hovercard" href="https://github.com/spring-projects/spring-framework/issues/10018">#10018</a> AbstractApplicationContext.isActive() out of sync with multicaster (<em><strong>"duplicates"</strong></em>)</li>
</ul>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=cherro" rel="nofollow">Chris Herron</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-5779?redirect=false" rel="nofollow">SPR-5779</a></strong> and commented</p>
<p dir="auto">The various Spring Web tags and template-URI implementation encourage hard-coding of URLs in the view layer.<br>
If I alter a Controller's URL mapping, I need to remember to go and make the corresponding change(s) in my JSPs so that links and forms aren't broken.<br>
If the spring:url and form:form tags were able to accept the FQCN of a controller bean instead of an actual URL, the tag implementation could determine the most appropriate URL mapping, and (if applicable) incorporate any template-URI params / path variables to generate a reliable URL.<br>
By using the the FQCN, we can rely on any modern IDE to locate references during refactoring, instead of requiring additional help from Spring-aware IDE plugins. IMHO this would fit particularly well with Spring 3.0's annotation-based controller configuration.</p>
<p dir="auto">Stripes supports this approach:<br>
<a href="http://stripes.sourceforge.net/docs/current/taglib/stripes/link.html" rel="nofollow">http://stripes.sourceforge.net/docs/current/taglib/stripes/link.html</a><br>
<a href="http://stripes.sourceforge.net/docs/current/taglib/stripes/form.html" rel="nofollow">http://stripes.sourceforge.net/docs/current/taglib/stripes/form.html</a></p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0 M3</p>
<p dir="auto"><strong>Reference URL:</strong> <a href="http://forum.springsource.org/showthread.php?t=72284" rel="nofollow">http://forum.springsource.org/showthread.php?t=72284</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="398107690" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/12241" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/12241/hovercard" href="https://github.com/spring-projects/spring-framework/issues/12241">#12241</a> URI/URL Related Improvement Suggestions for RequestMapping in Spring MVC (<em><strong>"is duplicated by"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398095039" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/10427" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/10427/hovercard" href="https://github.com/spring-projects/spring-framework/issues/10427">#10427</a> Externalized request mapping as a 1st class alternative to <code class="notranslate">@RequestMapping</code></li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398114482" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/13326" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/13326/hovercard" href="https://github.com/spring-projects/spring-framework/issues/13326">#13326</a> Form tag should prepend the contextPath and servletPath if not present</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/6b129c52e3bbcc4d301ad7604d43f39c64d346a1/hovercard" href="https://github.com/spring-projects/spring-framework/commit/6b129c52e3bbcc4d301ad7604d43f39c64d346a1"><tt>6b129c5</tt></a>, <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/9d479feadded560b1d9a2c485730984ff5dcbfdb/hovercard" href="https://github.com/spring-projects/spring-framework/commit/9d479feadded560b1d9a2c485730984ff5dcbfdb"><tt>9d479fe</tt></a></p>
<p dir="auto">32 votes, 29 watchers</p>