You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mi...@McAfee.com on 2011/02/02 22:06:13 UTC

Unregistering context mbean twice

Hi, There,

I hope someone can help me with the problem I have with undeploying a webapp. We recently upgrade from 5.5 to 7 and whenever I  undeploy our web app, I will get an exception like this:
Feb 1, 2011 4:27:13 PM org.apache.catalina.util.LifecycleMBeanBase unregister
WARNING: Failed to unregister MBean with name [Catalina:j2eeType=WebModule,name=//localhost/report,J2EEApplication=none,J2EEServer=none] during component destruction
javax.management.InstanceNotFoundException: Catalina:j2eeType=WebModule,name=//localhost/report,J2EEApplication=none,J2EEServer=none


I debug into tomcat code. And what I found out is that the context Mbean is first unregistered by ServerLifeCycleListener when it handles  "remove child" event.
JmxMBeanServer.unregisterMBean(ObjectName) line: 506
MBeanUtils.destroyMBean(NamingResources) line: 1358
ServerLifecycleListener.destroyMBeans(NamingResources) line: 832
ServerLifecycleListener.destroyMBeans(Context) line: 655
ServerLifecycleListener.processContainerRemoveChild(Container, Container) line: 1044
ServerLifecycleListener.containerEvent(ContainerEvent) line: 107
StandardHost(ContainerBase).fireContainerEvent(String, Object) line: 1261
StandardHost(ContainerBase).removeChild(Container) line: 960
HostConfig.checkResources(HostConfig$DeployedApplication) line: 1178
HostConfig.check(String) line: 1347

But the standardContext will unregister the same bean again when it's destroy method get called after that ServerLifeCycleListener   handles "remove child". That is why the exception:

JmxMBeanServer.unregisterMBean(ObjectName) line: 506
StandardContext(LifecycleMBeanBase).unregister(ObjectName) line: 191
StandardContext(LifecycleMBeanBase).destroyInternal() line: 73
StandardContext(ContainerBase).destroyInternal() line: 1116
StandardContext.destroyInternal() line: 5351
StandardContext(LifecycleBase).destroy() line: 285
StandardHost(ContainerBase).removeChild(Container) line: 969
HostConfig.checkResources(HostConfig$DeployedApplication) line: 1178
HostConfig.check(String) line: 1347

These two happened in one call to  HostConfig.check.  I didn't see anyone else report the problem, so I think I might not configure the server correctly or  my program  might be not coded right to undeploy an web app. But I did study the Managerservlet comes with tomcat which handle deployment and undeployment. I didn't see any significant difference. I also copy the code. I still get the same error.  I notice in tomcat 5.5 source code. The code for unregister context mbean in ServerLifeCycleListener  is commented out. That is why we don't have the problem in 5.5.  Hope someone can tell me what I did wrong.

Thanks,

Ming





RE: Unregistering context mbean twice

Posted by Mi...@McAfee.com.
Thanks. I will wait for 7.0.7. But I still suspect it's only me having this problem. I might need do some more debugging.

-----Original Message-----
From: Konstantin Kolinko [mailto:knst.kolinko@gmail.com] 
Sent: Wednesday, February 02, 2011 3:30 PM
To: Tomcat Users List
Subject: Re: Unregistering context mbean twice

2011/2/3  <Mi...@mcafee.com>:
> Sorry. I forgot give the exact version. It happens on both 7.0.4 and 7.0.6.
>

I cannot say about 7.0.6, but with the current sources I do not
observe any problems.

You may try to build a version by your own, or wait for 7.0.7 -- I
think it will be tagged & built soon.


>  Hope someone can tell me what I did wrong.

First you have to tell us more about what you did.

Is your configuration (server.xml) different from defaults?
Is this issue reproducible?
Does it happen with the default Tomcat apps, or it is specific to your webapp?

Any other errors or warnings in the logs?


Best regards,
Konstantin Kolinko

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


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


Re: Unregistering context mbean twice

Posted by Konstantin Kolinko <kn...@gmail.com>.
2011/2/3  <Mi...@mcafee.com>:
> Sorry. I forgot give the exact version. It happens on both 7.0.4 and 7.0.6.
>

I cannot say about 7.0.6, but with the current sources I do not
observe any problems.

You may try to build a version by your own, or wait for 7.0.7 -- I
think it will be tagged & built soon.


>  Hope someone can tell me what I did wrong.

First you have to tell us more about what you did.

Is your configuration (server.xml) different from defaults?
Is this issue reproducible?
Does it happen with the default Tomcat apps, or it is specific to your webapp?

Any other errors or warnings in the logs?


Best regards,
Konstantin Kolinko

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


RE: Unregistering context mbean twice

Posted by Mi...@McAfee.com.
Sorry. I forgot give the exact version. It happens on both 7.0.4 and 7.0.6.

Ming

-----Original Message-----
From: Konstantin Kolinko [mailto:knst.kolinko@gmail.com] 
Sent: Wednesday, February 02, 2011 1:13 PM
To: Tomcat Users List
Subject: Re: Unregistering context mbean twice

2011/2/3  <Mi...@mcafee.com>:
> I hope someone can help me with the problem I have with undeploying a webapp. We recently upgrade from 5.5 to 7

What exact version of Tomcat 7  (x.y.z)?

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


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


Re: Unregistering context mbean twice

Posted by Konstantin Kolinko <kn...@gmail.com>.
2011/2/3  <Mi...@mcafee.com>:
> I hope someone can help me with the problem I have with undeploying a webapp. We recently upgrade from 5.5 to 7

What exact version of Tomcat 7  (x.y.z)?

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