Tomcat版本:7.0.41(也尝试过8.0.32)
JRE:6u42
编写了一个非常简单的JAX-WS应用程序(作为测试)。当使用“?wsdl”并且给出SOAP请求时,当前应用程序仅显示wsdl文件,只是返回一个字符串。

@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服务器上不会发生相同的情况(只是尝试测试这种情况)。知道发生了什么以及如何消除此问题吗?

最佳答案

您的应用程序中有内存泄漏。检查此主题,可能会有所帮助;

What are these warnings in catalina.out?

09-27 05:22