[英]Illegal access: this web application instance has been stopped already. Could not load org.apache.log4j.spi.NOPLoggerRepository
I am using Netbeans 6.7
with Tomcat 6.0
and jasper reports for generating reports in a web application. 我正在将Netbeans 6.7
与Tomcat 6.0
和jasper报告一起用于在Web应用程序中生成报告。 I always get this exception when I run my application. 运行应用程序时,总是会遇到此异常。 can someone please help me out? 有人可以帮我吗?
The exception is 例外是
INFO: Illegal access: this web application instance has been stopped already. Could not load org.apache.log4j.spi.NOPLoggerRepository. 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:1566)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at org.apache.log4j.LogManager.getLoggerRepository(LogManager.java:175)
at org.apache.log4j.LogManager.getLogger(LogManager.java:199)
at org.apache.log4j.Logger.getLogger(Logger.java:105)
at org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:283)
at org.apache.commons.logging.impl.Log4JLogger.info(Log4JLogger.java:193)
at org.hibernate.connection.DriverManagerConnectionProvider.close(DriverManagerConnectionProvider.java:147)
at org.hibernate.connection.DriverManagerConnectionProvider.finalize(DriverManagerConnectionProvider.java:142)
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)
可能是由于内存问题所致,我收到了此消息以及java.lang.OutOfMemoryError:Java堆空间,将启动参数调整为:-XX:PermSize = 512M -Xms1024m -Xmx4096m解决了该问题。
I found I would get a similar error occasionally while running my JSP web application with Netbeans on Tomcat and always while debugging it. 我发现有时在Tomcat上使用Netbeans运行我的JSP Web应用程序时,有时在调试它时,都会遇到类似的错误。 In my case it was "could not load Java.lang.math or Oracle.lnx.lib" . 在我的情况下,它是“无法加载Java.lang.math或Oracle.lnx.lib” 。 A coworker had me undeploy the web application instances from tomcat and it solved the problem. 一个同事让我取消部署了tomcat的Web应用程序实例,它解决了问题。 To undeploy a webapplication instance, go to the Services Tab > Servers and then double click on Apache Tomcat or TomEE and after running the application once since opening netbeans, a Web Applications Folder should appear. 要取消部署Web应用程序实例,请转至“ 服务”选项卡>“服务器” ,然后双击Apache Tomcat或TomEE,并且自打开Netbeans运行该应用程序一次后,将出现一个“ Web应用程序文件夹”。 If you double click on that, you should see instances of your application appear. 如果双击它,应该会看到您的应用程序实例出现。 You should be able to right click them and then click undeploy (you may have to right click them and hit stop first). 您应该能够右键单击它们,然后单击取消部署(您可能必须右键单击它们,然后先单击停止)。 Finally, you should stop and then start tomcat before building and running your application. 最后,在构建和运行应用程序之前,应该停止然后启动tomcat。
Hope this helps. 希望这可以帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.