Could not load java.net.BindException错误解决

出现了错误异常:
信息: Illegal access: this web application instance has been stopped already.  Could not load java.net.BindException.  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:1273)
 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
 at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
 at com.mysql.jdbc.SQLError.createLinkFailureMessageBasedOnHeuristics(SQLError.java:1220)
 at com.mysql.jdbc.CommunicationsException.<init>(CommunicationsException.java:51)
 at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1070)
 at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3270)
 at com.mysql.jdbc.MysqlIO.quit(MysqlIO.java:1659)
 at com.mysql.jdbc.ConnectionImpl.realClose(ConnectionImpl.java:4296)
 at com.mysql.jdbc.ConnectionImpl.cleanup(ConnectionImpl.java:1265)
 at com.mysql.jdbc.ConnectionImpl.finalize(ConnectionImpl.java:2667)
 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)

在启动 tomcat ,并发布应用后没有问题,但是如果重新发布就出现如下异常:
this web application instance has been stopped already. Could not load java.net.BindException
this web application instance has been stopped already. Could not load com.mysql.jdbc
这是由于 MySQL 的 JDBC 驱动放在应用的 WEB-INF/lib 目录下,在重新发布时其加载了两次,故只要将其拷贝到 TOMCAT_HOME%/lib 中即可解决该问题。
解决这两个异常可以将 MySQL 的驱动文件从 WEB-INF/lib 文件夹中移动到 %TOMCAT_HOME%/lib 中
上一篇:CodeManage 源代码管理器v2.0发布


下一篇:mysql创建触发器