tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1001904 - in /tomcat/trunk/java/org/apache/catalina: authenticator/ connector/ core/
Date Mon, 27 Sep 2010 20:52:50 GMT
Author: markt
Date: Mon Sep 27 20:52:49 2010
New Revision: 1001904

URL: http://svn.apache.org/viewvc?rev=1001904&view=rev
Log:
Partial fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=48644
Some Throwables must always be re-thrown

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

Modified: tomcat/trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java?rev=1001904&r1=1001903&r2=1001904&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java (original)
+++ tomcat/trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java Mon Sep 27
20:52:49 2010
@@ -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);

Modified: tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java?rev=1001904&r1=1001903&r2=1001904&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java Mon Sep 27 20:52:49
2010
@@ -34,6 +34,7 @@ import org.apache.catalina.util.ServerIn
 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 Ad
             }
             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 Ad
             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 Ad
         } catch (IOException e) {
             // Ignore
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log.error(sm.getString("coyoteAdapter.service"), t);
         } finally {
             req.getRequestProcessor().setWorkerThreadName(null);

Modified: tomcat/trunk/java/org/apache/catalina/connector/Request.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Request.java?rev=1001904&r1=1001903&r2=1001904&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/Request.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/Request.java Mon Sep 27 20:52:49 2010
@@ -75,6 +75,7 @@ import org.apache.catalina.util.Enumerat
 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 );

Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java?rev=1001904&r1=1001903&r2=1001904&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java Mon Sep 27 20:52:49
2010
@@ -72,6 +72,7 @@ import org.apache.catalina.util.Enumerat
 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);

Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationContextFacade.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationContextFacade.java?rev=1001904&r1=1001903&r2=1001904&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/ApplicationContextFacade.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/ApplicationContextFacade.java Mon Sep 27 20:52:49
2010
@@ -47,6 +47,7 @@ import javax.servlet.descriptor.JspConfi
 
 import org.apache.catalina.Globals;
 import org.apache.catalina.security.SecurityUtil;
+import org.apache.jasper.util.ExceptionUtils;
 
 
 /**
@@ -238,6 +239,7 @@ public final class ApplicationContextFac
                 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 ApplicationContextFac
                 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 ApplicationContextFac
                 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 ApplicationContextFac
                 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 ApplicationContextFac
             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;

Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java?rev=1001904&r1=1001903&r2=1001904&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java Mon Sep 27 20:52:49
2010
@@ -47,6 +47,7 @@ import org.apache.catalina.connector.Req
 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

Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterChain.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterChain.java?rev=1001904&r1=1001903&r2=1001904&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterChain.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterChain.java Mon Sep 27 20:52:49
2010
@@ -40,6 +40,7 @@ import org.apache.catalina.comet.CometFi
 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 imple
                                               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 imple
                                       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 imple
                             */
                 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 imple
                     */
             throw e;
         } catch (Throwable e) {
+            ExceptionUtils.handleThrowable(e);
             /*
             support.fireInstanceEvent(InstanceEvent.AFTER_SERVICE_EVENT,
                     servlet, request, response, e);

Modified: tomcat/trunk/java/org/apache/catalina/core/AprLifecycleListener.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/AprLifecycleListener.java?rev=1001904&r1=1001903&r2=1001904&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/AprLifecycleListener.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/AprLifecycleListener.java Mon Sep 27 20:52:49
2010
@@ -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;

Modified: tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java?rev=1001904&r1=1001903&r2=1001904&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java Mon Sep 27 20:52:49 2010
@@ -51,6 +51,7 @@ import org.apache.catalina.connector.Res
 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 exte
                 }
                 container.backgroundProcess();
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 log.error("Exception invoking periodic operation: ", t);
             } finally {
                 Thread.currentThread().setContextClassLoader(cl);

Modified: tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java?rev=1001904&r1=1001903&r2=1001904&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java Mon Sep 27 20:52:49
2010
@@ -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 impl
                 return clazz;
             }
         } catch (Throwable t) {
-            //ignore
+            ExceptionUtils.handleThrowable(t);
         }
         return classLoader.loadClass(className);
     }

Modified: tomcat/trunk/java/org/apache/catalina/core/JasperListener.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/JasperListener.java?rev=1001904&r1=1001903&r2=1001904&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/JasperListener.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/JasperListener.java Mon Sep 27 20:52:49 2010
@@ -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);
             }

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardContext.java?rev=1001904&r1=1001903&r2=1001904&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardContext.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardContext.java Mon Sep 27 20:52:49 2010
@@ -96,6 +96,7 @@ import org.apache.catalina.util.Extensio
 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 Con
                 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 Con
             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 Con
                       (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 Con
                         (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 Con
                       (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 Con
                         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 Con
             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 Con
                 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 Con
                         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 Con
                 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 Con
                 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 Con
             }
             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 Con
                 }
             }
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log.error(sm.getString("standardContext.resourcesStop"), t);
             ok = false;
         }

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardContextValve.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardContextValve.java?rev=1001904&r1=1001903&r2=1001904&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardContextValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardContextValve.java Mon Sep 27 20:52:49
2010
@@ -34,6 +34,7 @@ import org.apache.catalina.comet.CometEv
 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();

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardHost.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardHost.java?rev=1001904&r1=1001903&r2=1001904&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardHost.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardHost.java Mon Sep 27 20:52:49 2010
@@ -35,6 +35,7 @@ import org.apache.catalina.loader.Webapp
 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 Contai
                     getPipeline().addValve(valve);
                 }
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 log.error(sm.getString
                     ("standardHost.invalidErrorReportValveClass", 
                      errorReportValveClass), t);

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java?rev=1001904&r1=1001903&r2=1001904&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java Mon Sep 27 20:52:49
2010
@@ -38,6 +38,7 @@ import org.apache.catalina.connector.Req
 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);

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardServer.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardServer.java?rev=1001904&r1=1001903&r2=1001904&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardServer.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardServer.java Mon Sep 27 20:52:49 2010
@@ -44,6 +44,7 @@ import org.apache.catalina.startup.Catal
 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 extend
            } 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 extend
            } else
                log.error("StoreConfig mbean not registered" + sname);
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log.error(t);
         }
  

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardWrapper.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardWrapper.java?rev=1001904&r1=1001903&r2=1001904&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardWrapper.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardWrapper.java Mon Sep 27 20:52:49 2010
@@ -823,6 +823,7 @@ public class StandardWrapper extends Con
                         } 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 Con
                     } 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 Con
                 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 Con
             // 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 Con
             }
 
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             instanceSupport.fireInstanceEvent
               (InstanceEvent.AFTER_DESTROY_EVENT, instance, t);
             instance = null;
@@ -1418,6 +1423,7 @@ public class StandardWrapper extends Con
                     }
                 }
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 instancePool = null;
                 nInstances = 0;
                 unloading = false;
@@ -1613,6 +1619,7 @@ public class StandardWrapper extends Con
                 this.getClass().getClassLoader().loadClass(classname);
             return (ContainerServlet.class.isAssignableFrom(clazz));
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             return (false);
         }
 

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardWrapperValve.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardWrapperValve.java?rev=1001904&r1=1001903&r2=1001904&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardWrapperValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardWrapperValve.java Mon Sep 27 20:52:49
2010
@@ -36,6 +36,7 @@ import org.apache.catalina.connector.Cli
 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) {



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message