tomcat启动报错如下:
INFO: Illegal access: this web application instance has been stopped already. Could not load com.mysql.jdbc.Util. 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.CommunicationsException.<init>(CommunicationsException.java:180)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2652)
at com.mysql.jdbc.MysqlIO.quit(MysqlIO.java:1345)
at com.mysql.jdbc.Connection.realClose(Connection.java:4784)
at com.mysql.jdbc.Connection.cleanup(Connection.java:2040)
at com.mysql.jdbc.Connection.finalize(Connection.java:3296)
at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)
at java.lang.ref.Finalizer.access$100(Finalizer.java:14)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160)
解决办法:这是由于mysql的jdbc驱动放在web-info 下面的lib目录下在重新发布时加载了两次,故只要将其拷贝到tomcat的lib目录下就可以了。
总结:删除web-inf/lib里面的驱动包,把他复制到tomcat的lib里
--转自