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) ...
Workaround: Create the object manually and use registerMBean instead.
The other createMBean methods use findDelegateForNewObject instead. Should the findDelegate call in the broken methods just be changed to findDelegateForNewObject?
https://github.com/jbossas/jboss-eap/pull/1021
Verified in 6.3.0.DR4.