Web实例已经停止

时间:2011-03-22 04:47:01

标签: java tomcat java-ee

我收到此错误

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)
有人可以指导一下我在这里犯的错误。我不确定是否需要粘贴源代码。

5 个答案:

答案 0 :(得分:8)

这是因为您正在将应用程序的新实例部署到服务器,但先前实例的某个线程或连接尝试执行您编写的某些业务逻辑。这就是为什么JVM的主要部分叫做ClassLoader,告诉你非法访问:这个Web应用程序实例已经停止了#34;并抛出相应的异常...您可以在生产环境中以及手动部署应用程序重启服务器后关闭Application Server的自动部署功能。或者你可以在Class级别控制Servlet生命周期:)))&#34; pre deploy&#34;关闭所有连接或停止一些线程。或者使用复杂的方法使用ManagedExecutorService控制线程。祝你好运!!!

答案 1 :(得分:7)

好像我正在创建已经创建的东西的实例..我删除了实例,现在它工作正常

答案 2 :(得分:2)

您使用的是Netbeans吗?我有一个类似的错误,除了它无法加载 oracle.sql.lnxlib 。像许多海报所指出的那样,这个错误通常与Tomcat缓存应用程序的多个实例有关。通过在Netbeans中取消部署应用程序的旧实例,同事能够为我解决问题。为此,请转到服务标签&gt;服务器,然后双击 Apache Tomcat或TomEE ,在打开netbeans后运行应用程序一次后,应出现一个Web应用程序文件夹。如果双击它,您应该看到应用程序的实例出现。您应该能够右键单击它们,然后单击取消部署(您可能必须右键单击它们并先点击停止)。最后,您应该在构建和运行应用程序之前停止然后启动tomcat。

希望这会有所帮助。

See attached screenshot for clarity

答案 3 :(得分: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

祝你好运

答案 4 :(得分:0)

我在Ubuntu服务器上的Tomcat上收到此错误....最终解决了此问题,方法是先使用“ systemctl stop tomcat”关闭Tomcat,然后再执行“ sudo reboot”,然后重新启动该框,再次启动Tomcat < / p>