Published 2011-08-04.
Time to read: 1 minutes.
This Spring startup error can be mystifying if you don”t know how to tackle it.
listenerStart()
configures and invokes application event listeners for a Context
.
Most Spring applications have several listeners, and they should be invoked in the following order.
Each of them causes debug output, so if you do not see any, the first listener died:
org.springframework.web.context.ContextLoaderListener
org.springframework.web.context.request.RequestContextListener
flex.messaging.HttpFlexSession
(for Spring/Flex integration)
If the error message appeared, one of the above did not initialize correctly.
Put breakpoints in each of the listener classes’
contextInitialized()
or requestInitialized()
methods.
To view debug log messages
for StandardContext
, add:
catalina.org.apache.juli.FileHandler.bufferSize = -1
SEVERE: Error listenerStart
messages can be debugged by setting a breakpoint at
org.springframework.web.context.ContextLoaderListener
, line 47.
contextLoader.initWebApplicationContext(event.getServletContext());
Step return once and wait for the container to load everything.
If there is an error you will now be at standardcontext.listenerstart
and you will see the error in the variable window under the t
variable.
For debug output, add this to web.xml
:
<listener> <listener-class> org.springframework.web.util.Log4jConfigListener </listener-class> </listener>