困扰老子好久啊!!tomcat的两个错…

发布时间:2017-4-29 19:30:22 编辑:www.fx114.net 分享查询网我要评论
本篇文章主要介绍了"困扰老子好久啊!!tomcat的两个错…",主要涉及到困扰老子好久啊!!tomcat的两个错…方面的内容,对于困扰老子好久啊!!tomcat的两个错…感兴趣的同学可以参考一下。

转: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 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 [[email protected]]) 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文件中将注释掉即可 PS:这是一个治标不治本的方法。   *********************************** 解决 ”To prevent a memory leak, the JDBC Driver has been forcibly unregistered“ 博客分类: 项目总结            在开发过程中,添加完UrlWriter之后,部署到了服务器环境,发生了如下错误      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.         原来Tomcat6会起一个线程检测是否有内存泄露 写道 Ignore those warnings. Tomcat is doing its job right. The actual bug is in someone else's code (the JDBC driver in question), not in yours. Be happy that Tomcat did its job properly and wait until the JDBC driver vendor get it fixed so that you can upgrade the driver. Downgrade to Tomcat 6.0.23 or older so that you will not be bothered with those warnings. But it will silently keep leaking memory. Not sure if that's good to know after all. Those kind of memory leaks are one of the major causes behind OutOfMemoryError issues during Tomcat hotdeployments. Move the JDBC driver to Tomcat's /lib folder and have a connection pooled datasource to manage the driver. Note that Tomcat's builtin DBCP does not deregister drivers properly on close. See also bug DBCP-322. The DBCP project is however currently stalling. I wouldn't expect quick updates. You would rather like to replace DBCP by another connection pool which is doing its job better then DBCP. For example BoneCP or Tomcat JDBC Pool maybe?       解决办法有两个     1) 将UrlWirter的Filter从web.xml中去掉或者重写destory方法     2) 将Mysql的驱动包复制一份到Tomcat的Lib目录下

上一篇:OAuth简介及sina微博开放平台
下一篇:DAC Informatica Repository Relink

相关文章

相关评论

本站评论功能暂时取消,后续此功能例行通知。

一、不得利用本站危害国家安全、泄露国家秘密,不得侵犯国家社会集体的和公民的合法权益,不得利用本站制作、复制和传播不法有害信息!

二、互相尊重,对自己的言论和行为负责。

好贷网好贷款