The web application [/struts1] created a ThreadLocal with key of type

来源:互联网 发布:ubuntu 16.04 skype 编辑:程序博客网 时间:2024/05/20 15:40

严重: The web application [/struts1] created a ThreadLocal with key of type [com.sun.faces.util.Util$1] (value [com.sun.faces.util.Util$1@a916b1]) and a value of type [java.util.HashMap] (value [{com.sun.faces.patternCache={ = }}]) 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.


有些地方大概是说tomcat 6.025之后引入了一种内存泄露的检查机制,会把不能垃圾收集的对像做日志

解决办法:

法一:使用低于tomcat 6.0的版本

法二:先将服务关掉,然后部署工程,再启动服务。

法三:在tomcat的server.xml文件中把   
<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" />