我用的tomcat是apache-tomcat-6.0.36,在启动的时候出现以下的异常,虽然程序依然可以运行,但是异常就得解决
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:1566)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3364)
at com.mysql.jdbc.MysqlIO.quit(MysqlIO.java:1708)
at com.mysql.jdbc.ConnectionImpl.realClose(ConnectionImpl.java:4371)
at com.mysql.jdbc.ConnectionImpl.cleanup(ConnectionImpl.java:1360)
at com.mysql.jdbc.ConnectionImpl.finalize(ConnectionImpl.java:2728)
at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:101)
at java.lang.ref.Finalizer.access$100(Finalizer.java:32)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:190)
参考http://radio123.iteye.com/blog/1396760的解决方案:
问题补充:网站能正常工作,包都导对的
解决方法:
如果用连接池 把mysql的驱动包放入到 tomcat5.x 版本的 common\lib,如果是tomcat 6.x就直接放到 lib目录下 ,的下面 这样就会好 如果用jdbc 那就放到工程下面的lib就ok了
但是如果只把mysql的驱动包放到tomcat的lib目录还不够,还要把项目WEB-INF/lib目录上的mysql驱动包删旧,重启即可。
--转自