[ 
https://issues.apache.org/jira/browse/LOG4J2-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13661490#comment-13661490
 ] 

Remko Popma edited comment on LOG4J2-223 at 5/19/13 4:53 AM:
-------------------------------------------------------------

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}

Line numbers changed with my fix, so here is what at line 206 in LoggerContext:
{code}
203     Configuration prev = config;
204     config = NULL_CONFIGURATION;
205     updateLoggers();
206     prev.stop();
207     externalContext = null;
{code}
                
      was (Author: rem...@yahoo.com):
    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}

Line numbers changed with my fix, so here is what at line 206:
{code}
203     Configuration prev = config;
204     config = NULL_CONFIGURATION;
205     updateLoggers();
206     prev.stop();
207     externalContext = null;
{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

Reply via email to