Tomcat报错: JDBC unregister 解决办法
投稿:lqh
这篇文章主要介绍了Tomcat报错: JDBC unregister 解决办法的相关资料,需要的朋友可以参考下
Tomcat报错: JDBC unregister 解决办法
摘要: The web application [web application] registered the JDBC driver [net.sourceforge.jtds.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.
tomcat6关闭时触发日志提示:
The web application [web application] registered the JDBC driver [net.sourceforge.jtds.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.
原因是tomcat6最新版本引入内存溢出检测阻止机制,检测到jdbc在tomcat运行时进行注册,但是当tomcat停止时没有解除注册。
有两个方法可以解决这个问题:
1、显式的解除注册
// Example: DriverManager.getDriver("jdbc:mysql://localhost:3306"); java.sql.Driver mySqlDriver = DriverManager.getDriver("YOUR DRIVER"); DriverManager.deregisterDriver(mySqlDriver);
2、使用tomcat jdbc连接池,并将jdbc驱动包拷贝至tomcat的lib下,由tomcat自己进行管理。
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
您可能感兴趣的文章:
- IntelliJ IDE运行Tomcat报错解决办法
- 解决应用启动失败但tomcat不报错的方法
- Tomcat启动时报错:java.lang.UnsatisfiedLinkError的解决
- Tomcat报错:HTTP Status 500 (Wrapper cannot find servlet class)解决办法
- tomcat报错:Wrapper cannot find servlet class ...问题解决
- CentOS 6.5上的Tomcat启动报错问题解决方法
- Tomcat ssl报错Connector attribute SSLCertificateFile must be defined when using SSL with APR解决方法
- 启动Tomcat报错Unsupported major.minor version xxx的解决方法