From: markt Date: Mon, 27 Sep 2010 22:12:05 +0000 (+0000) Subject: Partial fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=48644 X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=e3c364bf6c18c00b8334338d30a3d896b1925477;p=tomcat7.0 Partial fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=48644 Some Throwables must always be re-thrown git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1001932 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/coyote/ajp/AjpAprProcessor.java b/java/org/apache/coyote/ajp/AjpAprProcessor.java index 19fd595e3..d9b514abc 100644 --- a/java/org/apache/coyote/ajp/AjpAprProcessor.java +++ b/java/org/apache/coyote/ajp/AjpAprProcessor.java @@ -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); diff --git a/java/org/apache/coyote/ajp/AjpAprProtocol.java b/java/org/apache/coyote/ajp/AjpAprProtocol.java index b0395cde2..8c3fa7103 100644 --- a/java/org/apache/coyote/ajp/AjpAprProtocol.java +++ b/java/org/apache/coyote/ajp/AjpAprProtocol.java @@ -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. diff --git a/java/org/apache/coyote/ajp/AjpProcessor.java b/java/org/apache/coyote/ajp/AjpProcessor.java index 70d060907..75cce7b91 100644 --- a/java/org/apache/coyote/ajp/AjpProcessor.java +++ b/java/org/apache/coyote/ajp/AjpProcessor.java @@ -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); diff --git a/java/org/apache/coyote/ajp/AjpProtocol.java b/java/org/apache/coyote/ajp/AjpProtocol.java index f42bb24cf..4f88b445a 100644 --- a/java/org/apache/coyote/ajp/AjpProtocol.java +++ b/java/org/apache/coyote/ajp/AjpProtocol.java @@ -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. diff --git a/java/org/apache/coyote/http11/AbstractHttp11Processor.java b/java/org/apache/coyote/http11/AbstractHttp11Processor.java index 4a400c173..9dc59dc67 100644 --- a/java/org/apache/coyote/http11/AbstractHttp11Processor.java +++ b/java/org/apache/coyote/http11/AbstractHttp11Processor.java @@ -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; } diff --git a/java/org/apache/coyote/http11/Http11AprProcessor.java b/java/org/apache/coyote/http11/Http11AprProcessor.java index ab2ed8c2b..50dd5c9e2 100644 --- a/java/org/apache/coyote/http11/Http11AprProcessor.java +++ b/java/org/apache/coyote/http11/Http11AprProcessor.java @@ -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); diff --git a/java/org/apache/coyote/http11/Http11AprProtocol.java b/java/org/apache/coyote/http11/Http11AprProtocol.java index 4c4f67b67..c31ad43b0 100644 --- a/java/org/apache/coyote/http11/Http11AprProtocol.java +++ b/java/org/apache/coyote/http11/Http11AprProtocol.java @@ -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. diff --git a/java/org/apache/coyote/http11/Http11NioProcessor.java b/java/org/apache/coyote/http11/Http11NioProcessor.java index ded215304..cde379f42 100644 --- a/java/org/apache/coyote/http11/Http11NioProcessor.java +++ b/java/org/apache/coyote/http11/Http11NioProcessor.java @@ -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); diff --git a/java/org/apache/coyote/http11/Http11NioProtocol.java b/java/org/apache/coyote/http11/Http11NioProtocol.java index 5acc5ae7e..013898b42 100644 --- a/java/org/apache/coyote/http11/Http11NioProtocol.java +++ b/java/org/apache/coyote/http11/Http11NioProtocol.java @@ -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. diff --git a/java/org/apache/coyote/http11/Http11Processor.java b/java/org/apache/coyote/http11/Http11Processor.java index 97583960f..24056c093 100644 --- a/java/org/apache/coyote/http11/Http11Processor.java +++ b/java/org/apache/coyote/http11/Http11Processor.java @@ -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); diff --git a/java/org/apache/coyote/http11/Http11Protocol.java b/java/org/apache/coyote/http11/Http11Protocol.java index e99eccdbb..055f59ae2 100644 --- a/java/org/apache/coyote/http11/Http11Protocol.java +++ b/java/org/apache/coyote/http11/Http11Protocol.java @@ -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.