When exceptions are nested multiple times inside of ServletExcpetions - occasionally the true root cause is not logged (to disk). This complaint occasionally appears on the user list. I think the problem is due to StandardWrapperValve using commons-logging and commons-logging knows nothing about nested exceptions. (At least with respect to ServletException)

A fix could be this (which I don't like and would probably be -1'd by someone). So I have a few questions about the possible patch below:
- Is this correct - its *ugly* in its output but it seems to work
- Is this the only place to fix?
- Is there a better alternative?
- Or did I completely miss something?


-Tim


RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardWrapperValve.java,v
retrieving revision 1.15
diff -u -b -r1.15 StandardWrapperValve.java
--- StandardWrapperValve.java 26 May 2003 22:03:59 -0000 1.15
+++ StandardWrapperValve.java 21 Jun 2003 17:38:15 -0000
@@ -286,6 +286,17 @@
hreq.removeAttribute(Globals.JSP_FILE_ATTR);
log.error(sm.getString("standardWrapper.serviceException",
wrapper.getName()), e);
+ Throwable rootCause = e.getRootCause();
+ while (rootCause!=null) {
+ log.error(sm.getString("standardWrapper.serviceException",
+ wrapper.getName()), rootCause);
+
+ if (rootCause instanceof ServletException)
+ rootCause = ((ServletException) rootCause).getRootCause();
+ else
+ rootCause = null;
+ }
+



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to