{
MBeanServer server = MBeanServerFactory.createMBeanServer();
ObjectName oname = new ObjectName("test:test=test");
ModelMBean mmbean = new XMBean();
ResourceIncorrectInfo resource = new ResourceIncorrectInfo();
mmbean.setManagedResource(resource, "ObjectReference");
mmbean.setModelMBeanInfo(resource.getMBeanInfo());
server.registerMBean(mmbean, oname);
MyInterface mbean = (MyInterface)MBeanProxy.get(
MyInterface.class, oname, server