I was having troubles setting up persistence for my test XMBean using v4.0 DR3, so I dived into the code and fixed it. Or at least, it works for me. Basically, the constructor
public ModelMBeanInfoSupport(String className, String description,
ModelMBeanAttributeInfo[] modelAttributes,
ModelMBeanConstructorInfo[] modelConstructors,
ModelMBeanOperationInfo[] modelOperations,
ModelMBeanNotificationInfo[] modelNperations, Descriptor mbeandescriptor)
at line 179 doesn't use the last arg. The method setMBeanDescriptor() is passed createDefaultDescriptor(). I think it should be passed mbeandescriptor. When I put in this change and re-ran the code, it worked. Thus it is now:
setMBeanDescriptor(mbeandescriptor);
Note that inside setMBeanDescriptor if the arg is null then it automatically creates a default descriptor for you so you need not check for null. Is this fix correct?