Debugging Tomcat WAR


I hope would have found a step by step guide for debugging a tomcat WAR at runtime. Unfortunately the documentation sucks, I mean really, you expect people to go through pages of tutorials to understand debugging. Why cant it just be a few steps. Anyway, I figured some of the crap out, and am documenting it here for my reference. If you like to add more points please comment.

catalina.out, gives out errors but really cryptic shit. Unbelieveable that a out file would only give something as stupid as “SEVERE: ERROR LISTENERSTART” AND “SEVERE: ERROR FILTERSTART”. This happens when an exception is thrown in the contextInitialized method of a ServletContextListener. For this all I had to do was create a new logging.properties file in /var/lib/tomcat7/webapps/MY_APP/WEB_INF/classes folder. In this file I added these 2 lines for getting a stack trace on catalina.out.

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

More is coming here…

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s