Return-Path: Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: (qmail 14278 invoked from network); 1 Aug 2007 14:22:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Aug 2007 14:22:16 -0000 Received: (qmail 3186 invoked by uid 500); 1 Aug 2007 14:22:11 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 3140 invoked by uid 500); 1 Aug 2007 14:22:11 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 3129 invoked by uid 500); 1 Aug 2007 14:22:11 -0000 Delivered-To: apmail-jakarta-tomcat-dev@jakarta.apache.org Received: (qmail 3126 invoked by uid 99); 1 Aug 2007 14:22:11 -0000 Received: from Unknown (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Aug 2007 07:22:11 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Aug 2007 14:22:05 +0000 Received: by brutus.apache.org (Postfix, from userid 33) id 69C0971403F; Wed, 1 Aug 2007 07:21:50 -0700 (PDT) From: bugzilla@apache.org To: tomcat-dev@jakarta.apache.org Subject: DO NOT REPLY [Bug 43009] New: - Reported exception is not original cause of problem Message-ID: X-Bugzilla-Reason: AssignedTo Date: Wed, 1 Aug 2007 07:21:50 -0700 (PDT) X-Virus-Checked: Checked by ClamAV on apache.org DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG� RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT . ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND� INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=43009 Summary: Reported exception is not original cause of problem Product: Tomcat 5 Version: 5.5.23 Platform: Other OS/Version: other Status: NEW Severity: normal Priority: P2 Component: Webapps:Manager AssignedTo: tomcat-dev@jakarta.apache.org ReportedBy: d.alexander@lse.ac.uk In this method from org.apache.catalina.manager.ManagerServlet protected void uploadWar(HttpServletRequest request, File war) throws IOException { ... BufferedOutputStream ostream = null; try { istream = request.getInputStream(); ostream = new BufferedOutputStream(new FileOutputStream(war), 1024); ... } catch (IOException e) { war.delete(); throw e; } finally { ... } ... } If an Exception is thrown while creating the OutputStream to write the war (say due to lack of write permission in appBase), the useful Exception thrown is caught and the method attempts to clean up with a war.delete(); If an Exception is thrown during the delete (as is quite likely), that is thrown out and logged instead of the original more useful one. So the catch block in the code above would be better written something like this: } catch (IOException originalException) { try { war.delete(); } catch (IOException deleteException) log("Unable to clean up following ["+originalException+"] due to ["+deleteException+"]"); throw originalException; } } -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org