You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by St...@faa.gov on 2014/05/22 22:05:40 UTC

ThreadLocal created but not removed in CXF

In my CXF STS using 2.7.12-SNAPSHOT and running on Tomcat 7.0.52, I get several messages in the logs whenever I undeploy the STS app:

SEVERE: The web application [/STS] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@84421d]) and a value of type [org.apache.cxf.BusFactory.BusHolder] (value [org.apache.cxf.BusFactory$BusHolder@110af6c]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
May 16, 2014 2:41:33 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/STS] created a ThreadLocal with key of type [com.sun.xml.bind.v2.ClassFactory$1] (value [com.sun.xml.bind.v2.ClassFactory$1@6ce120]) and a value of type [java.util.WeakHashMap] (value [{class javax.xml.bind.annotation.W3CDomHandler=java.lang.ref.WeakReference@303797}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
May 16, 2014 2:41:33 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/STS] created a ThreadLocal with key of type [com.sun.xml.bind.v2.runtime.Coordinator$1] (value [com.sun.xml.bind.v2.runtime.Coordinator$1@191a6e9]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@1650dda]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
May 16, 2014 2:41:33 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/STS] created a ThreadLocal with key of type [com.sun.xml.bind.v2.ClassFactory$1] (value [com.sun.xml.bind.v2.ClassFactory$1@6ce120]) and a value of type [java.util.WeakHashMap] (value [{class org.apache.cxf.ws.addressing.EndpointReferenceType=java.lang.ref.WeakReference@1707249, class org.apache.cxf.ws.addressing.AttributedURIType=java.lang.ref.WeakReference@15f4271, class javax.xml.bind.annotation.adapters.CollapsedStringAdapter=java.lang.ref.WeakReference@1032e59, class java.util.ArrayList=java.lang.ref.WeakReference@1d7dbbb, class org.apache.cxf.ws.security.sts.provider.model.RequestSecurityTokenType=java.lang.ref.WeakReference@9af8e3, class org.apache.cxf.ws.security.sts.provider.model.UseKeyType=java.lang.ref.WeakReference@4a2452}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.

These messages don't show up during operation, only when I undeploy the app. I generally shutdown and restart tomcat anyway, but I'm not in production yet and during production that may not be the best option, so I'd rather clean it up now if it's at all possible.

Based on the refs to W3CDomHandler, BusHolder, etc., it looks like this is something within CXF itself, probably the same sort of issue reported in CXF-4006?

Does anyone have any ideas on a fix for this, should I file a bug report, or should I migrate onto CXF 3.0.0 (assuming this is fixed in 3.0.0)? Or am I completely off the rails here?

Thanx,

Stephen W. Chappell