DEBUGGING THE DREADED

来源:互联网 发布:淘宝家具内容营销 编辑:程序博客网 时间:2024/06/06 19:45

http://blog.jteam.nl/2011/03/18/debugging-the-dreaded-severe-error-listenerstart-and-severe-error-filterstart-tomcat-error-messages/

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

原创粉丝点击