You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Nick Williams <ni...@nicholaswilliams.net> on 2013/04/25 22:07:45 UTC

Log4j 2 - Error when shutting down Tomcat

I have Log4j 2 beta 5 configured in a simply one-page web app with console and rolling file appenders. Everything works fine; however, when I shut down Tomcat, the following errors are logged to the console (I've included Tomcat INFO messages for context). This has never happened with my applications using Log4j 1. Am I doing something wrong, or is this a bug?

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

Re: Log4j 2 - Error when shutting down Tomcat

Posted by Ralph Goers <ra...@dslextreme.com>.
I doubt it will fix LOG4J2-222 but I will have to take a look.

Yes - I am thinking several days to fix the other issue I found and some of the Jira issues.

Ralph


On Apr 27, 2013, at 7:19 PM, Remko Popma wrote:

> Do you think this may fix LOG4J2-222 as well?
> 
> +1 beta6 soon
> Would like to include manual changes & rename AsynchAppender. Can I have 36 hours to make these changes?
> 
> Sent from my iPhone
> 
> On 2013/04/28, at 10:52, Ralph Goers <ra...@dslextreme.com> wrote:
> 
>> I used the sample flume-remote app - which exposed another bug beyond the one below.
>> 
>> Configurator was setting a new configuration and then setting it to a default during shutdown, which doesn't really shutdown the LoggerContext so the shutdown hook was still present.  Configurator has been modified to start and stop the LoggerContext and I have verified I no longer see this error.  FWIW - I consider this error important enough that I would prefer that beta6 be released very soon.
>> 
>> Ralph
>> 
>> On Apr 25, 2013, at 2:28 PM, Ralph Goers wrote:
>> 
>>> I added a shutdown hook to stop configurations when a JVM shuts down to fix LOG4J2-212.   It sounds like I will have to run this under a debugger. If you can provide the sample app I will have to test it.
>>> 
>>> Ralph
>>> 
>>> 
>>> On Apr 25, 2013, at 1:07 PM, Nick Williams wrote:
>>> 
>>>> I have Log4j 2 beta 5 configured in a simply one-page web app with console and rolling file appenders. Everything works fine; however, when I shut down Tomcat, the following errors are logged to the console (I've included Tomcat INFO messages for context). This has never happened with my applications using Log4j 1. Am I doing something wrong, or is this a bug?
>>>> 
>>>> 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
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
>> For additional commands, e-mail: log4j-dev-help@logging.apache.org
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-dev-help@logging.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Re: Log4j 2 - Error when shutting down Tomcat

Posted by Remko Popma <re...@yahoo.com>.
Do you think this may fix LOG4J2-222 as well?

+1 beta6 soon
Would like to include manual changes & rename AsynchAppender. Can I have 36 hours to make these changes?

Sent from my iPhone

On 2013/04/28, at 10:52, Ralph Goers <ra...@dslextreme.com> wrote:

> I used the sample flume-remote app - which exposed another bug beyond the one below.
> 
> Configurator was setting a new configuration and then setting it to a default during shutdown, which doesn't really shutdown the LoggerContext so the shutdown hook was still present.  Configurator has been modified to start and stop the LoggerContext and I have verified I no longer see this error.  FWIW - I consider this error important enough that I would prefer that beta6 be released very soon.
> 
> Ralph
> 
> On Apr 25, 2013, at 2:28 PM, Ralph Goers wrote:
> 
>> I added a shutdown hook to stop configurations when a JVM shuts down to fix LOG4J2-212.   It sounds like I will have to run this under a debugger. If you can provide the sample app I will have to test it.
>> 
>> Ralph
>> 
>> 
>> On Apr 25, 2013, at 1:07 PM, Nick Williams wrote:
>> 
>>> I have Log4j 2 beta 5 configured in a simply one-page web app with console and rolling file appenders. Everything works fine; however, when I shut down Tomcat, the following errors are logged to the console (I've included Tomcat INFO messages for context). This has never happened with my applications using Log4j 1. Am I doing something wrong, or is this a bug?
>>> 
>>> 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
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-dev-help@logging.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Re: Log4j 2 - Error when shutting down Tomcat

Posted by Ralph Goers <ra...@dslextreme.com>.
I used the sample flume-remote app - which exposed another bug beyond the one below.

Configurator was setting a new configuration and then setting it to a default during shutdown, which doesn't really shutdown the LoggerContext so the shutdown hook was still present.  Configurator has been modified to start and stop the LoggerContext and I have verified I no longer see this error.  FWIW - I consider this error important enough that I would prefer that beta6 be released very soon.

Ralph

On Apr 25, 2013, at 2:28 PM, Ralph Goers wrote:

> I added a shutdown hook to stop configurations when a JVM shuts down to fix LOG4J2-212.   It sounds like I will have to run this under a debugger. If you can provide the sample app I will have to test it.
> 
> Ralph
> 
> 
> On Apr 25, 2013, at 1:07 PM, Nick Williams wrote:
> 
>> I have Log4j 2 beta 5 configured in a simply one-page web app with console and rolling file appenders. Everything works fine; however, when I shut down Tomcat, the following errors are logged to the console (I've included Tomcat INFO messages for context). This has never happened with my applications using Log4j 1. Am I doing something wrong, or is this a bug?
>> 
>> 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
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Re: Log4j 2 - Error when shutting down Tomcat

Posted by Ralph Goers <ra...@dslextreme.com>.
I added a shutdown hook to stop configurations when a JVM shuts down to fix LOG4J2-212.   It sounds like I will have to run this under a debugger. If you can provide the sample app I will have to test it.

Ralph


On Apr 25, 2013, at 1:07 PM, Nick Williams wrote:

> I have Log4j 2 beta 5 configured in a simply one-page web app with console and rolling file appenders. Everything works fine; however, when I shut down Tomcat, the following errors are logged to the console (I've included Tomcat INFO messages for context). This has never happened with my applications using Log4j 1. Am I doing something wrong, or is this a bug?
> 
> 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


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org