com/mysql/jdbc/sqlerror,tomcat 6.0.24异常:无法加载com.mysql.jdbc.SQLError

My tomcat 5 server running on centos frequently (several times / day) produces the following error:

Apr 7, 2011 11:02:30 PM org.apache.catalina.loader.WebappClassLoader loadClass

INFO: Illegal access: this web application instance has been stopped already. Could not load com.mysql.jdbc.SQLError. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.

java.lang.IllegalStateException

at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1370)

at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1329)

at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3291)

at com.mysql.jdbc.MysqlIO.quit(MysqlIO.java:1665)

at com.mysql.jdbc.ConnectionImpl.realClose(ConnectionImpl.java:4411)

at com.mysql.jdbc.ConnectionImpl.cleanup(ConnectionImpl.java:1315)

at com.mysql.jdbc.ConnectionImpl.finalize(ConnectionImpl.java:2761)

at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)

at java.lang.ref.Finalizer.runFinalizer(Unknown Source)

at java.lang.ref.Finalizer.access$100(Unknown Source)

at java.lang.ref.Finalizer$FinalizerThread.run(Unknown Source)

tomcat's lib directory contains mysql-connector-java-5.1.8-bin.jar and mysql-connector-java-5.1.6-bin.jar, while the WEB-INF/lib directory only contains mysql-connector-java-5.1.8-bin.jar. All three jar files contain the SQLError class.

I'd like to eliminate this exception. Could tomcat be looking somewhere else to try to find this class?

解决方案

The error is not that the class can't be found. It's not being allowed to load because the web application has been stopped. I suspect this might be happening after the web application is restarted, where it's down for a short period of time. Then some finalize() method in the code is probably trying to do some cleanup too late. Whether or not that's in your code or the MySQL driver I can't say. You definitely should only have one version of a jar in a directory at a time. You might want to upgrade it to the latest (5.1.15 right now) in case something has been fixed that might be affecting you.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值