tomcat的两个错误提示

今天tomcat 6遇到两个错误提示:
1.
严重: A web application registered the JBDC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.


原因:重复加载了jar包。
解决方法:原来我在tomcat的lib文件夹放入了com.mysql.jdbc.Driver的jar包,而又在项目里面重复添加了,导致了上面的提示。删掉其中一个解决问题。


2.The web application [/snoopy] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@ea85b4]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@efeff8]) 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.026之后的版本加入了 memory leak detection feature(内存泄露检查)看如下原文:
There is a memory leak detection feature introduced in Tomcat 6.0.26 that attempts to log objects that have failed to be unregistered by webapps it hosts when they are stopped, and were forcibly unregistered by Tomcat. As Tomcat is forcibly removing these objects, it is not a serious concern that these log messages occur.


解决方法:在tomcat 的server.xml文件中将<!-- <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/> -->注释掉即可
PS:这是一个治标不治本的方法。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值