困扰老子好久啊!!tomcat的两个错…
来源:互联网 发布:后盾网php视频教程 编辑:程序博客网 时间:2024/06/10 19:12
转:http://blog.csdn.net/snoopy93/article/details/6800660
今天tomcat 6遇到两个错误提示:
1.
严重: A web application registered the JBDC driver[com.mysql.jdbc.Driver] but failed to unregister it when the webapplication was stopped. To prevent a memory leak, the JDBC Driverhas been forcibly unregistered.
原因:重复加载了jar包。
解决方法:原来我在tomcat的lib文件夹放入了com.mysql.jdbc.Driver的jar包,而又在项目里面重复添加了,导致了上面的提示。删掉其中一个解决问题。
2.The web application [/snoopy] created a ThreadLocal with key oftype [com.opensymphony.xwork2.inject.ContainerImpl$10] (value[com.opensymphony.xwork2.inject.ContainerImpl$10@ea85b4]) and avalue of type [java.lang.Object[]] (value[[Ljava.lang.Object;@efeff8]) but failed to remove it when the webapplication was stopped. Threads are going to be renewed over timeto try and avoid a probable memory leak.
原因:tomcat 6.026之后的版本加入了 memory leak detectionfeature(内存泄露检查)看如下原文:
There is a memory leak detection feature introduced in Tomcat6.0.26 that attempts to log objects that have failed to beunregistered by webapps it hosts when they are stopped, and wereforcibly unregistered by Tomcat. As Tomcat is forcibly removingthese objects, it is not a serious concern that these log messagesoccur.
解决方法:在tomcat 的server.xml文件中将注释掉即可
PS:这是一个治标不治本的方法。
1.
严重: A web application registered the JBDC driver[com.mysql.jdbc.Driver] but failed to unregister it when the webapplication was stopped. To prevent a memory leak, the JDBC Driverhas been forcibly unregistered.
原因:重复加载了jar包。
解决方法:原来我在tomcat的lib文件夹放入了com.mysql.jdbc.Driver的jar包,而又在项目里面重复添加了,导致了上面的提示。删掉其中一个解决问题。
2.The web application [/snoopy] created a ThreadLocal with key oftype [com.opensymphony.xwork2.inject.ContainerImpl$10] (value[com.opensymphony.xwork2.inject.ContainerImpl$10@ea85b4]) and avalue of type [java.lang.Object[]] (value[[Ljava.lang.Object;@efeff8]) but failed to remove it when the webapplication was stopped. Threads are going to be renewed over timeto try and avoid a probable memory leak.
原因:tomcat 6.026之后的版本加入了 memory leak detectionfeature(内存泄露检查)看如下原文:
There is a memory leak detection feature introduced in Tomcat6.0.26 that attempts to log objects that have failed to beunregistered by webapps it hosts when they are stopped, and wereforcibly unregistered by Tomcat. As Tomcat is forcibly removingthese objects, it is not a serious concern that these log messagesoccur.
解决方法:在tomcat 的server.xml文件中将注释掉即可
PS:这是一个治标不治本的方法。
***********************************
解决”To prevent a memory leak, the JDBC Driver has been forciblyunregistered“
- 博客分类:
- 项目总结
Java代码
- To
prevent a memory leak, the JDBC Driver has been forcibly unregistered.
To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
写道
Ignore those warnings. Tomcat is doing itsjob right. The actual bug is in someone else's code (the JDBCdriver in question), not in yours. Be happy that Tomcat did its jobproperly and wait until the JDBC driver vendor get it fixed so thatyou can upgrade the driver.
Downgrade to Tomcat 6.0.23 or older so that you will not bebothered with those warnings. But it will silently keep leakingmemory. Not sure if that's good to know after all. Those kind ofmemory leaks are one of the major causes behind OutOfMemoryErrorissues during Tomcat hotdeployments.
Move the JDBC driver to Tomcat's /lib folder and have a connectionpooled datasource to manage the driver. Note that Tomcat's builtinDBCP does not deregister drivers properly on close. See also bugDBCP-322. The DBCP project is however currently stalling. Iwouldn't expect quick updates. You would rather like to replaceDBCP by another connection pool which is doing its job better thenDBCP. For example BoneCP or Tomcat JDBC Pool maybe?
Downgrade to Tomcat 6.0.23 or older so that you will not bebothered with those warnings. But it will silently keep leakingmemory. Not sure if that's good to know after all. Those kind ofmemory leaks are one of the major causes behind OutOfMemoryErrorissues during Tomcat hotdeployments.
Move the JDBC driver to Tomcat's /lib folder and have a connectionpooled datasource to manage the driver. Note that Tomcat's builtinDBCP does not deregister drivers properly on close. See also bugDBCP-322. The DBCP project is however currently stalling. Iwouldn't expect quick updates. You would rather like to replaceDBCP by another connection pool which is doing its job better thenDBCP. For example BoneCP or Tomcat JDBC Pool maybe?
- 困扰老子好久啊!!tomcat的两个错…
- 解决ov5640困扰好久的问题
- 困扰了好久的弱智问题
- 今天解决了困扰我好久的问题。。。好高兴啊
- 第一次遇到Mysql的BUG,困扰我好久了。
- 第一个Qt OpenGL的问题,困扰了好久
- 困扰老子一下午的数据库操作问题(python+mysql)
- 困扰nginx初学者的两个小问题
- MyEclipse,TomCat版本混乱的困扰
- 困扰2天的tomcat启动问题
- djbdns 真是个好东西,困扰好久的sendmail发信速度慢的问题解决!
- 关于MFC中的LoadFrame函数(这个函数困扰了我好久啊 )
- 真的好久啊。。
- 好久不开tomcat启动报错
- 解决Java项目库文件困扰的两个eclipse插件
- 今天解决了一直困扰我很久的两个问题
- 困扰于Tomcat和Eclipse的相对路径
- 论老子的“上善若水”
- 关于Context []startup fail…
- unsupported major.minor&nbs…
- SSH/JPA整合错误总结
- OAUTH协议简介 .
- OAuth简介及sina微博开放平台
- 困扰老子好久啊!!tomcat的两个错…
- 前台标签妙用(01)
- Java中的线程
- Thread.currentThread().getName()…
- Race Condition引起的性能问题 转
- Ant学习笔记——自己构建Ant编译环境…
- 用Maven构建Java Web开发环境…
- Maven Jetty Plugin&nbs…
- jetty实战2-jsp