Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.1.5
-
None
-
None
-
Operating System: Linux
Platform: PC
-
31326
Description
Related to bug #23585
Event registry persistence (using StoreEventRegistryImpl) to the default JCS
cache when tomcat shuts down fails. I get the following stack trace in the
logs:
WARN (2004-09-21) 12:28.53:455 [core.manager] (Unknown-URI) Unknown-
thread/ExcaliburComponentManager: disposing of handler for unreleased
component. role [org.apache.cocoon.caching.EventRegistry]
DEBUG (2004-09-21) 12:28.53:455 [core.manager] (Unknown-URI) Unknown-
thread/DefaultComponentFactory: ComponentFactory decommissioning instance of
org.apache.cocoon.caching.impl.StoreEventRegistryImpl.
DEBUG (2004-09-21) 12:28.53:458 [core.store] (Unknown-URI) Unknown-
thread/JCSDefaultStore: Store object
org.apache.cocoon.caching.impl.EventRegistryDataWrapper@1d4640 with key
EVENTREGWRAPPER
WARN (2004-09-21) 12:28.53:459 [core.manager] (Unknown-URI) Unknown-
thread/ThreadSafeComponentHandler: Error decommissioning component:
org.apache.cocoon.caching.impl.StoreEventRegistryImpl
java.lang.NullPointerException
at org.apache.cocoon.components.store.impl.JCSDefaultStore.store
(JCSDefaultStore.java:276)
at org.apache.cocoon.caching.impl.StoreEventRegistryImpl.persist
(StoreEventRegistryImpl.java:44)
at
org.apache.cocoon.caching.impl.AbstractDoubleMapEventRegistry.dispose
(AbstractDoubleMapEventRegistry.java:154)
at org.apache.avalon.framework.container.ContainerUtil.dispose
(ContainerUtil.java:345)
at
org.apache.avalon.excalibur.component.DefaultComponentFactory.decommission
(DefaultComponentFactory.java:336)
at
org.apache.avalon.excalibur.component.ThreadSafeComponentHandler.dispose
(ThreadSafeComponentHandler.java:165)
at
org.apache.avalon.excalibur.component.ExcaliburComponentManager.dispose
(ExcaliburComponentManager.java:621)
at org.apache.cocoon.components.CocoonComponentManager.dispose
(CocoonComponentManager.java:468)
at org.apache.avalon.framework.container.ContainerUtil.dispose
(ContainerUtil.java:345)
at org.apache.cocoon.Cocoon.dispose(Cocoon.java:499)
at org.apache.avalon.framework.container.ContainerUtil.dispose
(ContainerUtil.java:345)
at org.apache.cocoon.servlet.CocoonServlet.disposeCocoon
(CocoonServlet.java:1488)
at org.apache.cocoon.servlet.CocoonServlet.destroy
(CocoonServlet.java:498)
at org.apache.catalina.core.StandardWrapper.unload
(StandardWrapper.java:1270)
at org.apache.catalina.core.StandardWrapper.stop
(StandardWrapper.java:1595)
at org.apache.catalina.core.ContainerBase.removeChild
(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.removeChild
(StandardContext.java:3094)
at org.apache.catalina.startup.ContextConfig.stop
(ContextConfig.java:693)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent
(ContextConfig.java:255)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent
(LifecycleSupport.java:166)
at org.apache.catalina.core.StandardContext.stop
(StandardContext.java:4443)
at org.apache.catalina.core.ContainerBase.removeChild
(ContainerBase.java:995)
at org.apache.catalina.core.StandardHostDeployer.remove
(StandardHostDeployer.java:606)
at org.apache.catalina.core.StandardHost.remove(StandardHost.java:955)
at org.apache.catalina.startup.HostConfig.undeployApps
(HostConfig.java:1053)
at org.apache.catalina.startup.HostConfig.stop(HostConfig.java:1030)
at org.apache.catalina.startup.HostConfig.lifecycleEvent
(HostConfig.java:396)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent
(LifecycleSupport.java:166)
at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1166)
at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1178)
at org.apache.catalina.core.StandardEngine.stop
(StandardEngine.java:526)
at org.apache.catalina.core.StandardService.stop
(StandardService.java:581)
at org.apache.catalina.core.StandardServer.stop
(StandardServer.java:2379)
at org.apache.catalina.startup.Catalina.stop(Catalina.java:643)
at org.apache.catalina.startup.Catalina.start(Catalina.java:618)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398)
I added some debug and confirmed that it is the JCSCacheAccess member
variable 'this.jcs' that is null in JCSDefaultStore.
The reason it is null looks to be because the JCS Store is actually disposed
of during the shutdown process BEFORE StoreEventRegistryImpl.dispose() is
invoked. Here is an excerpt from the logs:
WARN (2004-09-21) 12:28.51:997 [core.manager] (Unknown-URI) Unknown-
thread/ExcaliburComponentManager: disposing of handler for unreleased
component. role [org.apache.excalibur.store.Store]
DEBUG (2004-09-21) 12:28.51:997 [core.manager] (Unknown-URI) Unknown-
thread/DefaultComponentFactory: ComponentFactory decommissioning instance of
org.apache.cocoon.components.store.impl.JCSDefaultStore.
Note the timestamps - they are 2 seconds before the Event registry disposal
logs.
My config (cocoon.xconf):
...
<store logger="core.store">
<parameter name="maxobjects" value="1"/>
<parameter name="use-cache-directory" value="true"/>
</store>
...
<component class="org.apache.cocoon.caching.impl.EventAwareCacheImpl"
role="org.apache.cocoon.caching.Cache/EventAware"/>
<component role="org.apache.cocoon.caching.EventRegistry"
class="org.apache.cocoon.caching.impl.StoreEventRegistryImpl"/>
...
It seems to me the solution is to somehow indicate to the container that the
EventRegistry is dependent on the Cache store, so they get disposed of
correctly. But I'm not yet sure how this would be done in the Avalon/Excalibur
framework. (I guess I could always hard-code the JCS dispose method to
dispose/cache the Event registry first! uggh)
Has anyone else run into this? Any suggestions?
Event registry persistence (using StoreEventRegistryImpl) to the default JCS
cache when tomcat shuts down fails. I get the following stack trace in the
logs:
WARN (2004-09-21) 12:28.53:455 [core.manager] (Unknown-URI) Unknown-
thread/ExcaliburComponentManager: disposing of handler for unreleased
component. role [org.apache.cocoon.caching.EventRegistry]
DEBUG (2004-09-21) 12:28.53:455 [core.manager] (Unknown-URI) Unknown-
thread/DefaultComponentFactory: ComponentFactory decommissioning instance of
org.apache.cocoon.caching.impl.StoreEventRegistryImpl.
DEBUG (2004-09-21) 12:28.53:458 [core.store] (Unknown-URI) Unknown-
thread/JCSDefaultStore: Store object
org.apache.cocoon.caching.impl.EventRegistryDataWrapper@1d4640 with key
EVENTREGWRAPPER
WARN (2004-09-21) 12:28.53:459 [core.manager] (Unknown-URI) Unknown-
thread/ThreadSafeComponentHandler: Error decommissioning component:
org.apache.cocoon.caching.impl.StoreEventRegistryImpl
java.lang.NullPointerException
at org.apache.cocoon.components.store.impl.JCSDefaultStore.store
(JCSDefaultStore.java:276)
at org.apache.cocoon.caching.impl.StoreEventRegistryImpl.persist
(StoreEventRegistryImpl.java:44)
at
org.apache.cocoon.caching.impl.AbstractDoubleMapEventRegistry.dispose
(AbstractDoubleMapEventRegistry.java:154)
at org.apache.avalon.framework.container.ContainerUtil.dispose
(ContainerUtil.java:345)
at
org.apache.avalon.excalibur.component.DefaultComponentFactory.decommission
(DefaultComponentFactory.java:336)
at
org.apache.avalon.excalibur.component.ThreadSafeComponentHandler.dispose
(ThreadSafeComponentHandler.java:165)
at
org.apache.avalon.excalibur.component.ExcaliburComponentManager.dispose
(ExcaliburComponentManager.java:621)
at org.apache.cocoon.components.CocoonComponentManager.dispose
(CocoonComponentManager.java:468)
at org.apache.avalon.framework.container.ContainerUtil.dispose
(ContainerUtil.java:345)
at org.apache.cocoon.Cocoon.dispose(Cocoon.java:499)
at org.apache.avalon.framework.container.ContainerUtil.dispose
(ContainerUtil.java:345)
at org.apache.cocoon.servlet.CocoonServlet.disposeCocoon
(CocoonServlet.java:1488)
at org.apache.cocoon.servlet.CocoonServlet.destroy
(CocoonServlet.java:498)
at org.apache.catalina.core.StandardWrapper.unload
(StandardWrapper.java:1270)
at org.apache.catalina.core.StandardWrapper.stop
(StandardWrapper.java:1595)
at org.apache.catalina.core.ContainerBase.removeChild
(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.removeChild
(StandardContext.java:3094)
at org.apache.catalina.startup.ContextConfig.stop
(ContextConfig.java:693)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent
(ContextConfig.java:255)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent
(LifecycleSupport.java:166)
at org.apache.catalina.core.StandardContext.stop
(StandardContext.java:4443)
at org.apache.catalina.core.ContainerBase.removeChild
(ContainerBase.java:995)
at org.apache.catalina.core.StandardHostDeployer.remove
(StandardHostDeployer.java:606)
at org.apache.catalina.core.StandardHost.remove(StandardHost.java:955)
at org.apache.catalina.startup.HostConfig.undeployApps
(HostConfig.java:1053)
at org.apache.catalina.startup.HostConfig.stop(HostConfig.java:1030)
at org.apache.catalina.startup.HostConfig.lifecycleEvent
(HostConfig.java:396)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent
(LifecycleSupport.java:166)
at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1166)
at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1178)
at org.apache.catalina.core.StandardEngine.stop
(StandardEngine.java:526)
at org.apache.catalina.core.StandardService.stop
(StandardService.java:581)
at org.apache.catalina.core.StandardServer.stop
(StandardServer.java:2379)
at org.apache.catalina.startup.Catalina.stop(Catalina.java:643)
at org.apache.catalina.startup.Catalina.start(Catalina.java:618)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398)
I added some debug and confirmed that it is the JCSCacheAccess member
variable 'this.jcs' that is null in JCSDefaultStore.
The reason it is null looks to be because the JCS Store is actually disposed
of during the shutdown process BEFORE StoreEventRegistryImpl.dispose() is
invoked. Here is an excerpt from the logs:
WARN (2004-09-21) 12:28.51:997 [core.manager] (Unknown-URI) Unknown-
thread/ExcaliburComponentManager: disposing of handler for unreleased
component. role [org.apache.excalibur.store.Store]
DEBUG (2004-09-21) 12:28.51:997 [core.manager] (Unknown-URI) Unknown-
thread/DefaultComponentFactory: ComponentFactory decommissioning instance of
org.apache.cocoon.components.store.impl.JCSDefaultStore.
Note the timestamps - they are 2 seconds before the Event registry disposal
logs.
My config (cocoon.xconf):
...
<store logger="core.store">
<parameter name="maxobjects" value="1"/>
<parameter name="use-cache-directory" value="true"/>
</store>
...
<component class="org.apache.cocoon.caching.impl.EventAwareCacheImpl"
role="org.apache.cocoon.caching.Cache/EventAware"/>
<component role="org.apache.cocoon.caching.EventRegistry"
class="org.apache.cocoon.caching.impl.StoreEventRegistryImpl"/>
...
It seems to me the solution is to somehow indicate to the container that the
EventRegistry is dependent on the Cache store, so they get disposed of
correctly. But I'm not yet sure how this would be done in the Avalon/Excalibur
framework. (I guess I could always hard-code the JCS dispose method to
dispose/cache the Event registry first! uggh)
Has anyone else run into this? Any suggestions?