tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Delbecq <de...@oma.be>
Subject Re: Error when stopping or reloading web application
Date Mon, 08 Jan 2007 10:48:46 GMT
I have the same problem here. That's a problem coming from the way
jakarta common logging works together with the way tomcat invalidate
it's webappclassloader before calling the servelt unloading code. When a
class need a logger it does all sort of classloading stuff.
Unfortunately, when you do this during the servlet unloading process,
tomcat concludes the webapp has no intention to stop as it requires new
classes from an invalidated WebappClassLoader (this could also be caused
by a webapp specific thread that did not get close notification). The
main problem with this annoyance is that it deliberatly throw a
ThreadDeathException, breaking you servlet unloading/cleanup code.

Despite what is said on console, it has functional impact. In my case,
this prevented a background Threaded process to stop because, when i try
to logout a 'unloading all currently XXXX threads due to servlet
unloading' i get the exception and byebye the unloading of my own
threads. They stay there. I did remove the logging comments in my
unloading thread to prevent this, but it's still a problem. Some people
may have web application or libraries they have no control on which
cause this kind of exception. Maybe the webappclassloader should be
invalidated *after* all servlet unloading stuff is run and not before??

This is a question to the dev team...

En l'instant précis du 01/08/07 11:32, Andre Prasetya s'exprimait dans
toute sa noblesse:
> Hi, I got a problem. I always see this at catalina.out everytime I
> stopped
> or reload the web application, what can I do to stop this ? My
> Application
> is Thread based and run behind a web application. When the web
> application
> stopped, it will set the stop value of the Thread as true and will dump
> everything on queue to harddrive. Here is the snippet from the
> catalina.out
>
>
> Jan 8, 2007 4:51:49 PM
> org.apache.catalina.loader.WebappClassLoaderfindResourceInternal
> INFO: Illegal access: this web application instance has been stopped
> already.  Could not load commons-logging.properties.  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.
> Jan 8, 2007 4:51:49 PM
> org.apache.catalina.loader.WebappClassLoaderfindResourceInternal
> INFO: Illegal access: this web application instance has been stopped
> already.  Could not load
> META-INF/services/org.apache.commons.logging.LogFactory.  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.
> Jan 8, 2007 4:51:49 PM
> org.apache.catalina.loader.WebappClassLoaderloadClass
> INFO: Illegal access: this web application instance has been stopped
> already.  Could not load org.apache.log4j.Logger.  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:1238)
>        at org.apache.catalina.loader.WebappClassLoader.loadClass(
> WebappClassLoader.java:1198)
>        at org.apache.commons.logging.impl.LogFactoryImpl$1.run(
> LogFactoryImpl.java:441)
>        at java.security.AccessController.doPrivileged(Native Method)
>        at org.apache.commons.logging.impl.LogFactoryImpl.loadClass(
> LogFactoryImpl.java:435)
>        at
> org.apache.commons.logging.impl.LogFactoryImpl.isLog4JAvailable(
> LogFactoryImpl.java:505)
>        at org.apache.commons.logging.impl.LogFactoryImpl.getLogClassName(
> LogFactoryImpl.java:327)
>        at
> org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(
> LogFactoryImpl.java:368)
>        at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(
> LogFactoryImpl.java:529)
>        at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(
> LogFactoryImpl.java:235)
>        at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(
> LogFactoryImpl.java:209)
>        at
> org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
>        at com.csp.util.Logging.getLogger(Logging.java:28)
>        at
> com.ricochet.dao.FileInboundDao.retrieve(FileInboundDao.java:113)
>        at com.csp.agent.DualStorageDispatcher.retrieve(
> DualStorageDispatcher.java:34)
>        at com.csp.agent.DualStorageDispatcher.dump(
> DualStorageDispatcher.java:56)
>        at com.csp.agent.Dispatcher.run(Dispatcher.java:81)
> Jan 8, 2007 4:51:49 PM
> org.apache.catalina.loader.WebappClassLoaderloadClass
> INFO: Illegal access: this web application instance has been stopped
> already.  Could not load org.apache.commons.logging.impl.Log4JLogger. 
> 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:1238)
>        at org.apache.catalina.loader.WebappClassLoader.loadClass(
> WebappClassLoader.java:1198)
>        at org.apache.commons.logging.impl.LogFactoryImpl$1.run(
> LogFactoryImpl.java:441)
>        at java.security.AccessController.doPrivileged(Native Method)
>        at org.apache.commons.logging.impl.LogFactoryImpl.loadClass(
> LogFactoryImpl.java:435)
>        at
> org.apache.commons.logging.impl.LogFactoryImpl.isLog4JAvailable(
> LogFactoryImpl.java:506)
>        at org.apache.commons.logging.impl.LogFactoryImpl.getLogClassName(
> LogFactoryImpl.java:327)
>        at
> org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(
> LogFactoryImpl.java:368)
>        at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(
> LogFactoryImpl.java:529)
>        at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(
> LogFactoryImpl.java:235)
>        at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(
> LogFactoryImpl.java:209)
>        at
> org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
>        at com.csp.util.Logging.getLogger(Logging.java:28)
>        at
> com.ricochet.dao.FileInboundDao.retrieve(FileInboundDao.java:113)
>        at com.csp.agent.DualStorageDispatcher.retrieve(
> DualStorageDispatcher.java:34)
>        at com.csp.agent.DualStorageDispatcher.dump(
> DualStorageDispatcher.java:56)
>        at com.csp.agent.Dispatcher.run(Dispatcher.java:81)
> Jan 8, 2007 4:51:49 PM
> org.apache.catalina.loader.WebappClassLoaderloadClass
> INFO: Illegal access: this web application instance has been stopped
> already.  Could not load org.apache.commons.logging.impl.Log4JLogger. 
> 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:1238)
>        at org.apache.catalina.loader.WebappClassLoader.loadClass(
> WebappClassLoader.java:1198)
>        at org.apache.commons.logging.impl.LogFactoryImpl$1.run(
> LogFactoryImpl.java:441)
>        at java.security.AccessController.doPrivileged(Native Method)
>        at org.apache.commons.logging.impl.LogFactoryImpl.loadClass(
> LogFactoryImpl.java:435)
>        at
> org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(
> LogFactoryImpl.java:376)
>        at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(
> LogFactoryImpl.java:529)
>        at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(
> LogFactoryImpl.java:235)
>        at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(
> LogFactoryImpl.java:209)
>        at
> org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
>        at com.csp.util.Logging.getLogger(Logging.java:28)
>        at
> com.ricochet.dao.FileInboundDao.retrieve(FileInboundDao.java:113)
>        at com.csp.agent.DualStorageDispatcher.retrieve(
> DualStorageDispatcher.java:34)
>        at com.csp.agent.DualStorageDispatcher.dump(
> DualStorageDispatcher.java:56)
>        at com.csp.agent.Dispatcher.run(Dispatcher.java:81)
> Exception in thread "Thread-45"
> org.apache.commons.logging.LogConfigurationException:
> java.lang.NullPointerException (Caused by java.lang.NullPointerException)
>        at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(
> LogFactoryImpl.java:538)
>        at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(
> LogFactoryImpl.java:235)
>        at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(
> LogFactoryImpl.java:209)
>        at
> org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
>        at com.csp.util.Logging.getLogger(Logging.java:28)
>        at
> com.ricochet.dao.FileInboundDao.retrieve(FileInboundDao.java:113)
>        at com.csp.agent.DualStorageDispatcher.retrieve(
> DualStorageDispatcher.java:34)
>        at com.csp.agent.DualStorageDispatcher.dump(
> DualStorageDispatcher.java:56)
>        at com.csp.agent.Dispatcher.run(Dispatcher.java:81)
> Caused by: java.lang.NullPointerException
>        at org.apache.log4j.LogManager.getLogger(LogManager.java:188)
>        at org.apache.log4j.Logger.getLogger(Logger.java:104)
>        at org.apache.commons.logging.impl.Log4JLogger.getLogger(
> Log4JLogger.java:283)
>        at org.apache.commons.logging.impl.Log4JLogger.<init>(
> Log4JLogger.java:108)
>        at sun.reflect.GeneratedConstructorAccessor21.newInstance(Unknown
> Source)
>        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
> DelegatingConstructorAccessorImpl.java:27)
>        at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
>        at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(
> LogFactoryImpl.java:529)
>        ... 8 more
>
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message