Author: markt Date: Fri Jan 19 19:07:36 2007 New Revision: 498053 URL: http://svn.apache.org/viewvc?view=rev&rev=498053 Log: Put the fix back for 39088 now the build is fixed. Sorry for the noise.
Modified: tomcat/container/tc5.5.x/catalina/build.xml tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/StandardWrapper.java Modified: tomcat/container/tc5.5.x/catalina/build.xml URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/catalina/build.xml?view=diff&rev=498053&r1=498052&r2=498053 ============================================================================== --- tomcat/container/tc5.5.x/catalina/build.xml (original) +++ tomcat/container/tc5.5.x/catalina/build.xml Fri Jan 19 19:07:36 2007 @@ -30,6 +30,7 @@ <!-- Dependent JARs and files --> <property name="ant.jar" value="${ant.home}/lib/ant.jar"/> <property name="servlet-api.jar" value="${api.home}/jsr154/dist/lib/servlet-api.jar"/> + <property name="jsp-api.jar" value="${api.home}/jsr152/dist/lib/jsp-api.jar"/> <property name="tomcat-util.jar" value="${tomcat-util.home}/build/lib/tomcat-util.jar"/> <property name="tomcat-coyote.jar" @@ -72,6 +73,7 @@ <pathelement location="${mail.jar}"/> <pathelement location="${regexp.jar}"/> <pathelement location="${servlet-api.jar}"/> + <pathelement location="${jsp-api.jar}"/> <pathelement location="${xercesImpl.jar}"/> <pathelement location="${xml-apis.jar}"/> <pathelement location="${classes.dir}"/> @@ -101,6 +103,7 @@ <pathelement location="${mail.jar}"/> <pathelement location="${regexp.jar}"/> <pathelement location="${servlet-api.jar}"/> + <pathelement location="${jsp-api.jar}"/> <pathelement location="${xercesImpl.jar}"/> <pathelement location="${xml-apis.jar}"/> <pathelement location="${classes.dir}"/> Modified: tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/StandardWrapper.java URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/StandardWrapper.java?view=diff&rev=498053&r1=498052&r2=498053 ============================================================================== --- tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/StandardWrapper.java (original) +++ tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/StandardWrapper.java Fri Jan 19 19:07:36 2007 @@ -28,6 +28,8 @@ import java.security.AccessController; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; +import java.sql.SQLException; + import javax.servlet.Servlet; import javax.servlet.ServletConfig; import javax.servlet.ServletContext; @@ -36,6 +38,7 @@ import javax.servlet.ServletResponse; import javax.servlet.SingleThreadModel; import javax.servlet.UnavailableException; +import javax.servlet.jsp.JspException; import javax.management.ListenerNotFoundException; import javax.management.MBeanNotificationInfo; import javax.management.Notification; @@ -56,7 +59,6 @@ import org.apache.catalina.security.SecurityUtil; import org.apache.catalina.util.Enumerator; import org.apache.catalina.util.InstanceSupport; -import org.apache.tomcat.util.IntrospectionUtils; import org.apache.tomcat.util.log.SystemLogHandler; import org.apache.commons.modeler.Registry; @@ -632,23 +634,33 @@ * @param e The servlet exception */ public static Throwable getRootCause(ServletException e) { - Throwable rootCause = e; - Throwable rootCauseCheck = null; - // Extra aggressive rootCause finding - do { - try { - rootCauseCheck = (Throwable)IntrospectionUtils.getProperty - (rootCause, "rootCause"); - if (rootCause == rootCauseCheck) - rootCauseCheck = null; - else if (rootCauseCheck != null) - rootCause = rootCauseCheck; + Throwable rootCause = e.getRootCause(); + return findRootCause(e, rootCause); + } - } catch (ClassCastException ex) { - rootCauseCheck = null; - } - } while (rootCauseCheck != null); - return rootCause; + /* + * Work through the root causes using specific methods for well known types + * and getCause() for the rest. Stop when the next rootCause is null or + * an exception is found that has itself as its own rootCause. + */ + private static final Throwable findRootCause(Throwable theException, + Throwable theRootCause) { + + Throwable deeperRootCause = null; + + if (theRootCause == null || theRootCause == theException) { + deeperRootCause = theException; + } else if (theRootCause instanceof ServletException) { + deeperRootCause = ((ServletException) theRootCause).getRootCause(); + } else if (theRootCause instanceof JspException) { + deeperRootCause = ((JspException) theRootCause).getRootCause(); + } else if (theRootCause instanceof SQLException) { + deeperRootCause = ((SQLException) theRootCause).getNextException(); + } else { + deeperRootCause = theRootCause.getCause(); + } + + return deeperRootCause; } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]