Bug 1073106

Summary: MBeanServer.createMBean methods that take a classloader don't work
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: dereed
Component: JMXAssignee: Stuart Douglas <sdouglas>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.2.1CC: hrupp, jmartisk, kkhan
Target Milestone: DR3   
Target Release: EAP 6.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-28 15:40:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description dereed 2014-03-05 19:08:51 UTC
The MBeanServer.createMBean methods that take an "ObjectName loaderName" argument are completely broken in EAP 6.

These methods call findDelegate to make sure there is already an existing MBean registered with the given name passed in for the new MBean, or else it throws an exception.
This is obviously wrong, as there'd be no point in calling createMBean if it already existed.

javax.management.InstanceNotFoundException: test:service=Test
at org.jboss.as.jmx.PluggableMBeanServerImpl.findDelegate(PluggableMBeanServerImpl.java:1083)
at org.jboss.as.jmx.PluggableMBeanServerImpl.createMBean(PluggableMBeanServerImpl.java:253)
...

Comment 1 dereed 2014-03-05 19:09:41 UTC
Workaround: Create the object manually and use registerMBean instead.

Comment 2 dereed 2014-03-05 19:10:24 UTC
The other createMBean methods use findDelegateForNewObject instead.  Should the findDelegate call in the broken methods just be changed to findDelegateForNewObject?

Comment 3 Stuart Douglas 2014-03-05 20:34:36 UTC
https://github.com/jbossas/jboss-eap/pull/1021

Comment 4 Jan Martiska 2014-03-19 09:43:55 UTC
Verified in 6.3.0.DR4.