You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Dennis Doubleday <de...@righthandmanager.com> on 2002/07/18 23:39:17 UTC

More informative errors from Jasper-generated code?

I am using Tomcat 4.0.3, Windows 2000, JDK 1.4

I was getting the following stack trace from a JSP:

ApplicationDispatcher[/SpendMetrix]: Servlet.service() for servlet jsp
threw exception 
javax.servlet.ServletException

at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContex
tImpl.java:463) 	
at org.apache.jsp.getInfo$jsp._jspService(getInfo$jsp.java:3432) 	
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) 	
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

etc...

which is quite unhelpful because line 3432 in getInfo$jsp.java is just
the location of the catch-all exception handler. The actual cause of the
exception is lost in the mists. I edited getInfo$jsp.java by hand and
added a t.printStackTrace and recompiled it, which handily located the
real error. 

That got me thinking, why couldn't Jasper do this? Maybe
PageContextImpl.handlePageException() could print (or, better yet, log)
the initial Throwable before re-throwing the ServletException.

I'm surprised that I don't get the root cause through the chained
exception facility of JDK 1.4, since that's what I'm using.
handlePageException does "throw new ServletException(t)" so I should get
the root cause from the stack trace.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>