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

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

18 files changed:
java/org/apache/catalina/authenticator/FormAuthenticator.java
java/org/apache/catalina/connector/CoyoteAdapter.java
java/org/apache/catalina/connector/Request.java
java/org/apache/catalina/core/ApplicationContext.java
java/org/apache/catalina/core/ApplicationContextFacade.java
java/org/apache/catalina/core/ApplicationDispatcher.java
java/org/apache/catalina/core/ApplicationFilterChain.java
java/org/apache/catalina/core/AprLifecycleListener.java
java/org/apache/catalina/core/ContainerBase.java
java/org/apache/catalina/core/DefaultInstanceManager.java
java/org/apache/catalina/core/JasperListener.java
java/org/apache/catalina/core/StandardContext.java
java/org/apache/catalina/core/StandardContextValve.java
java/org/apache/catalina/core/StandardHost.java
java/org/apache/catalina/core/StandardHostValve.java
java/org/apache/catalina/core/StandardServer.java
java/org/apache/catalina/core/StandardWrapper.java
java/org/apache/catalina/core/StandardWrapperValve.java

index 721129c..ec9af56 100644 (file)
@@ -36,6 +36,7 @@ import org.apache.catalina.Session;
 import org.apache.catalina.connector.Request;
 import org.apache.catalina.deploy.LoginConfig;
 import org.apache.coyote.ActionCode;
+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;
@@ -322,6 +323,7 @@ public class FormAuthenticator
         try {
             disp.forward(request.getRequest(), response);
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             String msg = sm.getString("formAuthenticator.forwardLoginFail");
             log.warn(msg, t);
             request.setAttribute(Globals.EXCEPTION_ATTR, t);
@@ -351,6 +353,7 @@ public class FormAuthenticator
         try {
             disp.forward(request.getRequest(), response);
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             String msg = sm.getString("formAuthenticator.forwardErrorFail");
             log.warn(msg, t);
             request.setAttribute(Globals.EXCEPTION_ATTR, t);
index 2fddb77..2330c81 100644 (file)
@@ -34,6 +34,7 @@ import org.apache.catalina.util.ServerInfo;
 import org.apache.catalina.util.URLEncoder;
 import org.apache.coyote.ActionCode;
 import org.apache.coyote.Adapter;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.buf.B2CConverter;
@@ -233,6 +234,7 @@ public class CoyoteAdapter implements Adapter {
             }
             return (!error);
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             if (!(t instanceof IOException)) {
                 log.error(sm.getString("coyoteAdapter.service"), t);
             }
@@ -306,6 +308,7 @@ public class CoyoteAdapter implements Adapter {
             success = false;
             // Ignore
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             success = false;
             log.error(sm.getString("coyoteAdapter.service"), t);
         } finally {
@@ -406,6 +409,7 @@ public class CoyoteAdapter implements Adapter {
         } catch (IOException e) {
             // Ignore
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log.error(sm.getString("coyoteAdapter.service"), t);
         } finally {
             req.getRequestProcessor().setWorkerThreadName(null);
index 0b65980..7e222b4 100644 (file)
@@ -75,6 +75,7 @@ import org.apache.catalina.util.Enumerator;
 import org.apache.catalina.util.ParameterMap;
 import org.apache.catalina.util.StringParser;
 import org.apache.coyote.ActionCode;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.tomcat.util.buf.B2CConverter;
 import org.apache.tomcat.util.buf.ByteChunk;
 import org.apache.tomcat.util.buf.MessageBytes;
@@ -1449,9 +1450,10 @@ public class Request
             try {
                 listener.attributeRemoved(event);
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 context.getLogger().error(sm.getString("coyoteRequest.attributeEvent"), t);
                 // Error valve will pick this exception up and display it to user
-                attributes.put( Globals.EXCEPTION_ATTR, t );
+                attributes.put(Globals.EXCEPTION_ATTR, t);
             }
         }
     }
@@ -1535,6 +1537,7 @@ public class Request
                     listener.attributeAdded(event);
                 }
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 context.getLogger().error(sm.getString("coyoteRequest.attributeEvent"), t);
                 // Error valve will pick this exception up and display it to user
                 attributes.put( Globals.EXCEPTION_ATTR, t );
index 7f2751f..603c2d6 100644 (file)
@@ -72,6 +72,7 @@ import org.apache.catalina.util.Enumerator;
 import org.apache.catalina.util.RequestUtil;
 import org.apache.catalina.util.ResourceSet;
 import org.apache.catalina.util.ServerInfo;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.naming.resources.DirContextURLStreamHandler;
 import org.apache.naming.resources.Resource;
 import org.apache.tomcat.util.buf.CharChunk;
@@ -281,6 +282,7 @@ public class ApplicationContext
                 mapuri = mapuri.substring(0, slash);
             }
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             return (null);
         }
 
@@ -769,6 +771,7 @@ public class ApplicationContext
                 context.fireContainerEvent("afterContextAttributeRemoved",
                                            listener);
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 context.fireContainerEvent("afterContextAttributeRemoved",
                                            listener);
                 // FIXME - should we do anything besides log these?
@@ -845,6 +848,7 @@ public class ApplicationContext
                                                listener);
                 }
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 if (replaced)
                     context.fireContainerEvent("afterContextAttributeReplaced",
                                                listener);
index 8cb5c85..eec97d4 100644 (file)
@@ -47,6 +47,7 @@ import javax.servlet.descriptor.JspConfigDescriptor;
 
 import org.apache.catalina.Globals;
 import org.apache.catalina.security.SecurityUtil;
+import org.apache.jasper.util.ExceptionUtils;
 
 
 /**
@@ -238,6 +239,7 @@ public final class ApplicationContextFacade
                 return (Servlet) invokeMethod(context, "getServlet", 
                                               new Object[]{name});
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 if (t instanceof ServletException) {
                     throw (ServletException) t;
                 }
@@ -445,6 +447,7 @@ public final class ApplicationContextFacade
                 return (T) invokeMethod(context, "createFilter", 
                                               new Object[]{c});
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 if (t instanceof ServletException) {
                     throw (ServletException) t;
                 }
@@ -507,6 +510,7 @@ public final class ApplicationContextFacade
                 return (T) invokeMethod(context, "createServlet", 
                                               new Object[]{c});
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 if (t instanceof ServletException) {
                     throw (ServletException) t;
                 }
@@ -622,6 +626,7 @@ public final class ApplicationContextFacade
                 return (T) invokeMethod(context, "createListener", 
                                               new Object[]{c});
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 if (t instanceof ServletException) {
                     throw (ServletException) t;
                 }
@@ -771,9 +776,10 @@ public final class ApplicationContextFacade
             Method method = context.getClass().getMethod(methodName, clazz);
             return executeMethod(method,context,params);
         } catch (Exception ex){
-            try{
+            try {
                 handleException(ex);
-            }catch (Throwable t){
+            } catch (Throwable t){
+                ExceptionUtils.handleThrowable(t);
                 throw new RuntimeException(t.getMessage());
             }
             return null;
index 42678d5..d72423e 100644 (file)
@@ -47,6 +47,7 @@ import org.apache.catalina.connector.RequestFacade;
 import org.apache.catalina.connector.Response;
 import org.apache.catalina.connector.ResponseFacade;
 import org.apache.catalina.util.InstanceSupport;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.res.StringManager;
@@ -647,6 +648,7 @@ final class ApplicationDispatcher
                              wrapper.getName()), StandardWrapper.getRootCause(e));
             servletException = e;
         } catch (Throwable e) {
+            ExceptionUtils.handleThrowable(e);
             wrapper.getLogger().error(sm.getString("applicationDispatcher.allocateException",
                              wrapper.getName()), e);
             servletException = new ServletException
@@ -721,6 +723,7 @@ final class ApplicationDispatcher
             if (filterChain != null)
                 filterChain.release();
         } catch (Throwable e) {
+            ExceptionUtils.handleThrowable(e);
             wrapper.getLogger().error(sm.getString("standardWrapper.releaseFilters",
                              wrapper.getName()), e);
             // FIXME: Exception handling needs to be similar to what is in the StandardWrapperValue
@@ -736,6 +739,7 @@ final class ApplicationDispatcher
                              wrapper.getName()), e);
             servletException = e;
         } catch (Throwable e) {
+            ExceptionUtils.handleThrowable(e);
             wrapper.getLogger().error(sm.getString("applicationDispatcher.deallocateException",
                              wrapper.getName()), e);
             servletException = new ServletException
index 81b3fc7..0ec2e9d 100644 (file)
@@ -40,6 +40,7 @@ import org.apache.catalina.comet.CometFilterChain;
 import org.apache.catalina.comet.CometProcessor;
 import org.apache.catalina.security.SecurityUtil;
 import org.apache.catalina.util.InstanceSupport;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.tomcat.util.res.StringManager;
 
 /**
@@ -259,6 +260,7 @@ final class ApplicationFilterChain implements FilterChain, CometFilterChain {
                                               filter, request, response, e);
                 throw e;
             } catch (Throwable e) {
+                ExceptionUtils.handleThrowable(e);
                 if (filter != null)
                     support.fireInstanceEvent(InstanceEvent.AFTER_FILTER_EVENT,
                                               filter, request, response, e);
@@ -319,6 +321,7 @@ final class ApplicationFilterChain implements FilterChain, CometFilterChain {
                                       servlet, request, response, e);
             throw e;
         } catch (Throwable e) {
+            ExceptionUtils.handleThrowable(e);
             support.fireInstanceEvent(InstanceEvent.AFTER_SERVICE_EVENT,
                                       servlet, request, response, e);
             throw new ServletException
@@ -448,6 +451,7 @@ final class ApplicationFilterChain implements FilterChain, CometFilterChain {
                             */
                 throw e;
             } catch (Throwable e) {
+                ExceptionUtils.handleThrowable(e);
                 /*if (filter != null)
                     support.fireInstanceEvent(InstanceEvent.AFTER_FILTER_EVENT,
                             filter, event, e);*/
@@ -499,6 +503,7 @@ final class ApplicationFilterChain implements FilterChain, CometFilterChain {
                     */
             throw e;
         } catch (Throwable e) {
+            ExceptionUtils.handleThrowable(e);
             /*
             support.fireInstanceEvent(InstanceEvent.AFTER_SERVICE_EVENT,
                     servlet, request, response, e);
index 9bea76a..fd0330a 100644 (file)
@@ -104,6 +104,7 @@ public class AprLifecycleListener
                     try {
                         initializeSSL();
                     } catch (Throwable t) {
+                        ExceptionUtils.handleThrowable(t);
                         log.info(sm.getString("aprListener.sslInit"));
                     }
                 }
@@ -116,6 +117,7 @@ public class AprLifecycleListener
                 try {
                     terminateAPR();
                 } catch (Throwable t) {
+                    ExceptionUtils.handleThrowable(t);
                     log.info(sm.getString("aprListener.aprDestroy"));
                 }
             }
@@ -164,6 +166,7 @@ public class AprLifecycleListener
             patch = clazz.getField("TCN_PATCH_VERSION").getInt(null);
             apver = major * 1000 + minor * 100 + patch;
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log.info(sm.getString("aprListener.aprInit",
                     System.getProperty("java.library.path")));
             return;
index 404bc9b..289e6ac 100644 (file)
@@ -51,6 +51,7 @@ import org.apache.catalina.connector.Response;
 import org.apache.catalina.mbeans.MBeanUtils;
 import org.apache.catalina.util.LifecycleBase;
 import org.apache.catalina.util.LifecycleMBeanBase;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.naming.resources.ProxyDirContext;
@@ -1382,6 +1383,7 @@ public abstract class ContainerBase extends LifecycleMBeanBase
                 }
                 container.backgroundProcess();
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 log.error("Exception invoking periodic operation: ", t);
             } finally {
                 Thread.currentThread().setContextClassLoader(cl);
index a7f4fa2..04d3706 100644 (file)
@@ -47,6 +47,7 @@ import javax.xml.ws.WebServiceRef;
 import org.apache.catalina.ContainerServlet;
 import org.apache.catalina.Globals;
 import org.apache.catalina.security.SecurityUtil;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.tomcat.InstanceManager;
 import org.apache.tomcat.util.res.StringManager;
 
@@ -409,7 +410,7 @@ public class DefaultInstanceManager implements InstanceManager {
                 return clazz;
             }
         } catch (Throwable t) {
-            //ignore
+            ExceptionUtils.handleThrowable(t);
         }
         return classLoader.loadClass(className);
     }
index dcb31ee..552c7d0 100644 (file)
@@ -21,6 +21,7 @@ package org.apache.catalina.core;
 import org.apache.catalina.Lifecycle;
 import org.apache.catalina.LifecycleEvent;
 import org.apache.catalina.LifecycleListener;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.res.StringManager;
@@ -64,6 +65,7 @@ public class JasperListener
                               true,
                               this.getClass().getClassLoader());
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 // Should not occur, obviously
                 log.warn("Couldn't initialize Jasper", t);
             }
index 8c2a15a..970ca7d 100644 (file)
@@ -96,6 +96,7 @@ import org.apache.catalina.util.ExtensionValidator;
 import org.apache.catalina.util.LifecycleBase;
 import org.apache.catalina.util.RequestUtil;
 import org.apache.catalina.util.URLEncoder;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.naming.ContextBindings;
@@ -1203,6 +1204,7 @@ public class StandardContext extends ContainerBase
                 Class<?> clazz = Class.forName(charsetMapperClass);
                 this.charsetMapper = (CharsetMapper) clazz.newInstance();
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 this.charsetMapper = new CharsetMapper();
             }
         }
@@ -2944,6 +2946,7 @@ public class StandardContext extends ContainerBase
             try {
                 wrapper = (Wrapper) wrapperClass.newInstance();
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 log.error("createWrapper", t);
                 return (null);
             }
@@ -2959,6 +2962,7 @@ public class StandardContext extends ContainerBase
                       (InstanceListener) clazz.newInstance();
                     wrapper.addInstanceListener(listener);
                 } catch (Throwable t) {
+                    ExceptionUtils.handleThrowable(t);
                     log.error("createWrapper", t);
                     return (null);
                 }
@@ -2973,6 +2977,7 @@ public class StandardContext extends ContainerBase
                         (LifecycleListener) clazz.newInstance();
                     wrapper.addLifecycleListener(listener);
                 } catch (Throwable t) {
+                    ExceptionUtils.handleThrowable(t);
                     log.error("createWrapper", t);
                     return (null);
                 }
@@ -2987,6 +2992,7 @@ public class StandardContext extends ContainerBase
                       (ContainerListener) clazz.newInstance();
                     wrapper.addContainerListener(listener);
                 } catch (Throwable t) {
+                    ExceptionUtils.handleThrowable(t);
                     log.error("createWrapper", t);
                     return (null);
                 }
@@ -4194,6 +4200,7 @@ public class StandardContext extends ContainerBase
                         new ApplicationFilterConfig(this, filterDefs.get(name));
                     filterConfigs.put(name, filterConfig);
                 } catch (Throwable t) {
+                    ExceptionUtils.handleThrowable(t);
                     getLogger().error
                         (sm.getString("standardContext.filterStart", name), t);
                     ok = false;
@@ -4267,6 +4274,7 @@ public class StandardContext extends ContainerBase
             try {
                 results[i] = instanceManager.newInstance(listeners[i]);
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 getLogger().error
                     (sm.getString("standardContext.applicationListener",
                                   listeners[i]), t);
@@ -4323,6 +4331,7 @@ public class StandardContext extends ContainerBase
                 listener.contextInitialized(event);
                 fireContainerEvent("afterContextInitialized", listener);
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 fireContainerEvent("afterContextInitialized", listener);
                 getLogger().error
                     (sm.getString("standardContext.listenerStart",
@@ -4362,6 +4371,7 @@ public class StandardContext extends ContainerBase
                         listener.contextDestroyed(event);
                         fireContainerEvent("afterContextDestroyed", listener);
                     } catch (Throwable t) {
+                        ExceptionUtils.handleThrowable(t);
                         fireContainerEvent("afterContextDestroyed", listener);
                         getLogger().error
                             (sm.getString("standardContext.listenerStop",
@@ -4372,6 +4382,7 @@ public class StandardContext extends ContainerBase
                 try {
                     getInstanceManager().destroyInstance(listeners[j]);
                 } catch (Throwable t) {
+                    ExceptionUtils.handleThrowable(t);
                     getLogger().error
                        (sm.getString("standardContext.listenerStop",
                             listeners[j].getClass().getName()), t);
@@ -4390,6 +4401,7 @@ public class StandardContext extends ContainerBase
                 try {
                     getInstanceManager().destroyInstance(listeners[j]);
                 } catch (Throwable t) {
+                    ExceptionUtils.handleThrowable(t);
                     getLogger().error
                         (sm.getString("standardContext.listenerStop",
                             listeners[j].getClass().getName()), t);
@@ -4448,6 +4460,7 @@ public class StandardContext extends ContainerBase
             }
             this.resources = proxyDirContext;
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log.error(sm.getString("standardContext.resourcesStart"), t);
             ok = false;
         }
@@ -4485,6 +4498,7 @@ public class StandardContext extends ContainerBase
                 }
             }
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log.error(sm.getString("standardContext.resourcesStop"), t);
             ok = false;
         }
index 22d076a..1b8bf55 100644 (file)
@@ -34,6 +34,7 @@ import org.apache.catalina.comet.CometEvent;
 import org.apache.catalina.connector.Request;
 import org.apache.catalina.connector.Response;
 import org.apache.catalina.valves.ValveBase;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.tomcat.util.buf.MessageBytes;
 import org.apache.tomcat.util.res.StringManager;
 
@@ -187,6 +188,7 @@ final class StandardContextValve
                         listener.requestInitialized(event);
                     }
                 } catch (Throwable t) {
+                    ExceptionUtils.handleThrowable(t);
                     container.getLogger().error(sm.getString("standardContext.requestListener.requestInit",
                                      instances[i].getClass().getName()), t);
                     ServletRequest sreq = request.getRequest();
@@ -216,6 +218,7 @@ final class StandardContextValve
                         listener.requestDestroyed(event);
                     }
                 } catch (Throwable t) {
+                    ExceptionUtils.handleThrowable(t);
                     container.getLogger().error(sm.getString("standardContext.requestListener.requestDestroy",
                                      instances[j].getClass().getName()), t);
                     ServletRequest sreq = request.getRequest();
index e5af749..5287243 100644 (file)
@@ -35,6 +35,7 @@ import org.apache.catalina.loader.WebappClassLoader;
 import org.apache.catalina.mbeans.MBeanUtils;
 import org.apache.catalina.util.LifecycleBase;
 import org.apache.catalina.valves.ValveBase;
+import org.apache.jasper.util.ExceptionUtils;
 
 
 /**
@@ -763,6 +764,7 @@ public class StandardHost extends ContainerBase implements Host {
                     getPipeline().addValve(valve);
                 }
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 log.error(sm.getString
                     ("standardHost.invalidErrorReportValveClass", 
                      errorReportValveClass), t);
index 76ac93c..eaa8884 100644 (file)
@@ -38,6 +38,7 @@ import org.apache.catalina.connector.Request;
 import org.apache.catalina.connector.Response;
 import org.apache.catalina.deploy.ErrorPage;
 import org.apache.catalina.valves.ValveBase;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.res.StringManager;
@@ -471,7 +472,7 @@ final class StandardHostValve
             return (true);
 
         } catch (Throwable t) {
-
+            ExceptionUtils.handleThrowable(t);
             // Report our failure to process this custom page
             container.getLogger().error("Exception Processing " + errorPage, t);
             return (false);
index 676dc82..1c92e29 100644 (file)
@@ -44,6 +44,7 @@ import org.apache.catalina.startup.Catalina;
 import org.apache.catalina.util.LifecycleBase;
 import org.apache.catalina.util.LifecycleMBeanBase;
 import org.apache.catalina.util.ServerInfo;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.buf.StringCache;
@@ -600,6 +601,7 @@ public final class StandardServer extends LifecycleMBeanBase
            } else
                log.error("StoreConfig mbean not registered" + sname);
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log.error(t);
         }
 
@@ -629,6 +631,7 @@ public final class StandardServer extends LifecycleMBeanBase
            } else
                log.error("StoreConfig mbean not registered" + sname);
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log.error(t);
         }
  
index 3c7daea..07731a6 100644 (file)
@@ -823,6 +823,7 @@ public class StandardWrapper extends ContainerBase
                         } catch (ServletException e) {
                             throw e;
                         } catch (Throwable e) {
+                            ExceptionUtils.handleThrowable(e);
                             throw new ServletException
                                 (sm.getString("standardWrapper.allocate"), e);
                         }
@@ -857,6 +858,7 @@ public class StandardWrapper extends ContainerBase
                     } catch (ServletException e) {
                         throw e;
                     } catch (Throwable e) {
+                        ExceptionUtils.handleThrowable(e);
                         throw new ServletException
                             (sm.getString("standardWrapper.allocate"), e);
                     }
@@ -1083,6 +1085,7 @@ public class StandardWrapper extends ContainerBase
                 throw new ServletException
                     (sm.getString("standardWrapper.notServlet", actualClass), e);
             } catch (Throwable e) {
+                ExceptionUtils.handleThrowable(e);
                 unavailable(null);
 
                 // Added extra log statement for Bugzilla 36630:
@@ -1198,6 +1201,7 @@ public class StandardWrapper extends ContainerBase
             // said so, so do not call unavailable(null).
             throw f;
         } catch (Throwable f) {
+            ExceptionUtils.handleThrowable(f);
             getServletContext().log("StandardWrapper.Throwable", f );
             instanceSupport.fireInstanceEvent(InstanceEvent.AFTER_INIT_EVENT,
                                               servlet, f);
@@ -1371,6 +1375,7 @@ public class StandardWrapper extends ContainerBase
             }
 
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             instanceSupport.fireInstanceEvent
               (InstanceEvent.AFTER_DESTROY_EVENT, instance, t);
             instance = null;
@@ -1418,6 +1423,7 @@ public class StandardWrapper extends ContainerBase
                     }
                 }
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 instancePool = null;
                 nInstances = 0;
                 unloading = false;
@@ -1613,6 +1619,7 @@ public class StandardWrapper extends ContainerBase
                 this.getClass().getClassLoader().loadClass(classname);
             return (ContainerServlet.class.isAssignableFrom(clazz));
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             return (false);
         }
 
index f4dc07c..e4d1062 100644 (file)
@@ -36,6 +36,7 @@ import org.apache.catalina.connector.ClientAbortException;
 import org.apache.catalina.connector.Request;
 import org.apache.catalina.connector.Response;
 import org.apache.catalina.valves.ValveBase;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.tomcat.util.buf.MessageBytes;
 import org.apache.tomcat.util.log.SystemLogHandler;
 import org.apache.tomcat.util.res.StringManager;
@@ -154,6 +155,7 @@ final class StandardWrapperValve
             throwable = e;
             exception(request, response, e);
         } catch (Throwable e) {
+            ExceptionUtils.handleThrowable(e);
             container.getLogger().error(sm.getString("standardWrapper.allocateException",
                              wrapper.getName()), e);
             throwable = e;
@@ -179,6 +181,7 @@ final class StandardWrapperValve
             throwable = e;
             exception(request, response, e);
         } catch (Throwable e) {
+            ExceptionUtils.handleThrowable(e);
             container.getLogger().error(sm.getString("standardWrapper.acknowledgeException",
                              wrapper.getName()), e);
             throwable = e;
@@ -291,6 +294,7 @@ final class StandardWrapperValve
             throwable = e;
             exception(request, response, e);
         } catch (Throwable e) {
+            ExceptionUtils.handleThrowable(e);
             request.removeAttribute(Globals.JSP_FILE_ATTR);
             container.getLogger().error(sm.getString(
                     "standardWrapper.serviceException", wrapper.getName(),
@@ -316,6 +320,7 @@ final class StandardWrapperValve
                 wrapper.deallocate(servlet);
             }
         } catch (Throwable e) {
+            ExceptionUtils.handleThrowable(e);
             container.getLogger().error(sm.getString("standardWrapper.deallocateException",
                              wrapper.getName()), e);
             if (throwable == null) {
@@ -332,6 +337,7 @@ final class StandardWrapperValve
                 wrapper.unload();
             }
         } catch (Throwable e) {
+            ExceptionUtils.handleThrowable(e);
             container.getLogger().error(sm.getString("standardWrapper.unloadException",
                              wrapper.getName()), e);
             if (throwable == null) {
@@ -391,6 +397,7 @@ final class StandardWrapperValve
             throwable = e;
             exception(request, response, e);
         } catch (Throwable e) {
+            ExceptionUtils.handleThrowable(e);
             container.getLogger().error(sm.getString("standardWrapper.allocateException",
                              wrapper.getName()), e);
             throwable = e;
@@ -466,6 +473,7 @@ final class StandardWrapperValve
             throwable = e;
             exception(request, response, e);
         } catch (Throwable e) {
+            ExceptionUtils.handleThrowable(e);
             request.removeAttribute(Globals.JSP_FILE_ATTR);
             container.getLogger().error(sm.getString(
                     "standardWrapper.serviceException", wrapper.getName(),
@@ -485,6 +493,7 @@ final class StandardWrapperValve
                 wrapper.deallocate(servlet);
             }
         } catch (Throwable e) {
+            ExceptionUtils.handleThrowable(e);
             container.getLogger().error(sm.getString("standardWrapper.deallocateException",
                              wrapper.getName()), e);
             if (throwable == null) {
@@ -501,6 +510,7 @@ final class StandardWrapperValve
                 wrapper.unload();
             }
         } catch (Throwable e) {
+            ExceptionUtils.handleThrowable(e);
             container.getLogger().error(sm.getString("standardWrapper.unloadException",
                              wrapper.getName()), e);
             if (throwable == null) {