Project: Tomcat
Bug 50168 destory method is called twice while the child is destoryed directly
Reported: 2010-10-27 22:47:42 | Status: resolved fixed

While calling the method destory() on the StandardContext directly, it seems that the method destoryInternal() is called twice in the LifecycleMBeanBase, the two stacktraces are below : a. LifecycleMBeanBase.unregister(ObjectName) line: 191 LifecycleMBeanBase.destroyInternal() line: 73 ContainerBase.destroyInternal() line: 1109 StandardContext.destroyInternal() line: 5114 LifecycleBase.destroy() line: 271 ContainerBase.removeChild(Container) line: 963 ContainerBase.destroyInternal() line: 1106 StandardContext.destroyInternal() line: 5114 LifecycleBase.destroy() line: 271 ... b. LifecycleMBeanBase.unregister(ObjectName) line: 191 LifecycleMBeanBase.destroyInternal() line: 73 ContainerBase.destroyInternal() line: 1109 StandardContext.destroyInternal() line: 5114 LifecycleBase.destroy() line: 271 ...

Files changed in fix:
java/org/apache/catalina/Lifecycle.java java/org/apache/catalina/LifecycleState.java java/org/apache/catalina/core/AprLifecycleListener.java java/org/apache/catalina/core/ContainerBase.java java/org/apache/catalina/startup/ContextConfig.java java/org/apache/catalina/util/LifecycleBase.java