Author: markt Date: Tue Mar 15 23:05:53 2011 New Revision: 1081987 URL: http://svn.apache.org/viewvc?rev=1081987&view=rev Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=50929 When wrapping an exception, set the root cause
Modified: tomcat/trunk/java/javax/servlet/http/HttpUtils.java tomcat/trunk/java/org/apache/catalina/connector/CoyoteInputStream.java tomcat/trunk/java/org/apache/catalina/realm/JDBCRealm.java tomcat/trunk/java/org/apache/catalina/valves/JDBCAccessLogValve.java tomcat/trunk/java/org/apache/naming/resources/WARDirContext.java tomcat/trunk/java/org/apache/tomcat/util/digester/NodeCreateRule.java tomcat/trunk/webapps/docs/changelog.xml Modified: tomcat/trunk/java/javax/servlet/http/HttpUtils.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/http/HttpUtils.java?rev=1081987&r1=1081986&r2=1081987&view=diff ============================================================================== --- tomcat/trunk/java/javax/servlet/http/HttpUtils.java (original) +++ tomcat/trunk/java/javax/servlet/http/HttpUtils.java Tue Mar 15 23:05:53 2011 @@ -182,7 +182,7 @@ public class HttpUtils { } while ((len - offset) > 0); } catch (IOException e) { - throw new IllegalArgumentException(e.getMessage()); + throw new IllegalArgumentException(e.getMessage(), e); } // XXX we shouldn't assume that the only kind of POST body @@ -194,7 +194,7 @@ public class HttpUtils { } catch (java.io.UnsupportedEncodingException e) { // XXX function should accept an encoding parameter & throw this // exception. Otherwise throw something expected. - throw new IllegalArgumentException(e.getMessage()); + throw new IllegalArgumentException(e.getMessage(), e); } } Modified: tomcat/trunk/java/org/apache/catalina/connector/CoyoteInputStream.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/CoyoteInputStream.java?rev=1081987&r1=1081986&r2=1081987&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/connector/CoyoteInputStream.java (original) +++ tomcat/trunk/java/org/apache/catalina/connector/CoyoteInputStream.java Tue Mar 15 23:05:53 2011 @@ -101,7 +101,7 @@ public class CoyoteInputStream if (e instanceof IOException){ throw (IOException)e; } else { - throw new RuntimeException(e.getMessage()); + throw new RuntimeException(e.getMessage(), e); } } } else { @@ -131,7 +131,7 @@ public class CoyoteInputStream if (e instanceof IOException){ throw (IOException)e; } else { - throw new RuntimeException(e.getMessage()); + throw new RuntimeException(e.getMessage(), e); } } } else { @@ -162,7 +162,7 @@ public class CoyoteInputStream if (e instanceof IOException){ throw (IOException)e; } else { - throw new RuntimeException(e.getMessage()); + throw new RuntimeException(e.getMessage() ,e); } } } else { @@ -195,7 +195,7 @@ public class CoyoteInputStream if (e instanceof IOException){ throw (IOException)e; } else { - throw new RuntimeException(e.getMessage()); + throw new RuntimeException(e.getMessage(), e); } } } else { @@ -235,7 +235,7 @@ public class CoyoteInputStream if (e instanceof IOException){ throw (IOException)e; } else { - throw new RuntimeException(e.getMessage()); + throw new RuntimeException(e.getMessage(), e); } } } else { Modified: tomcat/trunk/java/org/apache/catalina/realm/JDBCRealm.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/realm/JDBCRealm.java?rev=1081987&r1=1081986&r2=1081987&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/realm/JDBCRealm.java (original) +++ tomcat/trunk/java/org/apache/catalina/realm/JDBCRealm.java Tue Mar 15 23:05:53 2011 @@ -698,7 +698,7 @@ public class JDBCRealm driver = (Driver) clazz.newInstance(); } catch (Throwable e) { ExceptionUtils.handleThrowable(e); - throw new SQLException(e.getMessage()); + throw new SQLException(e.getMessage(), e); } } Modified: tomcat/trunk/java/org/apache/catalina/valves/JDBCAccessLogValve.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/JDBCAccessLogValve.java?rev=1081987&r1=1081986&r2=1081987&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/valves/JDBCAccessLogValve.java (original) +++ tomcat/trunk/java/org/apache/catalina/valves/JDBCAccessLogValve.java Tue Mar 15 23:05:53 2011 @@ -573,7 +573,7 @@ public final class JDBCAccessLogValve ex driver = (Driver) clazz.newInstance(); } catch (Throwable e) { ExceptionUtils.handleThrowable(e); - throw new SQLException(e.getMessage()); + throw new SQLException(e.getMessage(), e); } } Modified: tomcat/trunk/java/org/apache/naming/resources/WARDirContext.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/resources/WARDirContext.java?rev=1081987&r1=1081986&r2=1081987&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/naming/resources/WARDirContext.java (original) +++ tomcat/trunk/java/org/apache/naming/resources/WARDirContext.java Tue Mar 15 23:05:53 2011 @@ -990,7 +990,7 @@ public class WARDirContext extends BaseD return is; } } catch (ZipException e) { - throw new IOException(e.getMessage()); + throw new IOException(e.getMessage(), e); } return super.streamContent(); } Modified: tomcat/trunk/java/org/apache/tomcat/util/digester/NodeCreateRule.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/digester/NodeCreateRule.java?rev=1081987&r1=1081986&r2=1081987&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/digester/NodeCreateRule.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/digester/NodeCreateRule.java Tue Mar 15 23:05:53 2011 @@ -172,7 +172,7 @@ public class NodeCreateRule extends Rule top.appendChild(doc.createTextNode(str)); } } catch (DOMException e) { - throw new SAXException(e.getMessage()); + throw new SAXException(e.getMessage(), e); } } @@ -202,7 +202,7 @@ public class NodeCreateRule extends Rule top = top.getParentNode(); depth--; } catch (DOMException e) { - throw new SAXException(e.getMessage()); + throw new SAXException(e.getMessage(), e); } } @@ -225,7 +225,7 @@ public class NodeCreateRule extends Rule try { top.appendChild(doc.createProcessingInstruction(target, data)); } catch (DOMException e) { - throw new SAXException(e.getMessage()); + throw new SAXException(e.getMessage(), e); } } @@ -270,7 +270,7 @@ public class NodeCreateRule extends Rule previousTop.appendChild(top); depth++; } catch (DOMException e) { - throw new SAXException(e.getMessage()); + throw new SAXException(e.getMessage(), e); } } Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1081987&r1=1081986&r2=1081987&view=diff ============================================================================== --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Tue Mar 15 23:05:53 2011 @@ -73,6 +73,10 @@ When using parallel deployment, correctly handle the scenario when the client sends multiple JSESSIONID cookies. (markt) </fix> + <fix> + <bug>50929</bug>When wrapping an exception, include the root cause. + Patch provided by sebb. (markt) + </fix> </changelog> </subsection> <subsection name="Coyote"> @@ -91,10 +95,6 @@ <bug>50928</bug>: Don't ignore keyPass attribute for HTTP BIO and NIO connectors. Based on a patch provided by sebb. (markt) </fix> - <fix> - Make root cause exception available if JSSE SSL initialisation fails. - Patch provided by sebb. (markt) - </fix> </changelog> </subsection> <subsection name="Web applications"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org