[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13838272#comment-13838272 ] Erik Tennant commented on LOG4J2-223: - We are still seeing this exception in Tomcat 7.0.47 with log4j2 beta9. 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:1588) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547) at org.apache.logging.log4j.core.LoggerContext.stop(LoggerContext.java:210) at org.apache.logging.log4j.core.LoggerContext$ShutdownThread.run(LoggerContext.java:437) Exception in thread "Thread-4" java.lang.NoClassDefFoundError: org/apache/logging/log4j/core/config/NullConfiguration at org.apache.logging.log4j.core.LoggerContext.stop(LoggerContext.java:210) at org.apache.logging.log4j.core.LoggerContext$ShutdownThread.run(LoggerContext.java:437) Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.core.config.NullConfiguration at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1702) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547) ... 2 more We can set debug points and verify that Log4jServletContainerInitializer gets called on startup, and so does Log4jServletContextListener. However, on server shutdown, Log4jServletContextListener.contextDestroyed does not getting invoked. Note, that we are using spring's WebApplicationInitializer to bootstrap our webapp, we do not have a web.xml file. We configure log4j2 via a log4j2.xml on the classpath. Any advice? > IllegalStateException 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 > > > {noformat}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) >
[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13828906#comment-13828906 ] Barış Taşkend commented on LOG4J2-223: -- I am facing same problem in Websphere. Did you solve this problem with this way Nick? > IllegalStateException 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 > > > {noformat}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{noformat} -- This message was sent by Atlassian JIRA (v6.1#6144) - To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-dev-h...@logging.apache.org
[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13828911#comment-13828911 ] Barış Taşkend commented on LOG4J2-223: -- I am using log4j beta v9. But in websphere throws same exception. how did you solve this problem? > IllegalStateException 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 > > > {noformat}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{noformat} -- This message was sent by Atlassian JIRA (v6.1#6144) - To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-dev-h...@logging.apache.org
[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13669310#comment-13669310 ] Nick Williams commented on LOG4J2-223: -- That makes sense to me. I'll create it and close this. > IllegalStateException 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 > > > {noformat}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{noformat} -- 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
[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13669298#comment-13669298 ] Ralph Goers commented on LOG4J2-223: Should all this enhancement stuff go into a separate Jira? It feels like the issue reported here has been resolved. > IllegalStateException 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 > > > {noformat}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{noformat} -- 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
[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13668708#comment-13668708 ] Gary Gregory commented on LOG4J2-223: - Nice deep dive Nick. I do like the idea of one less jar for a simpler for to configure web apps. This would add the Servlet API as an optional runtime dependency in Core, which is OK. > IllegalStateException 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 > > > {noformat}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{noformat} -- 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
[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13668682#comment-13668682 ] Nick Williams commented on LOG4J2-223: -- Okay, based on all of this, here are my suggestions on how I would improve this (sorry for my scarcity lately ... trying to catch up on chapters for the book). These suggestions are based on the following goals: # Design web application support so that users of simple Log4j configurations (not using JNDI looks for logging) don't have to do any additional configuration to get Log4j to "just work" in a Servlet container. This goal is made with the understanding that this is only possible for users of Servlet 3.0, 3.1, or higher. Users of Servlet 2.5 will have to manually configure listeners and filters. It's the only way. # Eliminate the need for web applications to have an additional JAR just to support proper configuration. # Improve the documentation considerably so that it is abundantly clear how Log4j works in web applications. With these goals in mind, here are my recommendations: * Get rid of the log4j-web module and move this stuff into log4j-core. We'll need [~timothyjward]'s input on how this could impact OSGi support. In theory, I don't think we should have a problem. No other Log4j classes will refer to the listener or filter. These classes will only ever get loaded BY the Servlet container, in which case the Servlet API will already be loaded, so I don't think it would be possible to get {{NoClassDefFoundError}} s. * Create a {{/META-INF/web-fragment.xml}} file with the contents noted below. This will ensure that the Log4j fragment is loaded before any other fragments. * Create a {{Log4jWebInitializer}} class (doesn't implement any interfaces, package-private) to properly initialize and de-initialize Log4j in a Servlet container. It works like this: If the context parameters currently required by the {{JNDIContextFilter}} exist, it initializes Log4j the way {{JNDIContextFilter}} currently does. If they don't exist, it initializes Log4j the way {{Log4jContextListener}} currently does. * Create a {{Log4jServletContainerInitializer implements ServletContainerInitializer}} and a {{/META-INF/services/javax.servlet.ServletContainerInitializer}} file to go along with it. This initializer: ** Initializes Log4j properly using the {{Log4jWebInitializer}}. ** Installs a private listener to de-initialize Log4j when the container shuts down the application using the {{Log4jWebInitializer}}. ** Installs the {{NamedContextFilter}} (renamed from {{JNDIContextFilter}}), which doesn't do any initialization/deinitialization, it just does what it currently does for {{doFilter}}. * Change the existing {{Log4jContextListener}} to use the {{Log4jWebInitializer}}. * Create a new manual page directly under the "MANUAL" menu heading on the homepage that explains how to use Log4j in a Servlet container: ** If you're using Servlet 3.0 or higher, it "just works," but if you're also using JNDI you need to create the proper context parameters. ** If you're using Servlet 2.5, you MUST add the {{Log4jContextListener}} (and the {{NamedContextFilter}} and context parameters if you're using JNDI) to your deployment descriptor. Now, to address some questions: # "What to do about JBoss 5, which doesn't support web-fragment.xml?" JBoss 5 doesn't support web-fragment.xml because it's a Servlet 2.5 container, not a Servlet 3.0 container. Users of JBoss 5 would follow the Servlet 2.5 instructions just like all other users. Users of JBoss 6, 7, 8, etc., would follow the Servlet 3.0 instructions ("don't do anything"). # "A container with multiple web applications. The Log4j jars are in the Tomcat classpath and they all share the same configuration file." versus "A container with multiple web applications. Each has their own copy of the log4j jars and each has their own configuration file." Easy! The {{Log4jServletContainerInitializer}} will get executed for every application, whether the Log4j JARs are in the Tomcat classpath or in /WEB-INF/lib (this is per the Servlet specification). Each application will get its own context. Regardless of where the JARs are, that context will load the application's configuration file if it has its own, and will load the shared configuration if it doesn't have its own. Thoughts? {code:xml|title=web-fragment.xml} log4j {code} > IllegalStateException 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 Fo
[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13663786#comment-13663786 ] Ralph Goers commented on LOG4J2-223: 1. JNDIContextSelector implements the NamedContextSelector interface. In theory, JNDIContextFilter can work on any NamedContextSelector so I guess it really should be named NamedContextFilter. 2. If the context isn't found in the ThreadLocal then JNDIContextSelector performs a JNDILookup to locate the context. Using the ThreadLocal avoids the need to do the JNDI lookup, which is much more expensive. 3. Both should work fine if they are used together. Log4jContextListener will get control during web app deployment and set the context as a ServletContext attribute. On each request JNDIContextFilter will get the context from the attribute and store it in a ThreadLocal. Note that all the apps where I work run in JBoss 5, which doesn't support web-fragment.xml as far as I know. Also, I'd still like to know how to handle the two scenarios I asked about above. > IllegalStateException 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 > > > {noformat}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{noformat} -- 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
[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13663650#comment-13663650 ] Nick Williams commented on LOG4J2-223: -- Ralph, My bad, I typoed. Meant to say the sample WAR was compiled with Java 7, not Java 6. If someone could respond to my analysis in the comment immediately above and let me know if my assumptions are correct and what the answers to my questions are, I'd be in a good position to make some recommendations about how I think this could all be improved, vis-à-vis {{web-fragment.xml}}. > IllegalStateException 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 > > > {noformat}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{noformat} -- 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
[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13661688#comment-13661688 ] Ralph Goers commented on LOG4J2-223: Provided the Log4jContextListener is configured in web.xml shutdown now works fine with Tomcat 7 with revision 1484363. FWIW, the sample war provided was compiled with Java 7 not Java 6. > IllegalStateException 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 > > > {noformat}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{noformat} -- 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
[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13661621#comment-13661621 ] Nick Williams commented on LOG4J2-223: -- I think you misunderstood my comment. I'm not suggesting the shutdown hook should be removed completely. I fully recognize it is needed in standalone apps. You said, "You are correct that the {{LoggerContext}} adds the shutdown hook. I suppose the way to deal with that is to add another attribute to the configuration element to enable the hook." My response was that I don't think it's a _must_ to add the ability to enable/disable the hook because the listener and filter take actions that remove the hook. I think you're wrong about something, though. You said, "With the {{BasicContextListener}} [I think you meant BasicContextSelector] the behavior you should get should match Log4j 1.x - it won't shutdown the {{LoggerContext}} and the appenders, etc. won't be gracefully cleaned up. Adding the context listener provides that." That is not completely true all the time. Since {{LoggerContext}} creates a shutdown hook, it _will_ shut down the {{LoggerContext}} and the appenders if the servlet container is shut down without undeploying the application. The only time the {{LoggerContext}} and appenders won't be shut down is if the application is undeployed _before_ the container is shut down. Before we start discussing web-fragment.xml, etc., I want to get {{Log4jContextListener}} and {{JNDIContextFilter}} straight. - {{Log4jContextListener}} does the following: -- On startup, it calls {{Configurator.initialize}} which loads the Log4j configuration and creates the correct selector ({{BasicContextSelector}}, {{ClassLoaderContextSelector}}, {{JNDIContextSelector}}, etc. based on properties). It then adds the returned {{LoggerContext}} to the {{ServletContext}} as a context attribute. -- On shutdown, it calls {{Configurator.shutdown}} which calls {{stop()}} on the {{LoggerContext}} which, incidentally, results in the shutdown hook being removed. - {{JNDIContextFilter}} does the following: -- On startup, it checks if the servlet context attribute for a {{LoggerContext}} is set. If it is, it does nothing and the filter essentially becomes a no-op. It then gets the {{LoggerContextFactory}} from the {{LogManager}}. _If_ the factory is a {{Log4jContextFactory}} and _if_ its selector is a {{NamedContextSelector}} (*note: NOT a JNDIContextSelector*), it adds the {{LoggerContext}} to the {{ServletContext}} as a context attribute. Otherwise, the filter essentially becomes a no-op. -- On each request, it looks for the {{LoggerContext}} on the {{ServletContext}} and sets it to {{ContextAnchor.THREAD_CONTEXT}} if it exists. -- On shutdown, it stops the {{LoggerContext}} which, incidentally, results in the shutdown hook being removed. -- Questions: --- Why is the {{JNDIContextFilter}} working with the {{NamedContextSelector}} instead of the {{JNDIContextSelector}} as previously explained? --- Why does {{JNDIContextFilter}} have to set a thread local in {{doFilter}}? I don't see how the correct loggers won't be used if the thread local isn't set. --- Am I correct in assuming that, based on all of this, the {{JNDIContextFilter}} will not work correctly use the {{NamedContextSelector}} if the {{Log4jContextListener}} is also in use (as-written), and will (perhaps incorrectly) add the {{LoggerContext}} created in the {{Log4jContextListener}} to the thread local if both are used? > IllegalStateException 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 > > > {noformat}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, 2
[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13661606#comment-13661606 ] Ralph Goers commented on LOG4J2-223: If web-fragment.xml is in core how would you handle the following two scenarios: 1. A container with multiple web applications. The log4j jars are in the Tomcat classpath and they all share the same configuration file. 2. A container with multiple web applications. Each has their own copy of the log4j jars and each has their own configuration file. > IllegalStateException 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 > > > {noformat}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{noformat} -- 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
[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13661605#comment-13661605 ] Ralph Goers commented on LOG4J2-223: Oops. I missed the comment about web-fragment.xml. That is a good idea but it needs to make sure that whatever it is doing is applicable to all web apps that would be including the log4j-web jar. > IllegalStateException 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 > > > {noformat}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{noformat} -- 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
[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13661604#comment-13661604 ] Ralph Goers commented on LOG4J2-223: The shutdown hook is necessary in applications that aren't web apps (i.e. - there is no equivalent of a Servlet context listener). Please remember that Log4j has to work in standalone apps, web apps where the jars in the Tomcat ClassLoader, web apps where each has the log4j classes, ejbs (yuck), etc. As I said, with the BasicContextListener the behavior you should get should match Log4j 1.x - it won't shutdown the LoggerContext and the appenders, etc. won't be gracefully cleaned up. Adding the context listener provides that. A filter and context listener do very different things. You can't set a ThreadLocal in a context listener. Likewise, unless you are using the JNDIContextSelector you don't really want to set the ThreadLocal. ContextSelectors are chosen via a system property. They can also be specified in the file "log4j2.component.properties" which is read when LogManager is first called. > IllegalStateException 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 > > > {noformat}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{noformat} -- 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
[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13661603#comment-13661603 ] Nick Williams commented on LOG4J2-223: -- Also, you said "You would use the {{JNDIContextFilter}} when you use the {{JNDIContextSelector}}." But I'm seeing a chicken-and-egg problem. If you're running Log4j in a web application, how do you specify that it should use the {{JNDIContextSelector}} before the {{JNDIContextFilter}} is initialized? > IllegalStateException 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 > > > {noformat}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{noformat} -- 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
[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13661602#comment-13661602 ] Nick Williams commented on LOG4J2-223: -- I don't think the hook _has_ to be able to be enabled/disabled. {{Log4jContextListener}} calls {{stop()}} on the {{LoggerContext}}, and {{stop()}} removes the shutdown hook. So, used this way, the shutdown hook isn't a problem, it just isn't used. That's why everything's okay when using the {{BasicContextSelector}}. (I'm not saying it's a _bad_ idea to provide way to enable/disable the shutdown hook. It wouldn't hurt.) So here are the philosophical or real issues that need to be resolved/answered, from my perspective: # Why does {{BasicContextSelector}} work and {{ClassLoaderContextSelector}} not work in a web application when a {{Log4jContextListener}} is properly used? # Is there any way to make logging "just work" in a web application without creating a listener and/or filter? I'm starting to become convinced that there isn't, and that disappoints me. # Would {{Log4jContextListener}} and {{JNDIContextFilter}} ever both be used at the same time, and would doing that cause a malfunction? Assuming the ultimate conclusion is that logging can't "just work" in a web application and a listener/filter is required, I would like to drastically simplify usage of the log4j-web module. My thoughts on it are: # There should only be a listener, not a filter. # There should be no init parameters; everything should be automatic and follow normal Log4j conventions. # There should be a {{META-INF/web-fragment.xml}} file that creates the filter automatically so that if the user is using a Servlet 3.0 or newer container he doesn't even have to consciously create the filter, he just has to include the JAR. # It should be in the Core module, so that it works automatically in web applications. I make these arguments because, here I am, a committer on the project and an avid reader of the documentation, and I still had no idea the {{Log4jContextListener}} and/or {{JNDIContextFilter}} were required to make logging work properly in a web application. > IllegalStateException 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 > > > {noformat}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.con
[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13661599#comment-13661599 ] Ralph Goers commented on LOG4J2-223: You would use the JNDIContextFilter when you use the JNDIContextSelector. The context filter locates it via a JNDI lookup and then stores it in a ThreadLocal. Then whenever the LoggerContext is needed it is retrieved from the ThreadLocal. > IllegalStateException 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 > > > {noformat}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{noformat} -- 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
[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13661597#comment-13661597 ] Ralph Goers commented on LOG4J2-223: Remko stated above that if you use the BasicContextSelector with the Log4jContextListener everything is good. However, if you use the ClassLoaderContextSelector you still get the message FAIL - Unable to delete [C:\apps\apache-tomcat-7.0.40\webapps\log4j-223]. The continued presence of this file may cause problems. This implies that ClassLoaderContextSelector is hanging onto something. You are correct that the LoggerContext adds the shutdown hook. I suppose the way to deal with that is to add another attribute to the configuration element to enable the hook. > IllegalStateException 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 > > > {noformat}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{noformat} -- 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
[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13661594#comment-13661594 ] Nick Williams commented on LOG4J2-223: -- In addition to my comment above, I was looking through the log4j-web source for a minute and I'm a little confused. What's the difference between {{Log4jContextListener}} and {{JNDIContextFilter}} and when would you use one or the other or both? > IllegalStateException 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 > > > {noformat}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{noformat} -- 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
[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13661591#comment-13661591 ] Nick Williams commented on LOG4J2-223: -- Okay, I think I understand better. I don't think the problem is in the selector. Regardless of which selector is being used, the {{o.a.l.l.core.LoggerContext}} class is still the class ultimately instantiated. _That_ class is the one adding the shutdown hook. The shutdown hook is responsible for the class loader memory leak, because the Runtime class's holding an instance of the shutdown hook means that the {{LoggerContext.ShutdownHook}} class can't be unloaded, which means the class loader and all of the classes it holds can't be garbage collected. > IllegalStateException 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 > > > {noformat}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{noformat} -- 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
[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13661586#comment-13661586 ] Ralph Goers commented on LOG4J2-223: See http://logging.apache.org/log4j/2.x/manual/architecture.html. Ceki does a good job of explaining the Logback LoggerContext and ContextSelector in his documentation. In particular look at http://logback.qos.ch/manual/loggingSeparation.html#tamingStaticRefs. The LoggerContext is the "anchor point" for all the logging. It references the configuration. The ClassLoaderContextSelector attempts to solve the problem Ceki described in the Taming Static Refs section. It creates LoggerContexts based on the ClassLoader that loaded the caller to getLogger. Thus, assuming the Log4j jars are on the Tomcat classpath, loggers should be able to be declared as static and still be cleaned up properly. I made this ContextSelector the default to insure that it would get exposure and testing. I'm suspecting however, that there is something that isn't being accounted for. > IllegalStateException 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 > > > {noformat}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{noformat} -- 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
[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13661583#comment-13661583 ] Nick Williams commented on LOG4J2-223: -- A couple of things, Ralph: # {{ClassLoaderContextSelector}} appears to be using {{getCallerClass}} like {{ThrowableProxy}} was, which means it will break on Java 8. The same check for method parameters needs to be performed here. As in {{ThrowableProxy}}, I again wonder why we're looping through methods looking for one named {{getCallerClass}} instead of just calling {{getMethod("getCallerClass", int.class)}}. # I'm not exactly sure what the {{ContextSelector}} and {{LoggerContext}} do, and I don't understand the difference between {{BasicContextSelector}} and {{ClassLoaderContextSelector}}. Could you enlighten me? > IllegalStateException 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 > > > {noformat}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{noformat} -- 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
[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13661579#comment-13661579 ] Nick Williams commented on LOG4J2-223: -- So, in Tomcat anyway, Object#finalize() on a basic class appears to always be called if the application is undeployed while Tomcat continues to run, but it is not called if Tomcat just shuts down. So, unfortunately, this is not an acceptable replacement. :-/ > IllegalStateException 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 > > > {noformat}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{noformat} -- 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
[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13661577#comment-13661577 ] Ralph Goers commented on LOG4J2-223: I suspect that the "real" solution is going to be to make the BasicContextSelector the default. It should cause the behavior to be just like Log4j 1. I'm not really sure what ClassLoaderContextSelector is doing that is causing the problem though. > IllegalStateException 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 > > > {noformat}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{noformat} -- 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
[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13661573#comment-13661573 ] Nick Williams commented on LOG4J2-223: -- The problem with {{Object#finalize()}}, it would appear after brief experimentation, is that it isn't called in a standalone application at JVM shutdown, so the shutdown hook would still be needed there. I'm going to continue to experiment a bit... > IllegalStateException 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 > > > {noformat}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{noformat} -- 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
[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13661572#comment-13661572 ] Nick Williams commented on LOG4J2-223: -- Fair enough, but I still think there's a "better way" than requiring users to configure a listener. To me, philosophically, logging should "just work." What about [Object#finalize()|http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html#finalize()]? If we created a finalizer for {{LoggerContext}}, it could check if the context had been stopped, and stop it if it had not. Then we wouldn't need a shutdown hook. In theory (and this would need to be tested), without a shutdown hook the {{LoggerContext}} would be garbage collected as soon as the web application was undeployed, resulting in the {{LoggerContext}} being closed without a listener. > IllegalStateException 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 > > > {noformat}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{noformat} -- 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
[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13661571#comment-13661571 ] Ralph Goers commented on LOG4J2-223: Item 1 is a problem. I have a feeling I know what is causing it. I suspect there is a relationship between the LoggerContext and classloader that is not being removed. As for item 2 - Log4j 1 "just works" by not doing anything. That doesn't mean it is better. It doesn't close files or perform any cleanup. This may result in the loss of data during shutdown depending on how the appenders work. > IllegalStateException 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 > > > {noformat}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{noformat} -- 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
[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13661569#comment-13661569 ] Nick Williams commented on LOG4J2-223: -- I have two issues with all of this: # "FAIL - Unable to delete [C:\apps\apache-tomcat-7.0.40\webapps\log4j-223]. The continued presence of this file may cause problems." <-- This means Log4j has a memory leak in web applications. The Log4j classes are still loaded by a class outside the web application and can't be garbage collected. # Log4j 1 did not require users to configure a listener in order for logging to work properly. Log4j 2 users should not have to, either. It should "just work" like Log4j 1 did. If the only purpose of the log4j-web module is to make Log4j 2 work properly in web applications, I suggest that it should be removed completely and a better way should be found. Like I said, Log4j 1 works just fine without a listener. > IllegalStateException 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 > > > {noformat}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{noformat} -- 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
[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13661524#comment-13661524 ] Remko Popma commented on LOG4J2-223: I added the following text to the documentation in /web/src/site/xdoc/index.xml: ... To register this listener, make sure that the log4j-web-2.0.jar file is in the classpath (either in your web application's WEB-INF/lib directory or in the container's classpath) and add the following snippet to your web.xml: {code} org.apache.logging.log4j.core.web.Log4jContextListener {code} > IllegalStateException 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 > > > {noformat}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{noformat} -- 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
[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13661520#comment-13661520 ] Remko Popma commented on LOG4J2-223: The listener did not go as smooth... First, I removed the above BasicContextSelector. Then, after deploying Nick's attached log4j-223.war, I modified\webapps\log4j-223\WEB-INF\web.xml as follows: {code} http://java.sun.com/xml/ns/javaee"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_1.xsd"; version="3.1"> Logging Integration Application org.apache.logging.log4j.core.web.Log4jContextListener ... {code} I also had to add log4j-web-2.0-beta6.jar to WEB-INF/lib. Undeploying gave the following (now familiar) error: FAIL - Unable to delete [C:\apps\apache-tomcat-7.0.40\webapps\log4j-223]. The continued presence of this file may cause problems. Under the webapps folder, this file was not deleted: webapps\log4j-223\WEB-INF\lib\log4j-core-2.0-beta6.jar However, shutting down Tomcat with Ctrl-C did not give any errors. > IllegalStateException 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 > > > {noformat}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{noformat} -- 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
[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13661516#comment-13661516 ] Remko Popma commented on LOG4J2-223: Definitely one for the FAQ. :-) The problem no longer occurs if the BasicContextSelector is configured. In Tomcat, this can be done by adding this line to $TOMCAT_HOME/conf/catalina.properties : {{Log4jContextSelector=org.apache.logging.log4j.core.selector.BasicContextSelector}} I'll try the Log4jContextListener next. > IllegalStateException 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 > > > {noformat}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{noformat} -- 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
[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13661506#comment-13661506 ] Ralph Goers commented on LOG4J2-223: Log4jContextListener is documented at http://logging.apache.org/log4j/2.x/log4j-web/index.html but could use an example. You can find one at https://svn.apache.org/repos/asf/logging/log4j/log4j2/trunk/samples/flume-remote/src/main/webapp/WEB-INF/web.xml. How to use the BasicContextSelector is documented on the page you reference. See item 1 under "Using Context Selectors". > IllegalStateException 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 > > > {noformat}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{noformat} -- 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
[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13661505#comment-13661505 ] Remko Popma commented on LOG4J2-223: Sounds like one for the FAQ page. I'd like to try this. How do I do register the Log4jContextListener? Also, does https://logging.apache.org/log4j/2.x/manual/logsep.html need to be updated after this? I'd like to try the simple approach mentioned on that page first and configure the BasicContextSelector, but how do I do that? > IllegalStateException 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 > > > {noformat}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{noformat} -- 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
[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13661501#comment-13661501 ] Ralph Goers commented on LOG4J2-223: The web.xml in the sample application doesn't have the Log4jContextListener registered. If it did the LoggerContext would have been unregistered when the webapp was undeployed, the shutdown hook would have been removed, and the above error would not have occurred. It is hard to imagine what at line 170 could be causing the NPE, but I would guess that the NullPointerException that Remko got above is because the webapp has already been undeployed and the StatusLogger class isn't there any more. If they had been deployed to the Tomcat class loader instead of the webapp classloader then I suspect this error would not have occurred. Removing the shutdown hook is not an appropriate solution. The configuration really needs to be shutdown when the web app is undeployed or when the server is shutdown, depending on where the log4j jars are placed, to clean up all the resources. > IllegalStateException 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 > > > {noformat}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{noformat} -- 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
[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13661494#comment-13661494 ] Remko Popma commented on LOG4J2-223: Would it be an idea for the LoggerContext to check if it is running in a web application and not register the shutdown hook if that is the case? (Is there an official way to check if you are running inside a web container?) > IllegalStateException 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 > > > {noformat}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{noformat} -- 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
[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13661493#comment-13661493 ] Nick Williams commented on LOG4J2-223: -- Note: I have asked on the Tomcat user's and developer's list for one of the people very knowledgeable about class loaders and memory leaks to chime in on this bug. > IllegalStateException 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 > > > {noformat}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{noformat} -- 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
[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13661492#comment-13661492 ] Remko Popma commented on LOG4J2-223: Well, my son wants to go play in the park now. That gets priority. :-) I have seen more than enough Tomcat for today... I hope the above helps with the investigation. > IllegalStateException 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 > > > {noformat}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{noformat} -- 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
[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13661491#comment-13661491 ] Nick Williams commented on LOG4J2-223: -- Yes, the log4j*.jar exclusion doesn't exist in Tomcat 6 (only Tomcat 7+), and it is not surprising that the error resulting from the class loader problem is slightly different in Tomcat 6 and Tomcat 7. Make sure you see my comment above about the log4j*.jar exclusion in Tomcat 7+ and about questioning the shutdown hook. > IllegalStateException 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 > > > {noformat}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{noformat} -- 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
[jira] [Commented] (LOG4J2-223) IllegalStateException thrown during Tomcat shutdown
[ https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13661490#comment-13661490 ] Remko Popma commented on LOG4J2-223: I also tried my fix in Tomcat 6. Here, I don't get the 500 error. The logging.jsp page shows the message "Messages have been logged.", and the output from the taglib logs is correctly logged to the console and /logs/application.log file. My hello-world page also shows the expected output. Unloading the webapp does not give warnings, it just says "Undeploying web application at context path /log4j-223" (in Japanese, the English may be slightly different). Shutting down Tomcat-6 after that with Ctrl-C now gives this stack trace: {code} Exception in thread "Thread-40" java.lang.NullPointerException at org.apache.logging.log4j.status.StatusLogger.log(StatusLogger.java:170) at org.apache.logging.log4j.spi.AbstractLogger.debug(AbstractLogger.java:354) at org.apache.logging.log4j.core.appender.AbstractManager.release(AbstractManager.java:118) at org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.stop(AbstractOutputStreamAppender.java:97) at org.apache.logging.log4j.core.appender.RollingFileAppender.stop(RollingFileAppender.java:70) at org.apache.logging.log4j.core.config.BaseConfiguration.stop(BaseConfiguration.java:142) at org.apache.logging.log4j.core.config.XMLConfiguration.stop(XMLConfiguration.java:244) at org.apache.logging.log4j.core.LoggerContext.stop(LoggerContext.java:206) at org.apache.logging.log4j.core.LoggerContext$ShutdownThread.run(LoggerContext.java:430) {code} > IllegalStateException 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 > > > {noformat}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{noformat} -- 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 --