Trifork Blog

Debugging the dreaded "SEVERE: Error listenerStart" and "SEVERE: Error filterStart" tomcat error messages

March 18th, 2011 by
| Reply

Just a quick post that I hope might benefit others. If you have been developing web applications on tomcat for a while you have likely come the two error messages mentioned in the title.

SEVERE: Error listenerStart

Occurs when an exception is thrown in the contextInitialized method of a ServletContextListener

SEVERE: Error filterStart

Occurs when an exception is thrown in the init method of a Filter

Unfortunately by default, tomcat won't provide you with any details about the cause of the error. Infact it wont even tell you which filter or listener is failing. This can be big problem in applications of significant size that have many filters and listeners configured. Fortunately there is a solution. In your webapplication's WEB-INF/classes folder you can create a logging.properties file with the following contents

org.apache.catalina.core.ContainerBase.[Catalina].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].handlers = java.util.logging.ConsoleHandler

Now you will be presented with the stacktrace

36 Responses

  1. April 3, 2011 at 21:29 by Flashrunner

    Thanks!
    It works!

  2. April 19, 2011 at 10:49 by Ali

    Brilliant solution!

  3. April 28, 2011 at 12:16 by Kevin Keegan

    You the man, top solution.

  4. May 3, 2011 at 08:50 by Racs

    Thanks, it works!

  5. May 21, 2011 at 13:28 by Micha Roon

    it just works. thanks a lot, it was driving me craizy this
    SEVERE: Error filterStart

  6. June 7, 2011 at 08:33 by Tseliso

    Thanks, it works!

  7. June 21, 2011 at 17:50 by Alex Guerrieri

    You saved me a lot of time with this little trick. Many thanks!

  8. June 24, 2011 at 23:00 by blog/shl@INTERDOSE » links for 2011-06-24

    [...] Debugging the dreaded “SEVERE: Error listenerStart” and “SEVERE: Error filterStart” tomcat e... (tags: java) Related: MacOS Forge und git... [...]

  9. August 10, 2011 at 22:22 by Bijesh

    Great help... Thanks alot

  10. August 15, 2011 at 20:23 by Niklas

    Be sure to really call the file "logging.properties". I was trying to add those lines to an existing "log4j.properties" file which did not produce the desired logging output (tomcat 7.0.19).
    Once I called the file "logging.properties" it worked...

  11. August 24, 2011 at 23:35 by Numerouno

    Thanks - it works

  12. September 2, 2011 at 08:21 by Amol

    Thx a lot it works..... Great Help :)

  13. September 8, 2011 at 11:22 by Marcel

    Hi,

    if you have this problem mit JBoss 4, then edit server/default/conf/jboss-log4j.xml and add this:

  14. September 8, 2011 at 11:23 by Marcel

    <category name="org.apache.catalina.core.ContainerBase">
    <priority value="INFO"/>
    </category>

  15. December 12, 2011 at 00:54 by Pravin

    Thanks a lot .....it worked!!

  16. December 28, 2011 at 08:18 by Roshan

    Thanks a lot dudde, It's solved my problem.
    Thanks once again.

  17. January 11, 2012 at 07:43 by Manav

    I did the steps. But still no stacktrace is printed on the console. Am I missing something ? Do I need to call logging.properties file explicitly ?

  18. February 6, 2012 at 17:05 by Gianluca

    Thanks! This saved my day once more!

  19. February 9, 2012 at 10:00 by Monali

    I had missed out on commons-pool-1.4.jar in my spring application.
    It works after I include this jar.

  20. February 16, 2012 at 18:30 by Steve

    I had SEVERE Error listenerStart while starting tomcat on Mac OS X lion and the fix for me was to set

    export JAVA_OPTS=-Djava.net.preferIPv4Stack=true

    before starting

  21. March 3, 2012 at 03:20 by Joselito

    thanks!

  22. March 23, 2012 at 03:34 by Thiago

    At Tomcat-7.0.x it only works if you set the configurations to conf/logging.properties

  23. April 4, 2012 at 18:34 by Kyle

    I'm using tomcat 7.0.12 and I can't get this to work. I added those lines to logging.properties in the conf directory but I still just get the same error with no extra information. Is there something else I need to do?

  24. April 5, 2012 at 20:58 by Maya Buttreeks

    Works perfectly! Thanks for the tip!

  25. April 23, 2012 at 00:32 by Jonathon

    Well, Thiago, fancy seeing you making that point, since I came here for that same reason.

    And...we work for the same company ;)

  26. June 9, 2012 at 10:53 by Semika

    Thank you so much. I can see full stack trance now. ;)

  27. August 13, 2012 at 08:46 by swetha

    Thank You so so much.Your tip is really useful.

  28. November 28, 2012 at 13:25 by dlaro

    Tomcat 7.0.30 provides such a standard logging configuration:

    ---
    org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO
    org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers = 2localhost.org.apache.juli.FileHandler

    org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].level = INFO
    org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers = 3manager.org.apache.juli.FileHandler

    org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].level = INFO
    org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].handlers = 4host-manager.org.apache.juli.FileHandler

    ---
    This means that you simply have o look into the parallel produced log file, which starts like "localhost.*".

  29. January 22, 2013 at 12:39 by Srikanth

    Thanks... it works

  30. April 18, 2013 at 13:10 by Arun Chaudhary

    Great help. Thanx a lot. It saved a lot of time.

  31. June 5, 2013 at 21:28 by Ed

    Thanks, something worked -- finally!
    (I will take small victories) :)

  32. September 13, 2013 at 04:32 by Anonymous

    Awesome tip!! Thanks for sharing!

  33. October 29, 2013 at 15:14 by Error listenerStart | infinitymania

    […] Error listenerStart […]

  34. November 14, 2013 at 11:47 by Martí Mayné

    Thanks, thanks, thanks !!!

  35. December 19, 2013 at 14:29 by Djordje

    Aaaaaaw! Thanksssss!!!!

  36. April 16, 2014 at 16:30 by Vee

    thanks that really helped :)

Leave a Reply