首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >CXF 3内存泄漏

CXF 3内存泄漏
EN

Stack Overflow用户
提问于 2015-06-12 03:54:19
回答 1查看 696关注 0票数 0

我有一个从wsdl创建的web服务,并且没有更改任何内容,因此我所拥有的只是一个空应用程序。

在部署应用程序后,只要我点击“停止”(即我甚至没有调用它),我就收到来自Tomcat的“严重”消息,泄漏测试报告我的应用程序有多个实例,并且每次我停止/启动时都会增加。

我使用的是CXF 3.1.0,甚至还尝试下载了最新的JAXB (网站上的参考实现)。

错误如下:

代码语言:javascript
复制
    org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(Automati
    cWorkQueueImpl.java:353)
    java.lang.Thread.run(Thread.java:722)
    11-Jun-2015 15:45:33.142 SEVERE [http-nio-8080-exec-2] org.apache.catalina.loade
    r.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [MyAcces
    sAPSServiceN] created a ThreadLocal with key of type [com.sun.xml.bind.v2.ClassF
    actory$1] (value [com.sun.xml.bind.v2.ClassFactory$1@27765bfc]) and a value of t
    ype [java.util.WeakHashMap] (value [{class org.apache.cxf.ws.addressing.Attribut
    edURIType=java.lang.ref.WeakReference@4b9111a1}]) but failed to remove it when t
    he web application was stopped. Threads are going to be renewed over time to try
    and avoid a probable memory leak.
    11-Jun-2015 15:45:33.143 SEVERE [http-nio-8080-exec-2] org.apache.catalina.loade
    r.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [MyAcces
    sAPSServiceN] created a ThreadLocal with key of type [com.sun.xml.bind.v2.ClassF
    actory$1] (value [com.sun.xml.bind.v2.ClassFactory$1@27765bfc]) and a value of t
    ype [java.util.WeakHashMap] (value [{class org.apache.cxf.ws.discovery.wsdl.Hell
    oType=java.lang.ref.WeakReference@211c87c9, class javax.xml.ws.wsaddressing.W3CE
    ndpointReference$Address=java.lang.ref.WeakReference@5816ae1a, class javax.xml.w
    s.wsaddressing.W3CEndpointReference=java.lang.ref.WeakReference@39005a24, class
    org.apache.cxf.ws.discovery.wsdl.ScopesType=java.lang.ref.WeakReference@461e0eb8
    , class java.util.ArrayList=java.lang.ref.WeakReference@5f5875fe, class javax.xm
    l.ws.wsaddressing.W3CEndpointReference$Elements=java.lang.ref.WeakReference@28aa
    a799}]) but failed to remove it when the web application was stopped. Threads ar
    e going to be renewed over time to try and avoid a probable memory leak.
    11-Jun-2015 15:45:33.146 SEVERE [http-nio-8080-exec-2] org.apache.catalina.loade
    r.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [MyAcces
    sAPSServiceN] created a ThreadLocal with key of type [com.sun.xml.bind.v2.ClassF
    actory$1] (value [com.sun.xml.bind.v2.ClassFactory$1@27765bfc]) and a value of t
    ype [java.util.WeakHashMap] (value [{class org.apache.cxf.ws.addressing.Attribut
    edURIType=java.lang.ref.WeakReference@5be142aa}]) but failed to remove it when t
    he web application was stopped. Threads are going to be renewed over time to try
    and avoid a probable memory leak.
    11-Jun-2015 15:45:33.148 SEVERE [http-nio-8080-exec-2] org.apache.catalina.loade
    r.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [MyAcces
    sAPSServiceN] created a ThreadLocal with key of type [com.sun.xml.bind.v2.ClassF
    actory$1] (value [com.sun.xml.bind.v2.ClassFactory$1@27765bfc]) and a value of t
    ype [java.util.WeakHashMap] (value [{class javax.xml.ws.wsaddressing.W3CEndpoint
    Reference$Address=java.lang.ref.WeakReference@21dfd606, class javax.xml.ws.wsadd
    ressing.W3CEndpointReference=java.lang.ref.WeakReference@6e5c3549, class org.apa
    che.cxf.ws.discovery.wsdl.ScopesType=java.lang.ref.WeakReference@67ae8439, class
    java.util.ArrayList=java.lang.ref.WeakReference@726aef5c, class org.apache.cxf.
    ws.discovery.wsdl.ByeType=java.lang.ref.WeakReference@4a88bbb3, class javax.xml.
    ws.wsaddressing.W3CEndpointReference$Elements=java.lang.ref.WeakReference@56db0a
    ff}]) 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.
EN

回答 1

Stack Overflow用户

发布于 2015-06-19 04:23:35

这似乎是一个known limitation of the JAXB API。Issue声称你可以通过显式关闭Unmarshaller来避免这个问题,但我自己还没有尝试过。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30790217

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档