【发布时间】:2012-04-09 12:51:07
【问题描述】:
我正在用 tomcat 和 jax-ws 构建一个 ws。 当我停止我的应用程序时,通常是从 Eclipse 重新部署时,我收到以下消息:
25-mar-2012 16.21.16 com.sun.xml.ws.transport.http.servlet.WSServletDelegate destroy
INFO: WSSERVLET15: JAX-WS servlet destroyed
25-mar-2012 16.21.16 com.sun.xml.ws.transport.http.servlet.WSServletContextListener contextDestroyed
INFO: WSSERVLET13: JAX-WS context listener destroyed
25-mar-2012 16.21.16 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
GRAVE: The web application [/xccm] created a ThreadLocal with key of type [com.sun.xml.ws.api.streaming.XMLStreamReaderFactory$Default$1] (value [com.sun.xml.ws.api.streaming.XMLStreamReaderFactory$Default$1@7edeaa13]) and a value of type [com.sun.xml.internal.stream.XMLInputFactoryImpl] (value [com.sun.xml.internal.stream.XMLInputFactoryImpl@4c700677]) 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.
使用 ClasspathHelper 进行挖掘,我发现 com.sun.xml.ws.api.streaming.XMLStreamReaderFactory$Default$1 被 jaxws-rt.jar 引用
但是我没有在我的代码中明确使用任何 jax-ws 类,除了:
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.xml.bind.JAXBContext;
据我所知,tomcat 加载 com.sun.xml.ws.transport.http.servlet.WSServlet(以及 log sn-p 中的其他类)。
知道如何解决这个问题吗?
谢谢
【问题讨论】:
-
你能在调试中运行你的应用服务器,连接到它,在
ThreadLocal类方法上设置断点并进行部署吗?你会发现原因。
标签: java tomcat memory-leaks jax-ws