JDBC driver驱动问题

严重: The web application [/mine1] registered the JDBC driver [com.microsoft.sqlserver.jdbc.SQLServerDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
2012-3-11 19:20:07 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/mine1] appears to have started a thread named [AWT-Windows] but has failed to stop it. This is very likely to create a memory leak.

也就是说应用程序注册了JDBC驱动,但当程序停止时无法注销这个驱动,tomcat为了防止内存溢出,就给强制注销了。

百度加谷歌,最后得出的结论说是tomcat的问题,tomcat从6.0.24版本之后引入了内存泄漏侦测的功能,当发现系统有垃圾无法回收时,就会输出日志信息。

解决方法:

1、用旧版本的tomcat,把tomcat 6.0 换成tomcat 5.0 版本的。PS:可是我不想换啊

2、在tomcat的server.xml文件中,把
<!-- Prevent memory leaks due to use of particular java/javax APIs-->
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/>;

这个监听给关了。PS:关了据说是不会报错了,可不报错不代表没错啊。

3、貌似又涉及到Hibernate了,可这个我还没学,看不懂啊。。。。。

posted @ 2013-10-16 20:00  裴佩  阅读(602)  评论(0编辑  收藏  举报