You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Freek Segers <fr...@nerocmediaware.nl> on 2003/08/05 15:01:32 UTC
Tomcat 4.1.24: details of ServletExceptions
Hello,
I've been developing with Tomcat and Struts from about a year and a
half now. Ever since I started using Tomcat 4.1 I don't get very much
information when a ServletException occurs in a JSP page. The error
page just says that there was a JspException caused by a
ServletException but there's no clue to what actually went wrong.
Is this a configuration matter? I've already set the Jasper
configuration parameter logVerbosityLevel to DEBUG, but that doesn't
help (The JSPs are compiled allright.)
I would appreciate some help; developing like this is a trial and error
process.
Thanks,
Freek Segers
Senior Systeemontwikkelaar
NEROC 'MEDIAWARE
De Run 1131
5503 LB Veldhoven
T +31 (0)40 258 66 66
F +31 (0)40 258 66 77
E-mail: freek.segers@nerocmediaware.nl
Internet: http://www.nerocmediaware.nl
Re: Tomcat 4.1.24: details of ServletExceptions
Posted by Tim Funk <fu...@joedog.org>.
Yup, this is a problem since the root cause is never really exposed. An easy
workaround is to create your own custom error handler and use the following
logic:
Throwable rootCause;
rootCause =(Throwable)request.getAttribute("javax.servlet.error.exception");
while (rootCause!=null) {
doMagicPrintStackTraceAndErrorMessageMethod(rootCause);
if (rootCause instance of ServletException) {
rootCause = ((ServletException)rootCause).getRootCause();
} else if (rootCause instance of JspException) {
rootCause = ((JspException)rootCause).getRootCause();
} else {
rootCause = null;
}
}
-Tim
Freek Segers wrote:
> Hello,
>
> I've been developing with Tomcat and Struts from about a year and a half
> now. Ever since I started using Tomcat 4.1 I don't get very much
> information when a ServletException occurs in a JSP page. The error page
> just says that there was a JspException caused by a ServletException but
> there's no clue to what actually went wrong.
>
> Is this a configuration matter? I've already set the Jasper
> configuration parameter logVerbosityLevel to DEBUG, but that doesn't
> help (The JSPs are compiled allright.)
>
> I would appreciate some help; developing like this is a trial and error
> process.
Re: Tomcat 4.1.24: details of ServletExceptions
Posted by Tim Funk <fu...@joedog.org>.
Yup, this is a problem since the root cause is never really exposed. An easy
workaround is to create your own custom error handler and use the following
logic:
Throwable rootCause;
rootCause =(Throwable)request.getAttribute("javax.servlet.error.exception");
while (rootCause!=null) {
doMagicPrintStackTraceAndErrorMessageMethod(rootCause);
if (rootCause instance of ServletException) {
rootCause = ((ServletException)rootCause).getRootCause();
} else if (rootCause instance of JspException) {
rootCause = ((JspException)rootCause).getRootCause();
} else {
rootCause = null;
}
}
-Tim
Freek Segers wrote:
> Hello,
>
> I've been developing with Tomcat and Struts from about a year and a half
> now. Ever since I started using Tomcat 4.1 I don't get very much
> information when a ServletException occurs in a JSP page. The error page
> just says that there was a JspException caused by a ServletException but
> there's no clue to what actually went wrong.
>
> Is this a configuration matter? I've already set the Jasper
> configuration parameter logVerbosityLevel to DEBUG, but that doesn't
> help (The JSPs are compiled allright.)
>
> I would appreciate some help; developing like this is a trial and error
> process.
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org