Partial fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=48644
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 27 Sep 2010 22:12:05 +0000 (22:12 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 27 Sep 2010 22:12:05 +0000 (22:12 +0000)
Some Throwables must always be re-thrown

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1001932 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/coyote/ajp/AjpAprProcessor.java
java/org/apache/coyote/ajp/AjpAprProtocol.java
java/org/apache/coyote/ajp/AjpProcessor.java
java/org/apache/coyote/ajp/AjpProtocol.java
java/org/apache/coyote/http11/AbstractHttp11Processor.java
java/org/apache/coyote/http11/Http11AprProcessor.java
java/org/apache/coyote/http11/Http11AprProtocol.java
java/org/apache/coyote/http11/Http11NioProcessor.java
java/org/apache/coyote/http11/Http11NioProtocol.java
java/org/apache/coyote/http11/Http11Processor.java
java/org/apache/coyote/http11/Http11Protocol.java

index 19fd595..d9b514a 100644 (file)
@@ -34,6 +34,7 @@ import org.apache.coyote.OutputBuffer;
 import org.apache.coyote.Request;
 import org.apache.coyote.RequestInfo;
 import org.apache.coyote.Response;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.jni.Socket;
@@ -409,6 +410,7 @@ public class AjpAprProcessor implements ActionHook {
                 error = true;
                 break;
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 log.debug(sm.getString("ajpprocessor.header.error"), t);
                 // 400 - Bad Request
                 response.setStatus(400);
@@ -421,6 +423,7 @@ public class AjpAprProcessor implements ActionHook {
             try {
                 prepareRequest();
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 log.debug(sm.getString("ajpprocessor.request.prepare"), t);
                 // 400 - Internal Server Error
                 response.setStatus(400);
@@ -436,6 +439,7 @@ public class AjpAprProcessor implements ActionHook {
                 } catch (InterruptedIOException e) {
                     error = true;
                 } catch (Throwable t) {
+                    ExceptionUtils.handleThrowable(t);
                     log.error(sm.getString("ajpprocessor.request.process"), t);
                     // 500 - Internal Server Error
                     response.setStatus(500);
@@ -453,6 +457,7 @@ public class AjpAprProcessor implements ActionHook {
                 try {
                     finish();
                 } catch (Throwable t) {
+                    ExceptionUtils.handleThrowable(t);
                     error = true;
                 }
             }
@@ -498,6 +503,7 @@ public class AjpAprProcessor implements ActionHook {
         } catch (InterruptedIOException e) {
             error = true;
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log.error(sm.getString("http11processor.request.process"), t);
             // 500 - Internal Server Error
             response.setStatus(500);
index b0395cd..8c3fa71 100644 (file)
@@ -36,6 +36,7 @@ import org.apache.coyote.Adapter;
 import org.apache.coyote.ProtocolHandler;
 import org.apache.coyote.RequestGroupInfo;
 import org.apache.coyote.RequestInfo;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.modeler.Registry;
@@ -420,6 +421,7 @@ public class AjpAprProtocol
             // rare-but-nonfatal exceptions, catch them here, and log as
             // above.
             catch (Throwable e) {
+                ExceptionUtils.handleThrowable(e);
                 // any other exception or error is odd. Here we log it
                 // with "ERROR" level, so it will show up even on
                 // less-than-verbose logs.
@@ -456,6 +458,7 @@ public class AjpAprProtocol
                 // rare-but-nonfatal exceptions, catch them here, and log as
                 // above.
                 catch (Throwable e) {
+                    ExceptionUtils.handleThrowable(e);
                     // any other exception or error is odd. Here we log it
                     // with "ERROR" level, so it will show up even on
                     // less-than-verbose logs.
index 70d0609..75cce7b 100644 (file)
@@ -36,6 +36,7 @@ import org.apache.coyote.OutputBuffer;
 import org.apache.coyote.Request;
 import org.apache.coyote.RequestInfo;
 import org.apache.coyote.Response;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.buf.ByteChunk;
@@ -418,6 +419,7 @@ public class AjpProcessor implements ActionHook {
                 error = true;
                 break;
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 log.debug(sm.getString("ajpprocessor.header.error"), t);
                 // 400 - Bad Request
                 response.setStatus(400);
@@ -430,6 +432,7 @@ public class AjpProcessor implements ActionHook {
             try {
                 prepareRequest();
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 log.debug(sm.getString("ajpprocessor.request.prepare"), t);
                 // 400 - Internal Server Error
                 response.setStatus(400);
@@ -445,6 +448,7 @@ public class AjpProcessor implements ActionHook {
                 } catch (InterruptedIOException e) {
                     error = true;
                 } catch (Throwable t) {
+                    ExceptionUtils.handleThrowable(t);
                     log.error(sm.getString("ajpprocessor.request.process"), t);
                     // 500 - Internal Server Error
                     response.setStatus(500);
@@ -462,6 +466,7 @@ public class AjpProcessor implements ActionHook {
                 try {
                     finish();
                 } catch (Throwable t) {
+                    ExceptionUtils.handleThrowable(t);
                     error = true;
                 }
             }
@@ -499,6 +504,7 @@ public class AjpProcessor implements ActionHook {
         } catch (InterruptedIOException e) {
             error = true;
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log.error(sm.getString("http11processor.request.process"), t);
             // 500 - Internal Server Error
             response.setStatus(500);
index f42bb24..4f88b44 100644 (file)
@@ -37,6 +37,7 @@ import org.apache.coyote.Adapter;
 import org.apache.coyote.ProtocolHandler;
 import org.apache.coyote.RequestGroupInfo;
 import org.apache.coyote.RequestInfo;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.modeler.Registry;
@@ -416,6 +417,7 @@ public class AjpProtocol
             // rare-but-nonfatal exceptions, catch them here, and log as
             // above.
             catch (Throwable e) {
+                ExceptionUtils.handleThrowable(e);
                 // any other exception or error is odd. Here we log it
                 // with "ERROR" level, so it will show up even on
                 // less-than-verbose logs.
index 4a400c1..9dc59dc 100644 (file)
@@ -39,6 +39,7 @@ import org.apache.coyote.http11.filters.IdentityOutputFilter;
 import org.apache.coyote.http11.filters.SavedRequestInputFilter;
 import org.apache.coyote.http11.filters.VoidInputFilter;
 import org.apache.coyote.http11.filters.VoidOutputFilter;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.buf.Ascii;
@@ -1082,6 +1083,7 @@ public abstract class AbstractHttp11Processor {
         } catch (IOException e) {
             error = true;
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log.error(sm.getString("http11processor.request.finish"), t);
             // 500 - Internal Server Error
             response.setStatus(500);
@@ -1093,6 +1095,7 @@ public abstract class AbstractHttp11Processor {
         } catch (IOException e) {
             error = true;
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log.error(sm.getString("http11processor.response.finish"), t);
             error = true;
         }
index ab2ed8c..50dd5c9 100644 (file)
@@ -31,6 +31,7 @@ import org.apache.coyote.Request;
 import org.apache.coyote.RequestInfo;
 import org.apache.coyote.Response;
 import org.apache.coyote.http11.filters.BufferedInputFilter;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.jni.Address;
@@ -156,6 +157,7 @@ public class Http11AprProcessor extends AbstractHttp11Processor implements Actio
         } catch (InterruptedIOException e) {
             error = true;
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log.error(sm.getString("http11processor.request.process"), t);
             // 500 - Internal Server Error
             response.setStatus(500);
@@ -242,6 +244,7 @@ public class Http11AprProcessor extends AbstractHttp11Processor implements Actio
                 error = true;
                 break;
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 if (log.isDebugEnabled()) {
                     log.debug(sm.getString("http11processor.header.parse"), t);
                 }
@@ -257,6 +260,7 @@ public class Http11AprProcessor extends AbstractHttp11Processor implements Actio
                 try {
                     prepareRequest();
                 } catch (Throwable t) {
+                    ExceptionUtils.handleThrowable(t);
                     if (log.isDebugEnabled()) {
                         log.debug(sm.getString("http11processor.request.prepare"), t);
                     }
@@ -287,6 +291,7 @@ public class Http11AprProcessor extends AbstractHttp11Processor implements Actio
                 } catch (InterruptedIOException e) {
                     error = true;
                 } catch (Throwable t) {
+                    ExceptionUtils.handleThrowable(t);
                     log.error(sm.getString("http11processor.request.process"), t);
                     // 500 - Internal Server Error
                     response.setStatus(500);
@@ -363,6 +368,7 @@ public class Http11AprProcessor extends AbstractHttp11Processor implements Actio
         } catch (InterruptedIOException e) {
             error = true;
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log.error(sm.getString("http11processor.request.process"), t);
             // 500 - Internal Server Error
             response.setStatus(500);
index 4c4f67b..c31ad43 100644 (file)
@@ -28,6 +28,7 @@ import javax.management.ObjectName;
 
 import org.apache.coyote.RequestGroupInfo;
 import org.apache.coyote.RequestInfo;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.modeler.Registry;
@@ -320,6 +321,7 @@ public class Http11AprProtocol extends AbstractHttp11Protocol {
                     // rare-but-nonfatal exceptions, catch them here, and log as
                     // above.
                     catch (Throwable e) {
+                        ExceptionUtils.handleThrowable(e);
                         // any other exception or error is odd. Here we log it
                         // with "ERROR" level, so it will show up even on
                         // less-than-verbose logs.
@@ -380,6 +382,7 @@ public class Http11AprProtocol extends AbstractHttp11Protocol {
             // rare-but-nonfatal exceptions, catch them here, and log as
             // above.
             catch (Throwable e) {
+                ExceptionUtils.handleThrowable(e);
                 // any other exception or error is odd. Here we log it
                 // with "ERROR" level, so it will show up even on
                 // less-than-verbose logs.
@@ -403,6 +406,7 @@ public class Http11AprProtocol extends AbstractHttp11Protocol {
                 // exceptions, catch them here, and log as per {@link #event()}
                 // above.
                 } catch (Throwable e) {
+                    ExceptionUtils.handleThrowable(e);
                     // any other exception or error is odd. Here we log it
                     // with "ERROR" level, so it will show up even on
                     // less-than-verbose logs.
index ded2153..cde379f 100644 (file)
@@ -29,6 +29,7 @@ import org.apache.coyote.Request;
 import org.apache.coyote.RequestInfo;
 import org.apache.coyote.Response;
 import org.apache.coyote.http11.filters.BufferedInputFilter;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.buf.Ascii;
@@ -190,6 +191,7 @@ public class Http11NioProcessor extends AbstractHttp11Processor implements Actio
         } catch (InterruptedIOException e) {
             error = true;
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log.error(sm.getString("http11processor.request.process"), t);
             // 500 - Internal Server Error
             response.setStatus(500);
@@ -250,6 +252,7 @@ public class Http11NioProcessor extends AbstractHttp11Processor implements Actio
         } catch (InterruptedIOException e) {
             error = true;
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log.error(sm.getString("http11processor.request.process"), t);
             // 500 - Internal Server Error
             response.setStatus(500);
@@ -344,6 +347,7 @@ public class Http11NioProcessor extends AbstractHttp11Processor implements Actio
                 error = true;
                 break;
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 if (log.isDebugEnabled()) {
                     log.debug(sm.getString("http11processor.header.parse"), t);
                 }
@@ -359,6 +363,7 @@ public class Http11NioProcessor extends AbstractHttp11Processor implements Actio
                 try {
                     prepareRequest();
                 } catch (Throwable t) {
+                    ExceptionUtils.handleThrowable(t);
                     if (log.isDebugEnabled()) {
                         log.debug(sm.getString("http11processor.request.prepare"), t);
                     }
@@ -403,6 +408,7 @@ public class Http11NioProcessor extends AbstractHttp11Processor implements Actio
                 } catch (InterruptedIOException e) {
                     error = true;
                 } catch (Throwable t) {
+                    ExceptionUtils.handleThrowable(t);
                     log.error(sm.getString("http11processor.request.process"), t);
                     // 500 - Internal Server Error
                     response.setStatus(500);
index 5acc5ae..013898b 100644 (file)
@@ -29,6 +29,7 @@ import javax.management.ObjectName;
 
 import org.apache.coyote.RequestGroupInfo;
 import org.apache.coyote.RequestInfo;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.modeler.Registry;
@@ -318,6 +319,7 @@ public class Http11NioProtocol extends AbstractHttp11JsseProtocol {
                 // rare-but-nonfatal exceptions, catch them here, and log as
                 // above.
                 catch (Throwable e) {
+                    ExceptionUtils.handleThrowable(e);
                     // any other exception or error is odd. Here we log it
                     // with "ERROR" level, so it will show up even on
                     // less-than-verbose logs.
@@ -414,6 +416,7 @@ public class Http11NioProtocol extends AbstractHttp11JsseProtocol {
             // rare-but-nonfatal exceptions, catch them here, and log as
             // above.
             catch (Throwable e) {
+                ExceptionUtils.handleThrowable(e);
                 // any other exception or error is odd. Here we log it
                 // with "ERROR" level, so it will show up even on
                 // less-than-verbose logs.
index 9758396..24056c0 100644 (file)
@@ -30,6 +30,7 @@ import org.apache.coyote.Request;
 import org.apache.coyote.RequestInfo;
 import org.apache.coyote.Response;
 import org.apache.coyote.http11.filters.BufferedInputFilter;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.buf.ByteChunk;
@@ -171,6 +172,7 @@ public class Http11Processor extends AbstractHttp11Processor implements ActionHo
         try {
             socket.getSocket().setSoTimeout(soTimeout);
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log.debug(sm.getString("http11processor.socket.timeout"), t);
             error = true;
         }
@@ -203,6 +205,7 @@ public class Http11Processor extends AbstractHttp11Processor implements ActionHo
                 error = true;
                 break;
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 if (log.isDebugEnabled()) {
                     log.debug(sm.getString("http11processor.header.parse"), t);
                 }
@@ -218,6 +221,7 @@ public class Http11Processor extends AbstractHttp11Processor implements ActionHo
                 try {
                     prepareRequest();
                 } catch (Throwable t) {
+                    ExceptionUtils.handleThrowable(t);
                     if (log.isDebugEnabled()) {
                         log.debug(sm.getString("http11processor.request.prepare"), t);
                     }
@@ -249,6 +253,7 @@ public class Http11Processor extends AbstractHttp11Processor implements ActionHo
                 } catch (InterruptedIOException e) {
                     error = true;
                 } catch (Throwable t) {
+                    ExceptionUtils.handleThrowable(t);
                     log.error(sm.getString("http11processor.request.process"), t);
                     // 500 - Internal Server Error
                     response.setStatus(500);
@@ -269,6 +274,7 @@ public class Http11Processor extends AbstractHttp11Processor implements ActionHo
                 if (!isAsync())
                     endRequest();
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 log.error(sm.getString("http11processor.request.finish"), t);
                 // 500 - Internal Server Error
                 response.setStatus(500);
@@ -278,6 +284,7 @@ public class Http11Processor extends AbstractHttp11Processor implements ActionHo
             try {
                 rp.setStage(org.apache.coyote.Constants.STAGE_ENDOUTPUT);
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 log.error(sm.getString("http11processor.response.finish"), t);
                 error = true;
             }
@@ -330,6 +337,7 @@ public class Http11Processor extends AbstractHttp11Processor implements ActionHo
         } catch (InterruptedIOException e) {
             error = true;
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log.error(sm.getString("http11processor.request.process"), t);
             // 500 - Internal Server Error
             response.setStatus(500);
index e99eccd..055f59a 100644 (file)
@@ -31,6 +31,7 @@ import javax.management.ObjectName;
 
 import org.apache.coyote.RequestGroupInfo;
 import org.apache.coyote.RequestInfo;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.juli.logging.Log;
 import org.apache.tomcat.util.modeler.Registry;
 import org.apache.tomcat.util.net.AbstractEndpoint.Handler.SocketState;
@@ -282,6 +283,7 @@ public class Http11Protocol extends AbstractHttp11JsseProtocol {
             // rare-but-nonfatal exceptions, catch them here, and log as
             // above.
             catch (Throwable e) {
+                ExceptionUtils.handleThrowable(e);
                 // any other exception or error is odd. Here we log it
                 // with "ERROR" level, so it will show up even on
                 // less-than-verbose logs.