[ 
https://issues.apache.org/jira/browse/CAMEL-8972?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14628402#comment-14628402
 ] 

Claus Ibsen commented on CAMEL-8972:
------------------------------------

Thanks for the hint, yeah it seems an unfixable bug in JAXB they wont fix. I 
dived into the JAXB-impl source and the unmarshaller is hidden behind private 
apis and no way to call any closeable. We need to use the Binder API also.

The problem is those custom java adapters, which we use for TimeUnit and some 
xstream data format. JAXB cannot even automap bind to/from an enum type, so we 
need that for the time map. However we can create our own @JaxbEnum which we do 
for some other types that works fine, such as ExchangePattern etc.



> Classloader leak reported in Apache tomcat
> ------------------------------------------
>
>                 Key: CAMEL-8972
>                 URL: https://issues.apache.org/jira/browse/CAMEL-8972
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 2.15.2
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 2.16.0
>
>
> Wonder if we can try to fix this. 
> When deploying a Camel WAR in Tomcat and stopping Tomcat it repors
> {code}
> 15-Jul-2015 08:44:42.598 SEVERE [localhost-startStop-1] 
> org.apache.catalina.loader.WebappClassLoader.checkThreadLocalMapForLeaks The 
> web application [/myweb] created a ThreadLocal with key of type 
> [com.sun.xml.bind.v2.ClassFactory$1] (value 
> [com.sun.xml.bind.v2.ClassFactory$1@2bd27391]) and a value of type 
> [java.util.WeakHashMap] (value [{class 
> org.apache.camel.spring.CamelContextFactoryBean=java.lang.ref.WeakReference@5a14b11,
>  class 
> javax.xml.bind.annotation.adapters.CollapsedStringAdapter=java.lang.ref.WeakReference@20474bfa,
>  class 
> org.apache.camel.model.SetBodyDefinition=java.lang.ref.WeakReference@28cd1aa4,
>  class 
> org.apache.camel.model.language.SimpleExpression=java.lang.ref.WeakReference@319019e9,
>  class 
> org.apache.camel.model.WhenDefinition=java.lang.ref.WeakReference@6b95296a, 
> class 
> org.apache.camel.model.RouteDefinition=java.lang.ref.WeakReference@dd22554, 
> class 
> org.apache.camel.model.ToDefinition=java.lang.ref.WeakReference@5f90b4e2, 
> class 
> org.apache.camel.model.FromDefinition=java.lang.ref.WeakReference@15539272, 
> class 
> org.apache.camel.model.ChoiceDefinition=java.lang.ref.WeakReference@21b3854e, 
> class 
> org.apache.camel.model.OtherwiseDefinition=java.lang.ref.WeakReference@10f4d52b,
>  class 
> org.apache.camel.model.language.HeaderExpression=java.lang.ref.WeakReference@39d702bf,
>  class 
> org.apache.camel.model.TransformDefinition=java.lang.ref.WeakReference@52f56743,
>  class 
> org.apache.camel.model.language.ConstantExpression=java.lang.ref.WeakReference@6d4e8a41}])
>  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.
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to