Mantis - Resin
Viewing Issue Advanced Details
2390 minor always 02-01-08 08:14 02-11-08 16:57
sam  
ferg  
urgent  
closed 3.1.4  
fixed  
none    
none 3.1.5  
0002390: unregister MBean has no effect
(rep by J Smyth)

I am trying to remove an MBean using the following code and it is not
getting unregistered with the server. Here is the test code:

MBeanServer server = ManagementFactory.getPlatformMBeanServer();

System.out.println(objectName+" is registered with server: "+server+ "
?? "+server.isRegistered(objectName)+" before calling the unregister");

server.unregisterMBean( objectName );

System.out.println(objectName+" is registered with server: "+server+ "
?? "+server.isRegistered(objectName)+" after calling the unregister");

The MBean is named "DEC:type=system,service=LoggingManager" here are the
logs from my test:

DEC:type=system,service=LoggingManager is registered with server:
GlobalMBeanServer[] ?? true before calling the unregister

DEC:type=system,service=LoggingManager is registered with server:
GlobalMBeanServer[] ?? true after calling the unregister

As you can see from the logs, we are using the global MBeanServer but
the MBean will not unregister.

Notes
(0002754)
ferg   
02-11-08 16:57   
server/21q0