Debugging SEVERE Error ListenerStart

2011-08-04 / All Blog posts

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:

  1. org.springframework.web.context.ContextLoaderListener
  2. org.springframework.web.context.request.RequestContextListener
  3. 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:

1catalina.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>

comments powered by Disqus