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自己进行管理。
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
最后
以上就是自由棒棒糖最近收集整理的关于Tomcat报错: JDBC unregister 解决办法的全部内容,更多相关Tomcat报错:内容请搜索靠谱客的其他文章。
发表评论 取消回复