当 tomcat 关闭时,我在 catalina.out 日志文件中收到以下消息。我正在使用 Tomcat 7.x 和 Tomcat JDBC 数据源。
Mar 26, 2013 1:17:52 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [/my_webapp] registered the JDBC 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.
Mar 26, 2013 1:17:52 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/my_webapp] appears to have started a thread named [MySQL Statement Cancellation Timer] but has failed to stop it. This is very likely to create a memory leak.
第一个声称 DataSource 已被强制注销,这很好。然而这很奇怪,因为我已经像这样配置了销毁方法:
<bean name="dataSource" class="org.apache.tomcat.jdbc.pool.DataSource" destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://localhost:3306/mydb"/>
<property name="username" value="root"/>
<property name="password" value="password"/>
</bean>
不知道为什么我得到第二个。关于“MySQL 语句取消计时器”的一个。
任何帮助表示赞赏
编辑1:我尝试了@Zelldon 建议的修复程序,它消除了第一个错误。但是MySQL Statement Cancellation Timer
相关问题仍然存在