Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Bartel2015-09-24 04:02:46 +0000
committerJan Bartel2015-09-24 04:03:37 +0000
commit06fbf447fb11fef73b413d7ff42d3f651b4464c8 (patch)
tree778a33317cfdaac17881a28c17fc81164d2647ee /jetty-server
parent382c8e3738a10d11d8c5882c1be9e9ea54edd020 (diff)
downloadorg.eclipse.jetty.project-06fbf447fb11fef73b413d7ff42d3f651b4464c8.tar.gz
org.eclipse.jetty.project-06fbf447fb11fef73b413d7ff42d3f651b4464c8.tar.xz
org.eclipse.jetty.project-06fbf447fb11fef73b413d7ff42d3f651b4464c8.zip
478247 WebappClassLoader pinned after redeploy
Diffstat (limited to 'jetty-server')
-rw-r--r--jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java
index 31922b0026..d2b6b888a9 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java
@@ -853,6 +853,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu
_availability = Availability.UNAVAILABLE;
ClassLoader old_classloader = null;
+ ClassLoader old_webapploader = null;
Thread current_thread = null;
Context old_context = __context.get();
@@ -862,6 +863,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu
// Set the classloader
if (_classLoader != null)
{
+ old_webapploader = _classLoader;
current_thread = Thread.currentThread();
old_classloader = current_thread.getContextClassLoader();
current_thread.setContextClassLoader(_classLoader);
@@ -885,7 +887,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu
LOG.info("Stopped {}", this);
__context.set(old_context);
// reset the classloader
- if (_classLoader != null && current_thread!=null)
+ if ((old_classloader == null || (old_classloader != old_webapploader)) && current_thread != null)
current_thread.setContextClassLoader(old_classloader);
}

Back to the top