tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1001923 - in /tomcat/trunk/java/org/apache/catalina: mbeans/ realm/ session/ startup/ tribes/membership/ tribes/transport/nio/ util/ valves/
Date Mon, 27 Sep 2010 22:01:46 GMT
Author: markt
Date: Mon Sep 27 22:01:45 2010
New Revision: 1001923

URL: http://svn.apache.org/viewvc?rev=1001923&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/mbeans/MBeanUtils.java
    tomcat/trunk/java/org/apache/catalina/mbeans/ServerLifecycleListener.java
    tomcat/trunk/java/org/apache/catalina/realm/JAASRealm.java
    tomcat/trunk/java/org/apache/catalina/realm/JDBCRealm.java
    tomcat/trunk/java/org/apache/catalina/realm/UserDatabaseRealm.java
    tomcat/trunk/java/org/apache/catalina/session/StandardManager.java
    tomcat/trunk/java/org/apache/catalina/session/StandardSession.java
    tomcat/trunk/java/org/apache/catalina/startup/Bootstrap.java
    tomcat/trunk/java/org/apache/catalina/startup/Catalina.java
    tomcat/trunk/java/org/apache/catalina/startup/CatalinaProperties.java
    tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
    tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java
    tomcat/trunk/java/org/apache/catalina/startup/TldConfig.java
    tomcat/trunk/java/org/apache/catalina/startup/Tool.java
    tomcat/trunk/java/org/apache/catalina/tribes/membership/McastServiceImpl.java
    tomcat/trunk/java/org/apache/catalina/tribes/transport/nio/NioReceiver.java
    tomcat/trunk/java/org/apache/catalina/util/CharsetMapper.java
    tomcat/trunk/java/org/apache/catalina/util/ServerInfo.java
    tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java
    tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java
    tomcat/trunk/java/org/apache/catalina/valves/ExtendedAccessLogValve.java
    tomcat/trunk/java/org/apache/catalina/valves/JDBCAccessLogValve.java

Modified: tomcat/trunk/java/org/apache/catalina/mbeans/MBeanUtils.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/mbeans/MBeanUtils.java?rev=1001923&r1=1001922&r2=1001923&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/mbeans/MBeanUtils.java (original)
+++ tomcat/trunk/java/org/apache/catalina/mbeans/MBeanUtils.java Mon Sep 27 22:01:45 2010
@@ -1072,6 +1072,7 @@ public class MBeanUtils {
             try {
                 mserver = Registry.getRegistry(null, null).getMBeanServer();
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 t.printStackTrace(System.out);
                 System.exit(1);
             }

Modified: tomcat/trunk/java/org/apache/catalina/mbeans/ServerLifecycleListener.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/mbeans/ServerLifecycleListener.java?rev=1001923&r1=1001922&r2=1001923&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/mbeans/ServerLifecycleListener.java (original)
+++ tomcat/trunk/java/org/apache/catalina/mbeans/ServerLifecycleListener.java Mon Sep 27 22:01:45
2010
@@ -48,6 +48,7 @@ import org.apache.catalina.deploy.Contex
 import org.apache.catalina.deploy.ContextResource;
 import org.apache.catalina.deploy.ContextResourceLink;
 import org.apache.catalina.deploy.NamingResources;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 
@@ -150,9 +151,8 @@ public class ServerLifecycleListener
                 log.error("createMBeans: MBeanException", e);
 
             } catch (Throwable t) {
-
+                ExceptionUtils.handleThrowable(t);
                 log.error("createMBeans: Throwable", t);
-
             }
 
              /*
@@ -180,9 +180,8 @@ public class ServerLifecycleListener
                 log.error("destroyMBeans: MBeanException", e);
 
             } catch (Throwable t) {
-
+                ExceptionUtils.handleThrowable(t);
                 log.error("destroyMBeans: Throwable", t);
-
             }
             // FIXME: RMI adaptor should be stopped; however, this is
             // undocumented in MX4J, and reports exist in the MX4J bug DB that
@@ -925,6 +924,7 @@ public class ServerLifecycleListener
                 e = t;
             log.error("processContainerAddChild: MBeanException", e);
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log.error("processContainerAddChild: Throwable", t);
         }
 
@@ -1060,6 +1060,7 @@ public class ServerLifecycleListener
                 e = t;
             log.error("processContainerRemoveChild: MBeanException", e);
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log.error("processContainerRemoveChild: Throwable", t);
         }
 

Modified: tomcat/trunk/java/org/apache/catalina/realm/JAASRealm.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/realm/JAASRealm.java?rev=1001923&r1=1001922&r2=1001923&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/realm/JAASRealm.java (original)
+++ tomcat/trunk/java/org/apache/catalina/realm/JAASRealm.java Mon Sep 27 22:01:45 2010
@@ -36,6 +36,7 @@ import org.apache.catalina.Container;
 import org.apache.catalina.LifecycleException;
 import org.apache.catalina.authenticator.Constants;
 import org.apache.catalina.util.LifecycleBase;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 
@@ -390,6 +391,7 @@ public class JAASRealm
         try {
             loginContext = new LoginContext(appName, callbackHandler);
         } catch (Throwable e) {
+            ExceptionUtils.handleThrowable(e);
             log.error(sm.getString("jaasRealm.unexpectedError"), e);
             return (null);
         } finally {
@@ -427,6 +429,7 @@ public class JAASRealm
             log.warn(sm.getString("jaasRealm.loginException", username), e);
             return (null);
         } catch (Throwable e) {
+            ExceptionUtils.handleThrowable(e);
             log.error(sm.getString("jaasRealm.unexpectedError"), e);
             return (null);
         }

Modified: tomcat/trunk/java/org/apache/catalina/realm/JDBCRealm.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/realm/JDBCRealm.java?rev=1001923&r1=1001922&r2=1001923&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/realm/JDBCRealm.java (original)
+++ tomcat/trunk/java/org/apache/catalina/realm/JDBCRealm.java Mon Sep 27 22:01:45 2010
@@ -698,6 +698,7 @@ public class JDBCRealm
                 Class<?> clazz = Class.forName(driverName);
                 driver = (Driver) clazz.newInstance();
             } catch (Throwable e) {
+                ExceptionUtils.handleThrowable(e);
                 throw new SQLException(e.getMessage());
             }
         }

Modified: tomcat/trunk/java/org/apache/catalina/realm/UserDatabaseRealm.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/realm/UserDatabaseRealm.java?rev=1001923&r1=1001922&r2=1001923&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/realm/UserDatabaseRealm.java (original)
+++ tomcat/trunk/java/org/apache/catalina/realm/UserDatabaseRealm.java Mon Sep 27 22:01:45
2010
@@ -33,6 +33,7 @@ import org.apache.catalina.User;
 import org.apache.catalina.UserDatabase;
 import org.apache.catalina.core.StandardServer;
 import org.apache.catalina.util.LifecycleBase;
+import org.apache.jasper.util.ExceptionUtils;
 
 
 /**
@@ -249,6 +250,7 @@ public class UserDatabaseRealm
                 ((StandardServer)getServer()).getGlobalNamingContext();
             database = (UserDatabase) context.lookup(resourceName);
         } catch (Throwable e) {
+            ExceptionUtils.handleThrowable(e);
             containerLog.error(sm.getString("userDatabaseRealm.lookup",
                                             resourceName),
                                e);

Modified: tomcat/trunk/java/org/apache/catalina/session/StandardManager.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/StandardManager.java?rev=1001923&r1=1001922&r2=1001923&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/session/StandardManager.java (original)
+++ tomcat/trunk/java/org/apache/catalina/session/StandardManager.java Mon Sep 27 22:01:45
2010
@@ -466,6 +466,7 @@ public class StandardManager extends Man
         try {
             load();
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log.error(sm.getString("standardManager.managerLoad"), t);
         }
 
@@ -492,6 +493,7 @@ public class StandardManager extends Man
         try {
             unload();
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log.error(sm.getString("standardManager.managerUnload"), t);
         }
 

Modified: tomcat/trunk/java/org/apache/catalina/session/StandardSession.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/StandardSession.java?rev=1001923&r1=1001922&r2=1001923&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/session/StandardSession.java (original)
+++ tomcat/trunk/java/org/apache/catalina/session/StandardSession.java Mon Sep 27 22:01:45
2010
@@ -57,6 +57,7 @@ import org.apache.catalina.core.Standard
 import org.apache.catalina.realm.GenericPrincipal;
 import org.apache.catalina.security.SecurityUtil;
 import org.apache.catalina.util.Enumerator;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.tomcat.util.res.StringManager;
 
 /**
@@ -405,6 +406,7 @@ public class StandardSession
                                        "afterSessionCreated",
                                        listener);
                 } catch (Throwable t) {
+                    ExceptionUtils.handleThrowable(t);
                     try {
                         fireContainerEvent(context,
                                            "afterSessionCreated",
@@ -776,6 +778,7 @@ public class StandardSession
                                                "afterSessionDestroyed",
                                                listener);
                         } catch (Throwable t) {
+                            ExceptionUtils.handleThrowable(t);
                             try {
                                 fireContainerEvent(context,
                                                    "afterSessionDestroyed",
@@ -877,6 +880,7 @@ public class StandardSession
                     ((HttpSessionActivationListener)attribute)
                         .sessionWillPassivate(event);
                 } catch (Throwable t) {
+                    ExceptionUtils.handleThrowable(t);
                     manager.getContainer().getLogger().error
                         (sm.getString("standardSession.attributeEvent"), t);
                 }
@@ -912,6 +916,7 @@ public class StandardSession
                     ((HttpSessionActivationListener)attribute)
                         .sessionDidActivate(event);
                 } catch (Throwable t) {
+                    ExceptionUtils.handleThrowable(t);
                     manager.getContainer().getLogger().error
                         (sm.getString("standardSession.attributeEvent"), t);
                 }
@@ -1423,6 +1428,7 @@ public class StandardSession
                 ((HttpSessionBindingListener) unbound).valueUnbound
                     (new HttpSessionBindingEvent(getSession(), name));
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 manager.getContainer().getLogger().error
                     (sm.getString("standardSession.bindingEvent"), t);
             }
@@ -1467,6 +1473,7 @@ public class StandardSession
                                        listener);
                 }
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 try {
                     if (unbound != null) {
                         fireContainerEvent(context,
@@ -1764,6 +1771,7 @@ public class StandardSession
                                    "afterSessionAttributeRemoved",
                                    listener);
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 try {
                     fireContainerEvent(context,
                                        "afterSessionAttributeRemoved",

Modified: tomcat/trunk/java/org/apache/catalina/startup/Bootstrap.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/Bootstrap.java?rev=1001923&r1=1001922&r2=1001923&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/Bootstrap.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/Bootstrap.java Mon Sep 27 22:01:45 2010
@@ -33,6 +33,7 @@ import javax.management.ObjectName;
 
 import org.apache.catalina.Globals;
 import org.apache.catalina.security.SecurityClassLoad;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 
@@ -98,6 +99,7 @@ public final class Bootstrap {
             catalinaLoader = createClassLoader("server", commonLoader);
             sharedLoader = createClassLoader("shared", commonLoader);
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log.error("Class loader creation threw exception", t);
             System.exit(1);
         }
@@ -391,6 +393,7 @@ public final class Bootstrap {
             try {
                 bootstrap.init();
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 t.printStackTrace();
                 return;
             }
@@ -420,6 +423,7 @@ public final class Bootstrap {
                 log.warn("Bootstrap: command \"" + command + "\" does not exist.");
             }
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             t.printStackTrace();
         }
 

Modified: tomcat/trunk/java/org/apache/catalina/startup/Catalina.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/Catalina.java?rev=1001923&r1=1001922&r2=1001923&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/Catalina.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/Catalina.java Mon Sep 27 22:01:45 2010
@@ -36,6 +36,7 @@ import org.apache.catalina.LifecycleExce
 import org.apache.catalina.Server;
 import org.apache.catalina.core.StandardServer;
 import org.apache.catalina.security.SecurityConfig;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.juli.ClassLoaderLogManager;
 import org.apache.tomcat.util.IntrospectionUtils;
 import org.apache.tomcat.util.digester.Digester;
@@ -611,6 +612,7 @@ public class Catalina {
                 }
             }
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             // This will fail on JDK 1.2. Ignoring, as Tomcat can run
             // fine without the shutdown hook.
         }
@@ -643,6 +645,7 @@ public class Catalina {
                 }
             }
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             // This will fail on JDK 1.2. Ignoring, as Tomcat can run
             // fine without the shutdown hook.
         }
@@ -804,6 +807,7 @@ public class Catalina {
                     Catalina.this.stop();
                 }
             } catch (Throwable ex) {
+                ExceptionUtils.handleThrowable(ex);
                 log.error(sm.getString("catalina.shutdownHookFail"), ex);
             } finally {
                 // If JULI is used, shut JULI down *after* the server shuts down

Modified: tomcat/trunk/java/org/apache/catalina/startup/CatalinaProperties.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/CatalinaProperties.java?rev=1001923&r1=1001922&r2=1001923&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/CatalinaProperties.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/CatalinaProperties.java Mon Sep 27 22:01:45
2010
@@ -122,6 +122,7 @@ public class CatalinaProperties {
                 properties.load(is);
                 is.close();
             } catch (Throwable t) {
+                handleThrowable(t);
                 error = t;
             }
         }

Modified: tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java?rev=1001923&r1=1001922&r2=1001923&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java Mon Sep 27 22:01:45 2010
@@ -437,6 +437,7 @@ public class ContextConfig
                 Class<?> authenticatorClass = Class.forName(authenticatorName);
                 authenticator = (Valve) authenticatorClass.newInstance();
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 log.error(sm.getString(
                                     "contextConfig.authenticatorInstantiate",
                                     authenticatorName),

Modified: tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java?rev=1001923&r1=1001922&r2=1001923&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java Mon Sep 27 22:01:45 2010
@@ -678,6 +678,7 @@ public class HostConfig
                 }
             }
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log.error(sm.getString("hostConfig.deployDescriptor.error",
                                    file), t);
         }
@@ -964,6 +965,7 @@ public class HostConfig
                 addWatchedResources(deployedApp, null, context);
             }
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log.error(sm.getString("hostConfig.deployWar.error", file), t);
         }
         
@@ -1082,6 +1084,7 @@ public class HostConfig
             }
             addWatchedResources(deployedApp, dir.getAbsolutePath(), context);
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log.error(sm.getString("hostConfig.deployDir.error", file), t);
         }
 
@@ -1164,12 +1167,14 @@ public class HostConfig
                     try {
                         host.removeChild(context);
                     } catch (Throwable t) {
+                        ExceptionUtils.handleThrowable(t);
                         log.warn(sm.getString
                                  ("hostConfig.context.remove", app.name), t);
                     }
                     try {
                         context.destroy();
                     } catch (Throwable t) {
+                        ExceptionUtils.handleThrowable(t);
                         log.warn(sm.getString
                                  ("hostConfig.context.destroy", app.name), t);
                     }
@@ -1220,12 +1225,14 @@ public class HostConfig
                 try {
                     host.removeChild(context);
                 } catch (Throwable t) {
+                    ExceptionUtils.handleThrowable(t);
                     log.warn(sm.getString
                              ("hostConfig.context.remove", app.name), t);
                 }
                 try {
                     context.destroy();
                 } catch (Throwable t) {
+                    ExceptionUtils.handleThrowable(t);
                     log.warn(sm.getString
                              ("hostConfig.context.destroy", app.name), t);
                 }
@@ -1383,6 +1390,7 @@ public class HostConfig
             try {
                 host.removeChild(host.findChild(apps[i].name));
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 log.warn(sm.getString
                         ("hostConfig.context.remove", apps[i].name), t);
             }

Modified: tomcat/trunk/java/org/apache/catalina/startup/TldConfig.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/TldConfig.java?rev=1001923&r1=1001922&r2=1001923&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/TldConfig.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/TldConfig.java Mon Sep 27 22:01:45 2010
@@ -437,7 +437,7 @@ public final class TldConfig  implements
                             try {
                                 stream.close();
                             } catch (Throwable t) {
-                                // do nothing
+                                ExceptionUtils.handleThrowable(t);
                             }
                         }
                     }
@@ -481,7 +481,7 @@ public final class TldConfig  implements
                             try {
                                 stream.close();
                             } catch (Throwable t) {
-                                // do nothing
+                                ExceptionUtils.handleThrowable(t);
                             }
                         }
                     }
@@ -560,7 +560,7 @@ public final class TldConfig  implements
                     try {
                         resourceStream.close();
                     } catch (Throwable t) {
-                        // do nothing
+                        ExceptionUtils.handleThrowable(t);
                     }
                 }
             }

Modified: tomcat/trunk/java/org/apache/catalina/startup/Tool.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/Tool.java?rev=1001923&r1=1001922&r2=1001923&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/Tool.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/Tool.java Mon Sep 27 22:01:45 2010
@@ -24,6 +24,7 @@ import java.lang.reflect.Method;
 import java.util.ArrayList;
 
 import org.apache.catalina.Globals;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 
@@ -184,6 +185,7 @@ public final class Tool {
                  packed.toArray(new File[0]),
                  null);
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log.error("Class loader creation threw exception", t);
             System.exit(1);
         }
@@ -197,6 +199,7 @@ public final class Tool {
                 log.debug("Loading application class " + className);
             clazz = classLoader.loadClass(className);
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log.error("Exception creating instance of " + className, t);
             System.exit(1);
         }
@@ -213,6 +216,7 @@ public final class Tool {
             paramTypes[0] = params.getClass();
             method = clazz.getMethod(methodName, paramTypes);
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log.error("Exception locating main() method", t);
             System.exit(1);
         }
@@ -225,6 +229,7 @@ public final class Tool {
             paramValues[0] = params;
             method.invoke(null, paramValues);
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log.error("Exception calling main() method", t);
             System.exit(1);
         }

Modified: tomcat/trunk/java/org/apache/catalina/tribes/membership/McastServiceImpl.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/membership/McastServiceImpl.java?rev=1001923&r1=1001922&r2=1001923&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/tribes/membership/McastServiceImpl.java (original)
+++ tomcat/trunk/java/org/apache/catalina/tribes/membership/McastServiceImpl.java Mon Sep
27 22:01:45 2010
@@ -36,6 +36,7 @@ import org.apache.catalina.tribes.Messag
 import org.apache.catalina.tribes.io.ChannelData;
 import org.apache.catalina.tribes.io.XByteBuffer;
 import org.apache.catalina.tribes.util.ExecutorFactory;
+import org.apache.jasper.util.ExceptionUtils;
 
 /**
  * A <b>membership</b> implementation using simple multicast.
@@ -420,7 +421,8 @@ public class McastServiceImpl
                                 if (data[i]!=null && !member.equals(data[i].getAddress()))
{
                                     msgservice.messageReceived(data[i]);
                                 }
-                            }catch (Throwable t) {
+                            } catch (Throwable t) {
+                                ExceptionUtils.handleThrowable(t);
                                 log.error("Unable to receive broadcast message.",t);
                             }
                         }

Modified: tomcat/trunk/java/org/apache/catalina/tribes/transport/nio/NioReceiver.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/transport/nio/NioReceiver.java?rev=1001923&r1=1001922&r2=1001923&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/tribes/transport/nio/NioReceiver.java (original)
+++ tomcat/trunk/java/org/apache/catalina/tribes/transport/nio/NioReceiver.java Mon Sep 27
22:01:45 2010
@@ -37,6 +37,7 @@ import org.apache.catalina.tribes.transp
 import org.apache.catalina.tribes.transport.ReceiverBase;
 import org.apache.catalina.tribes.transport.RxTaskPool;
 import org.apache.catalina.tribes.util.StringManager;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 
@@ -318,12 +319,8 @@ public class NioReceiver extends Receive
             } catch (java.nio.channels.CancelledKeyException nx) {
                 log.warn("Replication client disconnected, error when polling key. Ignoring
client.");
             } catch (Throwable x) {
-                try {
-                    log.error("Unable to process request in NioReceiver", x);
-                }catch ( Throwable tx ) {
-                    //in case an out of memory error, will affect the logging framework as
well
-                    tx.printStackTrace();
-                }
+                ExceptionUtils.handleThrowable(x);
+                log.error("Unable to process request in NioReceiver", x);
             }
 
         }

Modified: tomcat/trunk/java/org/apache/catalina/util/CharsetMapper.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/util/CharsetMapper.java?rev=1001923&r1=1001922&r2=1001923&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/util/CharsetMapper.java (original)
+++ tomcat/trunk/java/org/apache/catalina/util/CharsetMapper.java Mon Sep 27 22:01:45 2010
@@ -22,6 +22,8 @@ import java.io.InputStream;
 import java.util.Locale;
 import java.util.Properties;
 
+import org.apache.jasper.util.ExceptionUtils;
+
 
 
 /**
@@ -75,6 +77,7 @@ public class CharsetMapper {
             map.load(stream);
             stream.close();
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             throw new IllegalArgumentException(t.toString());
         }
     }

Modified: tomcat/trunk/java/org/apache/catalina/util/ServerInfo.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/util/ServerInfo.java?rev=1001923&r1=1001922&r2=1001923&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/util/ServerInfo.java (original)
+++ tomcat/trunk/java/org/apache/catalina/util/ServerInfo.java Mon Sep 27 22:01:45 2010
@@ -22,6 +22,8 @@ package org.apache.catalina.util;
 import java.io.InputStream;
 import java.util.Properties;
 
+import org.apache.jasper.util.ExceptionUtils;
+
 
 /**
  * Simple utility module to make it easy to plug in the server identifier
@@ -64,7 +66,7 @@ public class ServerInfo {
             serverBuilt = props.getProperty("server.built");
             serverNumber = props.getProperty("server.number");
         } catch (Throwable t) {
-            //Ignore
+            ExceptionUtils.handleThrowable(t);
         }
         if (serverInfo == null)
             serverInfo = "Apache Tomcat 7.0.x-dev";

Modified: tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java?rev=1001923&r1=1001922&r2=1001923&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java Mon Sep 27 22:01:45 2010
@@ -44,6 +44,7 @@ import org.apache.catalina.connector.Req
 import org.apache.catalina.connector.Response;
 import org.apache.catalina.util.LifecycleBase;
 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.res.StringManager;
@@ -606,6 +607,7 @@ public class AccessLogValve extends Valv
             try {
                 holder.renameTo(new File(newFileName));
             } catch (Throwable e) {
+                ExceptionUtils.handleThrowable(e);
                 log.error("rotate failed", e);
             }
 
@@ -676,6 +678,7 @@ public class AccessLogValve extends Valv
                     try {
                         close();
                     } catch (Throwable e) {
+                        ExceptionUtils.handleThrowable(e);
                         log.info("at least this wasn't swallowed", e);
                     }
 
@@ -712,6 +715,7 @@ public class AccessLogValve extends Valv
         try {
             index = Integer.parseInt(month) - 1;
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             index = 0;  // Can not happen, in theory
         }
         return (months[index]);
@@ -880,6 +884,7 @@ public class AccessLogValve extends Valv
             try {
                 init = InetAddress.getLocalHost().getHostAddress();
             } catch (Throwable e) {
+                ExceptionUtils.handleThrowable(e);
                 init = "127.0.0.1";
             }
             LOCAL_ADDR_VALUE = init;

Modified: tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java?rev=1001923&r1=1001922&r2=1001923&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java Mon Sep 27 22:01:45
2010
@@ -254,6 +254,7 @@ public class ErrorReportValve extends Va
                 response.setContentType("text/html");
                 response.setCharacterEncoding("utf-8");
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 if (container.getLogger().isDebugEnabled())
                     container.getLogger().debug("status.setContentType", t);
             }

Modified: tomcat/trunk/java/org/apache/catalina/valves/ExtendedAccessLogValve.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/ExtendedAccessLogValve.java?rev=1001923&r1=1001922&r2=1001923&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/valves/ExtendedAccessLogValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/valves/ExtendedAccessLogValve.java Mon Sep 27 22:01:45
2010
@@ -36,6 +36,7 @@ import javax.servlet.http.HttpSession;
 import org.apache.catalina.connector.Request;
 import org.apache.catalina.connector.Response;
 import org.apache.catalina.util.ServerInfo;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 
@@ -180,6 +181,7 @@ public class ExtendedAccessLogValve exte
             if ("".equals(svalue))
                 return "-";
         } catch (Throwable e) {
+            ExceptionUtils.handleThrowable(e);
             /* Log error */
             return "-";
         }
@@ -612,6 +614,7 @@ public class ExtendedAccessLogValve exte
                         try {
                             value = InetAddress.getLocalHost().getHostName();
                         } catch (Throwable e) {
+                            ExceptionUtils.handleThrowable(e);
                             value = "localhost";
                         }
                         buf.append(value);

Modified: tomcat/trunk/java/org/apache/catalina/valves/JDBCAccessLogValve.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/JDBCAccessLogValve.java?rev=1001923&r1=1001922&r2=1001923&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/valves/JDBCAccessLogValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/valves/JDBCAccessLogValve.java Mon Sep 27 22:01:45
2010
@@ -539,6 +539,7 @@ public final class JDBCAccessLogValve ex
                 Class<?> clazz = Class.forName(driverName);
                 driver = (Driver) clazz.newInstance();
             } catch (Throwable e) {
+                ExceptionUtils.handleThrowable(e);
                 throw new SQLException(e.getMessage());
             }
         }



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


Mime
View raw message