Debugging the Infamous Tomcat 6+ “SEVERE: Error listenerStart” Message
Join the DZone community and get the full member experience.Join For Free
i’m sure if you have been developing with java and tomcat for some time, you are likely to run into the infamous debug error.
severe: error listenerstart
you will most likely start googling it trying to find out what the heck is going on. and in trying to see the extended logging on what that “listenerstart” error means. after some lucky searches, you will see links asking you to drop a “log4j.properties” file under ‘/web-inf/classes’ directory inside your war to help debug which one of the listeners is throwing this crazy error.
well, this advise will most likely work for you if you are developing under an earlier version of tomcat. if you are using versions 6.0 or above then continue to read on…
in tomcat 6 or above, the default logger is the”java.util.logging” logger and not log4j. so if you are trying to add a “log4j.properties” file –
this will not work
. the java utils logger looks for a file called “logging.properties” as stated here:
so to get to the debugging details create a “logging.properties” file under your”/web-inf/classes” folder of your war and you’re all set.
and now when you restart your tomcat, you will see all of your debugging in it’s full glory!!!
sample logging.properties file:
org.apache.catalina.core.containerbase.[catalina].level = info org.apache.catalina.core.containerbase.[catalina].handlers = java.util.logging.consolehandler
and you will most likely see a “class-not-found” exception.
look at the bright side, you’re now one step closer to the solution.
Opinions expressed by DZone contributors are their own.