[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13661489#comment-13661489 ]
Nick Williams commented on LOG4J2-223: -------------------------------------- Try going to http://localhost:8080/log4j-223a/files directly instead of http://localhost:8080/log4j-223a/. Cause: log4j-taglib*.jar contains a TLD (Tag Library Descriptor) used in the JSPs. The container must scan this JAR to pick up the TLD. However, since Log4j has never had a tag library until now, Tomcat has an exclusion built in that says not to scan log4j*.jar files for tag libraries (for which I have filed a bug, https://issues.apache.org/bugzilla/show_bug.cgi?id=54770). In my local Tomcat install, I removed the log4j*.jar exclusion from catalina.properties. You can either do the same, or go to http://localhost:8080/log4j-223a/files directly to skip all JSPs and therefore avoid TLD-loading errors. This is unrelated to the issue at hand, but is the cause of the new errors you saw. Just go to http://localhost:8080/log4j-223a/files directly (or remove the log4j*.jar exclusion from TOMCAT_HOME/conf/catalina.properties) to isolate the IllegalStateException behavior. It looks like your change may fix the error being displayed, but I don't think it resolves the underlying issue. The underlying issue appears to be a memory leak. By registering a shutdown hook, Log4j creates a thread with classes loaded in the servlet context class loader but held on to by the JVM. When Tomcat undeploys the application, the garbage collector will be unable to collect the servlet context class loader and any classes it loaded because of this. If you redeploy and undeploy the application several times, you will eventually get an {{OutOfMemoryError: perm gen space}} exception. What is this code trying to accomplish? Why are we registering a shutdown hook here? I question the necessity of this code, and its existence is creating a dangerous situation for web applications. > IlliegalStateException thrown during Tomcat shutdown > ---------------------------------------------------- > > Key: LOG4J2-223 > URL: https://issues.apache.org/jira/browse/LOG4J2-223 > Project: Log4j 2 > Issue Type: Bug > Components: Core > Affects Versions: 2.0-beta5 > Reporter: Ralph Goers > Priority: Critical > Fix For: 2.0-beta7 > > Attachments: log4j-223.war > > > Apr 25, 2013 3:03:33 PM org.apache.catalina.core.StandardServer await > INFO: A valid shutdown command was received via the shutdown port. Stopping > the Server instance. > Apr 25, 2013 3:03:33 PM org.apache.coyote.AbstractProtocol pause > INFO: Pausing ProtocolHandler ["http-nio-8080"] > Apr 25, 2013 3:03:33 PM org.apache.coyote.AbstractProtocol pause > INFO: Pausing ProtocolHandler ["ajp-nio-8009"] > Apr 25, 2013 3:03:33 PM org.apache.catalina.core.StandardService stopInternal > INFO: Stopping service Catalina > Apr 25, 2013 3:03:33 PM org.apache.coyote.AbstractProtocol stop > INFO: Stopping ProtocolHandler ["http-nio-8080"] > Apr 25, 2013 3:03:33 PM org.apache.coyote.AbstractProtocol stop > INFO: Stopping ProtocolHandler ["ajp-nio-8009"] > Apr 25, 2013 3:03:33 PM org.apache.coyote.AbstractProtocol destroy > INFO: Destroying ProtocolHandler ["http-nio-8080"] > Apr 25, 2013 3:03:33 PM org.apache.coyote.AbstractProtocol destroy > INFO: Destroying ProtocolHandler ["ajp-nio-8009"] > Apr 25, 2013 3:03:33 PM org.apache.catalina.loader.WebappClassLoader loadClass > INFO: Illegal access: this web application instance has been stopped already. > Could not load org.apache.logging.log4j.core.config.NullConfiguration. 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:1351) > at > org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1310) > at > org.apache.logging.log4j.core.LoggerContext.stop(LoggerContext.java:171) > at > org.apache.logging.log4j.core.LoggerContext$ShutdownThread.run(LoggerContext.java:389) > Exception in thread "Thread-18" java.lang.NoClassDefFoundError: > org/apache/logging/log4j/core/config/NullConfiguration > at > org.apache.logging.log4j.core.LoggerContext.stop(LoggerContext.java:171) > at > org.apache.logging.log4j.core.LoggerContext$ShutdownThread.run(LoggerContext.java:389) > Caused by: java.lang.ClassNotFoundException: > org.apache.logging.log4j.core.config.NullConfiguration > at > org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1465) > at > org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1310) > ... 2 more -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-dev-h...@logging.apache.org