Illegal access: this web application instance has been stopped already .

Illegal access: this web application instance has been stopped already .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:1244)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at com.mysql.jdbc.CommunicationsException.<init>(CommunicationsException.java:155)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2723)

解决办法:
将tomcat的server.xml中的Context的reloadable设成false。
比如:<Context path="/expert" docBase="expert" debug="0" reloadable="false">

解决办法也容易,只要把tomcat的server.xml 中的reloadable="true" 改成false就行了,不过这样做就失去了热部署的优势了,对于开发不是很方便,干脆还是不改吧。这种错误不用理会.  

报错原理:

原因是因为在tomcat重启的时候,因为之前的tomcat中的线程还没有完全关闭,新启动tomcat就会报这个异常,不过这个不影响正常使用,只是跳个异常挺烦人的。使用过hibernate, spring或其他大型组件,当一个WEB应用系统中有很多类时,如果开启了Tomcat的reloadable=true,那么每当相关文件改变时, Tomcat会停止web app并释放内存,然后重新加载web app.这实在是个浩大的工程。所以我们总是在想如果能有只重载某几个类的功能,将极大的满足了我们的调试。


当response.sendRedirect("xxxx");   时,而客户端关闭了浏览器,就会出这种错.    
并非程序错误.

猜你喜欢

转载自blog.csdn.net/weixin_41060905/article/details/83002900