tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1001915 - in /tomcat/trunk/java/org/apache/catalina: deploy/ ha/authenticator/ ha/session/ loader/ manager/ manager/host/
Date Mon, 27 Sep 2010 21:32:25 GMT
Author: markt
Date: Mon Sep 27 21:32:25 2010
New Revision: 1001915

URL: http://svn.apache.org/viewvc?rev=1001915&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/deploy/ErrorPage.java
    tomcat/trunk/java/org/apache/catalina/ha/authenticator/ClusterSingleSignOn.java
    tomcat/trunk/java/org/apache/catalina/ha/session/DeltaManager.java
    tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java
    tomcat/trunk/java/org/apache/catalina/loader/WebappLoader.java
    tomcat/trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java
    tomcat/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java
    tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java
    tomcat/trunk/java/org/apache/catalina/manager/host/HostManagerServlet.java

Modified: tomcat/trunk/java/org/apache/catalina/deploy/ErrorPage.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/deploy/ErrorPage.java?rev=1001915&r1=1001914&r2=1001915&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/deploy/ErrorPage.java (original)
+++ tomcat/trunk/java/org/apache/catalina/deploy/ErrorPage.java Mon Sep 27 21:32:25 2010
@@ -92,7 +92,7 @@ public class ErrorPage implements Serial
 
         try {
             this.errorCode = Integer.parseInt(errorCode);
-        } catch (Throwable t) {
+        } catch (NumberFormatException nfe) {
             this.errorCode = 0;
         }
 

Modified: tomcat/trunk/java/org/apache/catalina/ha/authenticator/ClusterSingleSignOn.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ha/authenticator/ClusterSingleSignOn.java?rev=1001915&r1=1001914&r2=1001915&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/ha/authenticator/ClusterSingleSignOn.java (original)
+++ tomcat/trunk/java/org/apache/catalina/ha/authenticator/ClusterSingleSignOn.java Mon Sep
27 21:32:25 2010
@@ -32,6 +32,7 @@ import org.apache.catalina.authenticator
 import org.apache.catalina.ha.CatalinaCluster;
 import org.apache.catalina.ha.ClusterManager;
 import org.apache.catalina.util.LifecycleBase;
+import org.apache.jasper.util.ExceptionUtils;
 
 
 
@@ -149,6 +150,7 @@ public class ClusterSingleSignOn
                         "There is no Cluster for ClusterSingleSignOn");
             }
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             throw new LifecycleException(
                     "ClusterSingleSignOn exception during clusterLoad " + t);
         }

Modified: tomcat/trunk/java/org/apache/catalina/ha/session/DeltaManager.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ha/session/DeltaManager.java?rev=1001915&r1=1001914&r2=1001915&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/ha/session/DeltaManager.java (original)
+++ tomcat/trunk/java/org/apache/catalina/ha/session/DeltaManager.java Mon Sep 27 21:32:25
2010
@@ -787,6 +787,7 @@ public class DeltaManager extends Cluste
             getAllClusterSessions();
 
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log.error(sm.getString("deltaManager.managerLoad"), t);
         }
         

Modified: tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java?rev=1001915&r1=1001914&r2=1001915&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java (original)
+++ tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java Mon Sep 27 21:32:25
2010
@@ -70,6 +70,7 @@ import org.apache.catalina.LifecycleExce
 import org.apache.catalina.LifecycleListener;
 import org.apache.catalina.LifecycleState;
 import org.apache.jasper.servlet.JasperLoader;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.naming.JndiPermission;
 import org.apache.naming.resources.ProxyDirContext;
 import org.apache.naming.resources.Resource;
@@ -2105,6 +2106,7 @@ public class WebappClassLoader
                                     }
                                 }
                             } catch (Throwable t) {
+                                ExceptionUtils.handleThrowable(t);
                                 if (log.isDebugEnabled()) {
                                     log.debug("Could not set field " + field.getName() 
                                             + " to null in class " + clazz.getName(), t);
@@ -2113,6 +2115,7 @@ public class WebappClassLoader
                         }
                     }
                 } catch (Throwable t) {
+                    ExceptionUtils.handleThrowable(t);
                     if (log.isDebugEnabled()) {
                         log.debug("Could not clean fields for class " + clazz.getName(),
t);
                     }
@@ -2162,6 +2165,7 @@ public class WebappClassLoader
                     }
                 }
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 if (log.isDebugEnabled()) {
                     log.debug("Could not set field " + field.getName() 
                             + " to null in object instance of class " 
@@ -3273,7 +3277,7 @@ public class WebappClassLoader
                 } else {
                     clazz = Class.forName(triggers[i]);
                 }
-            } catch (Throwable t) {
+            } catch (Exception e) {
                 clazz = null;
             }
             if (clazz == null)

Modified: tomcat/trunk/java/org/apache/catalina/loader/WebappLoader.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/loader/WebappLoader.java?rev=1001915&r1=1001914&r2=1001915&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/loader/WebappLoader.java (original)
+++ tomcat/trunk/java/org/apache/catalina/loader/WebappLoader.java Mon Sep 27 21:32:25 2010
@@ -55,6 +55,7 @@ import org.apache.catalina.core.Standard
 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.naming.resources.DirContextURLStreamHandler;
 import org.apache.naming.resources.DirContextURLStreamHandlerFactory;
 import org.apache.naming.resources.Resource;
@@ -568,6 +569,7 @@ public class WebappLoader extends Lifecy
                 // Log and continue anyway, this is not critical
                 log.error("Error registering jndi stream handler", e);
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 // This is likely a dual registration
                 log.info("Dual registration of jndi stream handler: " 
                          + t.getMessage());
@@ -622,6 +624,7 @@ public class WebappLoader extends Lifecy
                 .registerComponent(classLoader, cloname, null);
 
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log.error( "LifecycleException ", t );
             throw new LifecycleException("start: ", t);
         }
@@ -666,8 +669,8 @@ public class WebappLoader extends Lifecy
                 (MBeanUtils.getDomain(ctx) + ":type=WebappClassLoader,path="
                  + path + ",host=" + ctx.getParent().getName());
             Registry.getRegistry(null, null).unregisterComponent(cloname);
-        } catch (Throwable t) {
-            log.error( "LifecycleException ", t );
+        } catch (Exception e) {
+            log.error("LifecycleException ", e);
         }
 
         classLoader = null;

Modified: tomcat/trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java?rev=1001915&r1=1001914&r2=1001915&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java Mon Sep 27 21:32:25
2010
@@ -54,7 +54,6 @@ import org.apache.catalina.manager.util.
 import org.apache.catalina.util.RequestUtil;
 import org.apache.catalina.util.ServerInfo;
 import org.apache.catalina.util.URLEncoder;
-import org.apache.tomcat.util.ExceptionUtils;
 import org.apache.tomcat.util.http.fileupload.ParameterParser;
 
 /**
@@ -786,13 +785,8 @@ public final class HTMLManagerServlet ex
         
         // Set our properties from the initialization parameters
         String value = null;
-        try {
-            value = getServletConfig().getInitParameter("showProxySessions");
-            showProxySessions = Boolean.parseBoolean(value);
-        } catch (Throwable t) {
-            ExceptionUtils.handleThrowable(t);
-        }
-
+        value = getServletConfig().getInitParameter("showProxySessions");
+        showProxySessions = Boolean.parseBoolean(value);
     }   
 
     // ------------------------------------------------ Sessions administration

Modified: tomcat/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java?rev=1001915&r1=1001914&r2=1001915&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java Mon Sep 27 21:32:25
2010
@@ -35,6 +35,7 @@ import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.tomcat.util.modeler.Registry;
 
 /**
@@ -207,6 +208,7 @@ public class JMXProxyServlet extends Htt
                                         sb.append(escape(item.toString()));
                                     }
                                     catch (Throwable t) {
+                                        ExceptionUtils.handleThrowable(t);
                                         sb.append("NON-STRINGABLE VALUE");
                                     }
                                 }
@@ -222,7 +224,7 @@ public class JMXProxyServlet extends Htt
                         writer.println( attName + ": " + valueString);
                     }
                     catch (Throwable t) {
-                        // Ignore
+                        ExceptionUtils.handleThrowable(t);
                     }
                 }
             } catch (Exception e) {

Modified: tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java?rev=1001915&r1=1001914&r2=1001915&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java Mon Sep 27 21:32:25
2010
@@ -834,6 +834,7 @@ public class ManagerServlet
                 writer.println(sm.getString("managerServlet.deployFailed", displayPath));
             }
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log("ManagerServlet.install[" + displayPath + "]", t);
             writer.println(sm.getString("managerServlet.exception",
                     t.toString()));
@@ -917,6 +918,7 @@ public class ManagerServlet
             writer.println
                 (sm.getString("managerServlet.reloaded", displayPath));
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log("ManagerServlet.reload[" + displayPath + "]", t);
             writer.println(sm.getString("managerServlet.exception",
                                         t.toString()));
@@ -961,6 +963,7 @@ public class ManagerServlet
                 clazz = Class.forName(type);
             }
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log("ManagerServlet.resources[" + type + "]", t);
             writer.println(sm.getString("managerServlet.exception",
                                         t.toString()));
@@ -1000,6 +1003,7 @@ public class ManagerServlet
                 }
             }
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log("ManagerServlet.resources[" + type + "]", t);
             writer.println(sm.getString("managerServlet.exception",
                                         t.toString()));
@@ -1081,6 +1085,7 @@ public class ManagerServlet
             props.append(System.getProperty("java.vm.vendor"));
             writer.println(props.toString());
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             getServletContext().log("ManagerServlet.serverinfo",t);
             writer.println(sm.getString("managerServlet.exception",
                                         t.toString()));
@@ -1178,6 +1183,7 @@ public class ManagerServlet
                 writer.println(sm.getString("managerServlet.sessiontimeout.expired",
                                             "" + idle,"" + expired));
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log("ManagerServlet.sessions[" + displayPath + "]", t);
             writer.println(sm.getString("managerServlet.exception",
                                         t.toString()));
@@ -1254,6 +1260,7 @@ public class ManagerServlet
                 writer.println
                     (sm.getString("managerServlet.startFailed", displayPath));
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             getServletContext().log
                 (sm.getString("managerServlet.startFailed", displayPath), t);
             writer.println
@@ -1300,6 +1307,7 @@ public class ManagerServlet
             context.stop();
             writer.println(sm.getString("managerServlet.stopped", displayPath));
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log("ManagerServlet.stop[" + displayPath + "]", t);
             writer.println(sm.getString("managerServlet.exception",
                                         t.toString()));
@@ -1375,6 +1383,7 @@ public class ManagerServlet
             writer.println(sm.getString("managerServlet.undeployed",
                                         displayPath));
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log("ManagerServlet.undeploy[" + displayPath + "]", t);
             writer.println(sm.getString("managerServlet.exception",
                                         t.toString()));

Modified: tomcat/trunk/java/org/apache/catalina/manager/host/HostManagerServlet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/manager/host/HostManagerServlet.java?rev=1001915&r1=1001914&r2=1001915&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/manager/host/HostManagerServlet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/manager/host/HostManagerServlet.java Mon Sep 27
21:32:25 2010
@@ -597,13 +597,13 @@ public class HostManagerServlet
             host.start();
             writer.println
                 (sm.getString("hostManagerServlet.started", name));
-        } catch (Throwable t) {
+        } catch (Exception e) {
             getServletContext().log
-                (sm.getString("hostManagerServlet.startFailed", name), t);
+                (sm.getString("hostManagerServlet.startFailed", name), e);
             writer.println
                 (sm.getString("hostManagerServlet.startFailed", name));
             writer.println(sm.getString("hostManagerServlet.exception",
-                                        t.toString()));
+                                        e.toString()));
             return;
         }
         
@@ -656,13 +656,13 @@ public class HostManagerServlet
             host.stop();
             writer.println
                 (sm.getString("hostManagerServlet.stopped", name));
-        } catch (Throwable t) {
+        } catch (Exception e) {
             getServletContext().log
-                (sm.getString("hostManagerServlet.stopFailed", name), t);
+                (sm.getString("hostManagerServlet.stopFailed", name), e);
             writer.println
                 (sm.getString("hostManagerServlet.stopFailed", name));
             writer.println(sm.getString("hostManagerServlet.exception",
-                                        t.toString()));
+                                        e.toString()));
             return;
         }
         



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


Mime
View raw message