diff --git a/pax-web-tomcat/src/main/java/org/ops4j/pax/web/service/tomcat/internal/PaxWebStandardContext.java b/pax-web-tomcat/src/main/java/org/ops4j/pax/web/service/tomcat/internal/PaxWebStandardContext.java index 5ed917513f..d3c1110351 100644 --- a/pax-web-tomcat/src/main/java/org/ops4j/pax/web/service/tomcat/internal/PaxWebStandardContext.java +++ b/pax-web-tomcat/src/main/java/org/ops4j/pax/web/service/tomcat/internal/PaxWebStandardContext.java @@ -129,6 +129,7 @@ public PaxWebStandardContext(Default404Servlet defaultServlet, OsgiSessionAttrib this.osgiSessionsBridge = osgiSessionsBridge; this.setClearReferencesObjectStreamClassCaches(false); this.setClearReferencesRmiTargets(false); + this.setClearReferencesThreadLocals(false); } /** diff --git a/pax-web-tomcat/src/main/java/org/ops4j/pax/web/service/tomcat/internal/TomcatServerWrapper.java b/pax-web-tomcat/src/main/java/org/ops4j/pax/web/service/tomcat/internal/TomcatServerWrapper.java index 893469b5cb..69c79cb414 100644 --- a/pax-web-tomcat/src/main/java/org/ops4j/pax/web/service/tomcat/internal/TomcatServerWrapper.java +++ b/pax-web-tomcat/src/main/java/org/ops4j/pax/web/service/tomcat/internal/TomcatServerWrapper.java @@ -2073,6 +2073,7 @@ private void ensureServletContextStarted(PaxWebStandardContext context) { ParallelWebappClassLoader loaderInstance = new ParallelWebappClassLoader(highestRankedContext.getClassLoader()); loaderInstance.setClearReferencesObjectStreamClassCaches(false); loaderInstance.setClearReferencesRmiTargets(false); + loaderInstance.setClearReferencesThreadLocals(false); tomcatLoader.setLoaderInstance(loaderInstance); context.setParentClassLoader(highestRankedContext.getClassLoader()); context.setLoader(tomcatLoader);