This content has been marked as final.
Show 2 replies
-
1. Re: Unregistering a MBean on un-/re-deploy
pilhuhn Aug 18, 2006 11:43 AM (in response to geirgp)Why don't you just call unregisterMBean() on the MBeanServer ?
Something like (Pseudocode)MbeanServer mbs = MbeanServerLocator.locateJBoss(); ObjectName on = new ObjectName("foo:type=service"); mbs.unregisterMBean(on);
this could also be done on command line via twiddle:twiddle unregister "foo:type=service"
-
2. Re: Unregistering a MBean on un-/re-deploy
geirgp Aug 21, 2006 6:35 AM (in response to geirgp)Thanks! However I found another solution. It isn't really related to JBoss since I'm using Spring to manage these beans, but here goes:
I added the following line to the "MBeanExporter" in applicationContext.xml which forces unregistration of any existing beans with the same name. (this setting probably does the same as the code you posted does)<property name="registrationBehaviorName" value="REGISTRATION_REPLACE_EXISTING"/>