Issue 1:
Andy Piper opened SPR-5348 and commented

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:

if (context.isActive()) {

context.close();

}

you end up with this error:

<09-Dec-2008 11:00:32 o'clock GMT> <Error> <org.springframework.osgi.context.sup

port.OsgiBundleXmlApplicationContext> <BEA-000000> <Exception thrown from Applic

ationListener handling ContextClosedEvent

java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - c

all 'refresh' before multicasting events via the context: org.springframework.os

gi.context.support.OsgiBundleXmlApplicationContext@9d4d84: display name [OsgiBun

dleXmlApplicationContext(bundle=helloworld, config=osgibundle:/META-INF/spring/*

.xml)]; startup date [Tue Dec 09 11:00:31 GMT 2008]; root of context hierarchy

at org.springframework.context.support.AbstractApplicationContext.getApp

licationEventMulticaster(AbstractApplicationContext.java:287)

at org.springframework.context.support.AbstractApplicationContext.publis

hEvent(AbstractApplicationContext.java:274)

at org.springframework.context.support.AbstractApplicationContext.doClos

e(AbstractApplicationContext.java:819)

at org.springframework.osgi.context.support.AbstractOsgiBundleApplicatio

nContext.doClose(AbstractOsgiBundleApplicationContext.java:206)

at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp

plicationContext.access$501(AbstractDelegatedExecutionApplicationContext.java:68

)

at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp

plicationContext$2.run(AbstractDelegatedExecutionApplicationContext.java:217)

at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCus

tomTCCL(PrivilegedUtils.java:85)

at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp

plicationContext.normalClose(AbstractDelegatedExecutionApplicationContext.java:2

13)

at org.springframework.osgi.extender.internal.dependencies.startup.Depen

dencyWaiterApplicationContextExecutor.close(DependencyWaiterApplicationContextEx

ecutor.java:345)

at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp

plicationContext.doClose(AbstractDelegatedExecutionApplicationContext.java:228)

at org.springframework.context.support.AbstractApplicationContext.close(

AbstractApplicationContext.java:794)

at org.springframework.osgi.extender.internal.activator.ContextLoaderLis

tener$3.run(ContextLoaderListener.java:832)

at org.springframework.osgi.extender.internal.util.concurrent.RunnableTi

medExecution$MonitoredRunnable.run(RunnableTimedExecution.java:60)

at org.springframework.scheduling.timer.DelegatingTimerTask.run(Delegati

ngTimerTask.java:66)

at java.util.TimerThread.mainLoop(Timer.java:512)

at java.util.TimerThread.run(Timer.java:462)

Spring-DM has exactly this kind of code and fails in exactly this way.

Either the event should be silently dropped or isActive should be set at the end of refresh()

Affects: 2.5.6

Issue Links:

#10018 AbstractApplicationContext.isActive() out of sync with multicaster ("duplicates")

Issue 2:
Chris Herron opened SPR-5779 and commented

The various Spring Web tags and template-URI implementation encourage hard-coding of URLs in the view layer.

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.

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.

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.

Stripes supports this approach:

http://stripes.sourceforge.net/docs/current/taglib/stripes/link.html

http://stripes.sourceforge.net/docs/current/taglib/stripes/form.html

Affects: 3.0 M3

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

Issue Links:

#12241 URI/URL Related Improvement Suggestions for RequestMapping in Spring MVC ("is duplicated by")

#10427 Externalized request mapping as a 1st class alternative to @RequestMapping

#13326 Form tag should prepend the contextPath and servletPath if not present

Referenced from: commits 6b129c5, 9d479fe

32 votes, 29 watchers