« Back in the Northeast | Main | iTrip stations »

Getting more info out of ServletException

This is probably obvious to everyone, but it took me looking at javadocs to figure out how to make tomcat give me more information than just a generic "ServletException" with no context, no message and a useless (in this case) stack trace.

Thread-45[1] dump e.getRootCause().printStackTrace();

Where e is the exception, RootCause is a java.lang.Throwable

java.lang.NoClassDefFoundError
        at xxx._jspService(_xxx_0.java:262)

Much better than

javax.servlet.ServletException
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:508)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

Comments