112113114115116117118119120121122
MBeanServer server = MBeanServerFactory.newMBeanServer(); ObjectName name = new ObjectName("test:test=test"); boolean caught = false; try { server.registerMBean(new NullDynamic(), name); } catch (NotCompliantMBeanException e) { caught = true; }