Tomcat版本:7.0.41(也尝试过8.0.32)
JRE:6u42
写了一个非常简单的JAX-WS应用程序(作为测试)。当"?wsdl"时,应用程序只显示wsdl文件。使用,当给出SOAP请求时,我只返回一个字符串。
@WebService
public class SOAPWithWS
{
@WebMethod
public String HelloTest(String sMessage)
{
return "Received : " + sMessage;
}
}
当我尝试取消部署上下文时,它会给我一个警告,如下所示:
Mar 09, 2016 1:54:24 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/WS] created a ThreadLocal with key of type [com.sun.xml.bind.v2.runtime.Coordinator$1] (value [com.sun.xml.bind.v2.runtime.Coordinator$1@3e26faf2]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@712545be]) 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.
Mar 09, 2016 1:54:24 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/WS] created a ThreadLocal with key of type [com.sun.xml.bind.v2.ClassFactory$1] (value [com.sun.xml.bind.v2.ClassFactory$1@4605f6fa]) and a value of type [java.util.WeakHashMap] (value [{class com.sun.xml.ws.runtime.config.TubelineDefinition=java.lang.ref.WeakReference@3199bb00, class com.sun.xml.ws.runtime.config.TubeFactoryConfig=java.lang.ref.WeakReference@63c41670, class javax.xml.bind.annotation.adapters.CollapsedStringAdapter=java.lang.ref.WeakReference@5e9d463b, class com.sun.xml.ws.runtime.config.Tubelines=java.lang.ref.WeakReference@276dfc04, class javax.xml.bind.annotation.W3CDomHandler=java.lang.ref.WeakReference@25bc7ed5, class java.util.ArrayList=java.lang.ref.WeakReference@7a2ae54d, class com.sun.xml.ws.runtime.config.MetroConfig=java.lang.ref.WeakReference@163460e4, class com.sun.xml.ws.runtime.config.TubeFactoryList=java.lang.ref.WeakReference@48c5241f}]) 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.
Mar 09, 2016 1:54:24 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/WS] created a ThreadLocal with key of type [org.glassfish.gmbal.generic.OperationTracer$1] (value [org.glassfish.gmbal.generic.OperationTracer$1@6c6948c]) and a value of type [java.util.ArrayList] (value [[]]) 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.
每次测试都会发生这种情况。在GlassFish服务器上也没有发生同样的事情(只是试图测试这种情况)。知道发生了什么以及如何消除这个问题吗?
答案 0 :(得分:0)
您的应用程序中存在内存泄漏。查看此主题,它可能会有所帮助;
答案 1 :(得分:0)
当将JAX-WS实现添加为相应项目的库时,将显示此警告。
不是将JAX-WS实现添加到项目中,而是将其添加到Tomcat本身的库列表中。 例如:在Linux上,如果Tomcat安装在/ usr / java / Tomcat-7内,则JAX-WS库必须包含在/ usr / java / Tomcat-7 / lib /中。
如果不想将库直接添加到Tomcat中,请确保在取消部署上下文时完全重新启动Tomcat。如果在取消部署上下文时每次都重新启动Tomcat,则可以安全地忽略该警告。