From: markt Date: Wed, 28 May 2008 20:42:22 +0000 (+0000) Subject: Additional fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=43683 X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=67249a4db5efead11a44bb0a859f5aafd2063014;p=tomcat7.0 Additional fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=43683 If the context is reloaded, the classloader will have changed so need to reset it git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@661074 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/core/StandardContextValve.java b/java/org/apache/catalina/core/StandardContextValve.java index cb019cee7..57d86b0c5 100644 --- a/java/org/apache/catalina/core/StandardContextValve.java +++ b/java/org/apache/catalina/core/StandardContextValve.java @@ -126,7 +126,9 @@ final class StandardContextValve } // Wait if we are reloading + boolean reloaded = false; while (context.getPaused()) { + reloaded = true; try { Thread.sleep(1000); } catch (InterruptedException e) { @@ -134,6 +136,15 @@ final class StandardContextValve } } + // Reloading will have stopped the old webappclassloader and + // created a new one + if (reloaded && + context.getLoader() != null && + context.getLoader().getClassLoader() != null) { + Thread.currentThread().setContextClassLoader( + context.getLoader().getClassLoader()); + } + // Select the Wrapper to be used for this Request Wrapper wrapper = request.getWrapper(); if (wrapper == null) {