struts2关于A web application created a ThreadLocal with key of type 异常解决办法

来源:互联网 发布:王侯将相宁有种乎影响 编辑:程序博客网 时间:2024/05/20 12:47
created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@12c74b9]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@1a34544]) but failed to remove it。。。。

这类问题的解决办法:

       http://confluence.atlassian.com/pages/viewpage.action?pageId=218275753

看看老外的这篇,好像就是在讲这个问题,原因大概是说tomcat 6.025之后引入了一种内存泄露的检查机制,会把不能垃圾收集的对像做日志。

第一种解决办法:

使用低于6版本的tomcat

 

第二种解决办法:

在tomcat的server.xml文件(在tomcat的安装路径下的conf文件夹里)中把

<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/>

这个监听给关了。

就是用<!--。。。-->把下面三句话括起来就可以啦。

<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
       <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
       <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />