tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1428010 - /tomcat/trunk/java/org/apache/catalina/startup/Bootstrap.java
Date Wed, 02 Jan 2013 20:37:16 GMT
Author: markt
Date: Wed Jan  2 20:37:16 2013
New Revision: 1428010

URL: http://svn.apache.org/viewvc?rev=1428010&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54247
Prevent ClassNotFoundExceptions on stop when running as a service

Modified:
    tomcat/trunk/java/org/apache/catalina/startup/Bootstrap.java

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=1428010&r1=1428009&r2=1428010&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/Bootstrap.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/Bootstrap.java Wed Jan  2 20:37:16 2013
@@ -465,6 +465,11 @@ public final class Bootstrap {
                 return;
             }
             daemon = bootstrap;
+        } else {
+            // When running as a service the call to stop will be on a new
+            // thread so make sure the correct class loader is used to prevent
+            // a range of class not found exceptions.
+            Thread.currentThread().setContextClassLoader(daemon.catalinaLoader);
         }
 
         try {



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


Mime
View raw message