Tomcat異常Illegal access:this web application instance has been stopped already

來源:互聯網
上載者:User

重啟Tomcat時或(tomcat服務開啟,重新部署項目時),出現如下異常:

資訊: 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:1272)
 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1232)
 at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
 at com.mysql.jdbc.CommunicationsException.<init>(CommunicationsException.java:161)
 at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2759)
 at com.mysql.jdbc.MysqlIO.quit(MysqlIO.java:1410)
 at com.mysql.jdbc.Connection.realClose(Connection.java:4947)
 at com.mysql.jdbc.Connection.cleanup(Connection.java:2063)
 at com.mysql.jdbc.Connection.finalize(Connection.java:3403)
 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重新裝載web應用程式失敗導致的。當應用程式卸載時,並不會關閉所有的線程。當tomcat已經關閉了其類載入器後,一些線程依然會繼續運行,這樣就導致出錯。不過這個不影響正常使用,不管影響不影響,看到異常資訊就不順眼。

解決方案:修改tomcat目錄下的context.xml,找到<Context>標籤,把reloadble的屬性值設為:reloadable="false",即<Context reloadable="false">。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.