You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Rakesh Vidyadharan <ra...@sptci.com> on 2010/02/13 04:07:49 UTC

ThreadLocal errors logged in Tomcat 6.0.24

I upgraded to Tomcat 6.0.24 earlier today and started noticing the following messages on Tomcat shutdown.  The deployed web app is the same (not the JR webapp, but my own) and does not generate any of these messages on 6.0.20.

12-Feb-2010 14:23:20 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: A web application registered the JBDC driver [org.apache.derby.jdbc.AutoloadedDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
12-Feb-2010 14:23:20 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: A web application appears to have started a thread named [Timer-1] but has failed to stop it. This is very likely to create a memory leak.
12-Feb-2010 14:23:20 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: A web application appears to have started a thread named [ObservationManager] but has failed to stop it. This is very likely to create a memory leak.
12-Feb-2010 14:23:20 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: A web application appears to have started a thread named [jackrabbit-pool-1] but has failed to stop it. This is very likely to create a memory leak.
12-Feb-2010 14:23:20 org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: A web application created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@8244f74]) and a value of type [org.apache.jackrabbit.core.query.lucene.PerQueryCache] (value [org.apache.jackrabbit.core.query.lucene.PerQueryCache@7dc4cd9]) but failed to remove it when the web application was stopped. To prevent a memory leak, the ThreadLocal has been forcibly removed.


Re: ThreadLocal errors logged in Tomcat 6.0.24

Posted by Andreas Veithen <an...@gmail.com>.
We recently upgraded to Jackrabbit 2.0, and in our case there seems to
be a thread of type
org.apache.jackrabbit.util.TransientFileFactory$ReaperThread that is
not stopped correctly. This prevents the application class loader from
being garbage collected after a stop or restart of Jackrabbit and
causes a memory leak.

Andreas

On Mon, Feb 15, 2010 at 13:11, Torgeir Veimo <to...@netenviron.com> wrote:
> On 15 February 2010 21:14, Rakesh Vidyadharan <ra...@sptci.com> wrote:
>> On 15 Feb 2010, at 02:42, Thomas Müller wrote:
>>
>>> Hi,
>>>
>>> It looks like the Jackrabbit repository is not closed when the web
>>> application is stopped. Could you verify this?
>>>
>>> Regards,
>>> Thomas
>>
>> I am using TransientRepository, and I verified that there are not .lock or .lck files under repository root before I shutdown the container.  It appears to be primarily Derby and Lucene that have these issues, so it may not be a JackRabbit issue per se.
>
> There's at least one jackrabbit timer that doesn't shut down. Here's
> what I see in the tomcat log, redeploying an app that uses
> TransientRepository;
>
> Feb 15, 2010 10:07:58 PM org.apache.catalina.loader.WebappClassLoader
> clearReferencesThreads
> SEVERE: A web application appears to have started a thread named
> [Timer-2] but has failed to stop it. This is very likely to create a
> memory leak.
> Feb 15, 2010 10:07:58 PM org.apache.catalina.loader.WebappClassLoader
> clearReferencesThreads
> WARNING: Failed to terminate thread named [Timer-2]
> java.lang.NoSuchFieldException: target
>        at java.lang.Class.getDeclaredField(Class.java:1882)
>        at org.apache.catalina.loader.WebappClassLoader.clearReferencesThreads(WebappClassLoader.java:1958)
>        at org.apache.catalina.loader.WebappClassLoader.clearReferences(WebappClassLoader.java:1707)
>        at org.apache.catalina.loader.WebappClassLoader.stop(WebappClassLoader.java:1622)
>        at org.apache.catalina.loader.WebappLoader.stop(WebappLoader.java:710)
>        at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4649)
>        at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:924)
>        at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1121)
>        at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1342)
>        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303)
>        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
>        at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
>        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
>        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
>        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
>        at java.lang.Thread.run(Thread.java:637)
> Feb 15, 2010 10:07:58 PM org.apache.catalina.loader.WebappClassLoader
> clearThreadLocalMap
> SEVERE: A web application created a ThreadLocal with key of type
> [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@4fc0b204]) and a
> value of type [org.apache.jackrabbit.core.query.lucene.PerQueryCache]
> (value [org.apache.jackrabbit.core.query.lucene.PerQueryCache@73e74d83])
> but failed to remove it when the web application was stopped. To
> prevent a memory leak, the ThreadLocal has been forcibly removed.
> Feb 15, 2010 10:07:58 PM org.apache.catalina.loader.WebappClassLoader
> clearThreadLocalMap
> SEVERE: A web application created a ThreadLocal with key of type
> [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@56920ee7]) and a
> value of type [org.apache.derby.iapi.services.context.ContextManager]
> (value [org.apache.derby.iapi.services.context.ContextManager@246972f1])
> but failed to remove it when the web application was stopped. To
> prevent a memory leak, the ThreadLocal has been forcibly removed.
> Feb 15, 2010 10:07:58 PM org.apache.catalina.loader.WebappClassLoader
> clearThreadLocalMap
> SEVERE: A web application created a ThreadLocal with key of type
> [org.apache.derby.iapi.sql.dictionary.TableDescriptor$1] (value
> [org.apache.derby.iapi.sql.dictionary.TableDescriptor$1@f108c18]) and
> a value of type [java.util.WeakHashMap] (value [{={1}, ={1, 2}, =null,
> ={1}, =null, ={1}, ={1}, =null, ={1}, =null, ={2, 3, 4}, ={1}, =null,
> ={1}, ={1}, ={1, 2}, =null, =null, =null, =null, =null, ={2, 3, 4},
> ={1}, =null, =null, =null}]) but failed to remove it when the web
> application was stopped. To prevent a memory leak, the ThreadLocal has
> been forcibly removed.
>
> --
> -Tor
>

Re: ThreadLocal errors logged in Tomcat 6.0.24

Posted by Torgeir Veimo <to...@netenviron.com>.
On 15 February 2010 21:14, Rakesh Vidyadharan <ra...@sptci.com> wrote:
> On 15 Feb 2010, at 02:42, Thomas Müller wrote:
>
>> Hi,
>>
>> It looks like the Jackrabbit repository is not closed when the web
>> application is stopped. Could you verify this?
>>
>> Regards,
>> Thomas
>
> I am using TransientRepository, and I verified that there are not .lock or .lck files under repository root before I shutdown the container.  It appears to be primarily Derby and Lucene that have these issues, so it may not be a JackRabbit issue per se.

There's at least one jackrabbit timer that doesn't shut down. Here's
what I see in the tomcat log, redeploying an app that uses
TransientRepository;

Feb 15, 2010 10:07:58 PM org.apache.catalina.loader.WebappClassLoader
clearReferencesThreads
SEVERE: A web application appears to have started a thread named
[Timer-2] but has failed to stop it. This is very likely to create a
memory leak.
Feb 15, 2010 10:07:58 PM org.apache.catalina.loader.WebappClassLoader
clearReferencesThreads
WARNING: Failed to terminate thread named [Timer-2]
java.lang.NoSuchFieldException: target
	at java.lang.Class.getDeclaredField(Class.java:1882)
	at org.apache.catalina.loader.WebappClassLoader.clearReferencesThreads(WebappClassLoader.java:1958)
	at org.apache.catalina.loader.WebappClassLoader.clearReferences(WebappClassLoader.java:1707)
	at org.apache.catalina.loader.WebappClassLoader.stop(WebappClassLoader.java:1622)
	at org.apache.catalina.loader.WebappLoader.stop(WebappLoader.java:710)
	at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4649)
	at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:924)
	at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1121)
	at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1342)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
	at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
	at java.lang.Thread.run(Thread.java:637)
Feb 15, 2010 10:07:58 PM org.apache.catalina.loader.WebappClassLoader
clearThreadLocalMap
SEVERE: A web application created a ThreadLocal with key of type
[java.lang.ThreadLocal] (value [java.lang.ThreadLocal@4fc0b204]) and a
value of type [org.apache.jackrabbit.core.query.lucene.PerQueryCache]
(value [org.apache.jackrabbit.core.query.lucene.PerQueryCache@73e74d83])
but failed to remove it when the web application was stopped. To
prevent a memory leak, the ThreadLocal has been forcibly removed.
Feb 15, 2010 10:07:58 PM org.apache.catalina.loader.WebappClassLoader
clearThreadLocalMap
SEVERE: A web application created a ThreadLocal with key of type
[java.lang.ThreadLocal] (value [java.lang.ThreadLocal@56920ee7]) and a
value of type [org.apache.derby.iapi.services.context.ContextManager]
(value [org.apache.derby.iapi.services.context.ContextManager@246972f1])
but failed to remove it when the web application was stopped. To
prevent a memory leak, the ThreadLocal has been forcibly removed.
Feb 15, 2010 10:07:58 PM org.apache.catalina.loader.WebappClassLoader
clearThreadLocalMap
SEVERE: A web application created a ThreadLocal with key of type
[org.apache.derby.iapi.sql.dictionary.TableDescriptor$1] (value
[org.apache.derby.iapi.sql.dictionary.TableDescriptor$1@f108c18]) and
a value of type [java.util.WeakHashMap] (value [{={1}, ={1, 2}, =null,
={1}, =null, ={1}, ={1}, =null, ={1}, =null, ={2, 3, 4}, ={1}, =null,
={1}, ={1}, ={1, 2}, =null, =null, =null, =null, =null, ={2, 3, 4},
={1}, =null, =null, =null}]) but failed to remove it when the web
application was stopped. To prevent a memory leak, the ThreadLocal has
been forcibly removed.

-- 
-Tor

Re: ThreadLocal errors logged in Tomcat 6.0.24

Posted by Rakesh Vidyadharan <ra...@sptci.com>.
On 15 Feb 2010, at 02:42, Thomas Müller wrote:

> Hi,
> 
> It looks like the Jackrabbit repository is not closed when the web
> application is stopped. Could you verify this?
> 
> Regards,
> Thomas

I am using TransientRepository, and I verified that there are not .lock or .lck files under repository root before I shutdown the container.  It appears to be primarily Derby and Lucene that have these issues, so it may not be a JackRabbit issue per se.

Rakesh


Re: ThreadLocal errors logged in Tomcat 6.0.24

Posted by Thomas Müller <th...@day.com>.
Hi,

It looks like the Jackrabbit repository is not closed when the web
application is stopped. Could you verify this?

Regards,
Thomas