tomcat 6.0.24异常:无法加载com.mysql.jdbc.SQLError [英] tomcat 6.0.24 Exception: Could not load com.mysql.jdbc.SQLError

查看:543
本文介绍了tomcat 6.0.24异常:无法加载com.mysql.jdbc.SQLError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我经常运行centos的tomcat 5服务器(几次/天)会产生以下错误:

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的lib目录包含mysql-connector-java-5.1.8-bin.jar和mysql-connector-java-5.1.6-bin.jar,而WEB-INF / lib目录只包含mysql-connector-java-5.1.8-bin.jar。所有三个jar文件都包含SQLError类。

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.

我想消除此异常。 tomcat是否可以寻找其他地方试图找到这个类?

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

推荐答案

错误不是找不到类。由于Web应用程序已停止,因此无法加载。我怀疑在重新启动Web应用程序之后可能会发生这种情况,它会在短时间内停止运行。然后代码中的一些 finalize()方法可能试图进行一些清理太晚了。无论你的代码还是MySQL驱动程序,我都不能说。你肯定一次只能在一个目录中有一个jar版本。您可能希望将其升级到最新(现在为5.1.15)以防万一已经修复的东西可能会影响你。

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.

这篇关于tomcat 6.0.24异常:无法加载com.mysql.jdbc.SQLError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆