tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kkoli...@apache.org
Subject svn commit: r940064 - in /tomcat/trunk/java/org/apache/catalina/startup: Catalina.java LocalStrings.properties
Date Sat, 01 May 2010 16:00:29 GMT
Author: kkolinko
Date: Sat May  1 16:00:29 2010
New Revision: 940064

URL: http://svn.apache.org/viewvc?rev=940064&view=rev
Log:
Log any unexpected errors that might occur during server shutdown from the shutdown hook,
and do not forget to shutdown (read: flush) the logging subsystem.

Modified:
    tomcat/trunk/java/org/apache/catalina/startup/Catalina.java
    tomcat/trunk/java/org/apache/catalina/startup/LocalStrings.properties

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=940064&r1=940063&r2=940064&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/Catalina.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/Catalina.java Sat May  1 16:00:29 2010
@@ -778,16 +778,19 @@ public class Catalina {
 
         @Override
         public void run() {
-
-            if (getServer() != null) {
-                Catalina.this.stop();
-            }
-            
-            // If JULI is used, shut JULI down *after* the server shuts down
-            // so log messages aren't lost
-            LogManager logManager = LogManager.getLogManager();
-            if (logManager instanceof ClassLoaderLogManager) {
-                ((ClassLoaderLogManager) logManager).shutdown();
+            try {
+                if (getServer() != null) {
+                    Catalina.this.stop();
+                }
+            } catch (Throwable ex) {
+                log.error(sm.getString("catalina.shutdownHookFail"), ex);
+            } finally {
+                // If JULI is used, shut JULI down *after* the server shuts down
+                // so log messages aren't lost
+                LogManager logManager = LogManager.getLogManager();
+                if (logManager instanceof ClassLoaderLogManager) {
+                    ((ClassLoaderLogManager) logManager).shutdown();
+                }
             }
         }
     }

Modified: tomcat/trunk/java/org/apache/catalina/startup/LocalStrings.properties
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/LocalStrings.properties?rev=940064&r1=940063&r2=940064&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/LocalStrings.properties (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/LocalStrings.properties Sat May  1 16:00:29
2010
@@ -13,6 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+catalina.shutdownHookFail=The shutdown hook experienced an error while trying to stop the
server
 catalina.stopServer=No shutdown port configured. Shut down server through OS signal. Server
not shut down.
 contextConfig.altDDNotFound=alt-dd file {0} not found
 contextConfig.applicationUrl=Unable to determine URL for application web.xml



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


Mime
View raw message