Mike Slinn

Debugging Spring's SEVERE Error ListenerStart

Published 2011-08-04.
Time to read: 1 minutes.

This page is part of the posts collection, categorized under Software.

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:

Shell
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.

Shell
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:

Shell
<listener>
  <listener-class>
    org.springframework.web.util.Log4jConfigListener
  </listener-class>
</listener>
* indicates a required field.

Please select the following to receive Mike Slinn’s newsletter:

You can unsubscribe at any time by clicking the link in the footer of emails.

Mike Slinn uses Mailchimp as his marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp’s privacy practices.