信息:非法访问:此网络应用程序实例已经停止运行。

11
我遇到了这个错误。
Mar 22, 2011 12:36:01 AM org.apache.catalina.loader.WebappClassLoader findResourceInternal
INFO: Illegal access: this web application instance has been stopped already.  Could not load META-INF/services/javax.xml.parsers.DocumentBuilderFactory.  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.
Mar 22, 2011 12:36:01 AM org.apache.catalina.loader.WebappClassLoader loadClass
INFO: Illegal access: this web application instance has been stopped already.  Could not load com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl.  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:1562)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
    at javax.xml.parsers.FactoryFinder.getProviderClass(Unknown Source)
    at javax.xml.parsers.FactoryFinder.newInstance(Unknown Source)
    at javax.xml.parsers.FactoryFinder.find(Unknown Source)
    at javax.xml.parsers.DocumentBuilderFactory.newInstance(Unknown Source)
    at com.xmlparser.XmlParser.parseXmlFile(XmlParser.java:33)
    at com.xmlparser.XmlParser.<init>(XmlParser.java:25)
    at com.jobs.SendRoutineMessagesJob.execute(SendRoutineMessagesJob.java:29)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:199)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:546)

请问有人能指导我在这里犯了什么错误吗?我不确定是否需要粘贴源代码。

我遇到了同样的问题,日志不断填充,服务器陷入循环而无法处理请求。当我尝试重新加载一些东西时,比如 xhtml 文件,类文件... 这种情况就会发生。 - mist
5个回答

12

因为您正在将应用程序的新实例部署到服务器上,但是先前实例的某些线程或连接尝试执行您编写的业务逻辑。这就是为什么JVM的主要部分ClassLoader会向您发出“非法访问:此Web应用程序实例已经停止”并抛出相应异常...您可以关闭应用程序服务器的自动部署功能(在生产环境中最好如此),并在部署应用程序后手动重新启动服务器。或者您可以在类级别上控制Servlet Life Cycle :))) 在“pre deploy”期间关闭所有连接或停止一些线程。或使用ManagedExecutorService以复杂的方式控制线程。祝您好运!


6

似乎我正在创建某个已经存在的实例。我删除了该实例,现在它运行正常。


5
您是否正在使用Netbeans?我曾遇到类似的错误,只是提示无法加载oracle.sql.lnxlib。正如许多帖子所指出的那样,这个错误通常与Tomcat缓存应用程序的多个实例有关。我的一位同事通过在Netbeans中卸载旧的应用程序实例来解决了我的问题。要这样做,请转到服务选项卡>服务器,然后双击Apache Tomcat或TomEE,在打开Netbeans后运行应用程序一次后,将出现一个Web应用程序文件夹。如果您双击它,应该会看到应用程序的实例。您应该能够右键单击它们,然后单击卸载(您可能需要先右键单击它们并停止)。最后,在构建和运行应用程序之前,您应该停止然后启动tomcat。

希望这可以帮助您。

请查看附加的屏幕截图以获得更清晰的说明

enter image description here


1
如果您使用gradle,会出现错误。
Illegal access: this web application instance has been stopped already. Could not load []. 

以下堆栈跟踪是为了调试目的以及尝试终止导致非法访问的线程而抛出的。 您可以将mysql-connect-java更改为mysql: mysql-connector-java: 8.0.13 祝好运

0
我在Ubuntu服务器上的Tomcat上遇到了这个错误....最终通过使用"systemctl stop tomcat"关闭Tomcat,然后执行"sudo reboot",再次启动Tomcat解决了它。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接