JDK-6471865 : Unable to create a modelmbean.DescriptorSupport with debugging ON
  • Type: Bug
  • Component: core-svc
  • Sub-Component: javax.management
  • Affected Version: 6
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic,other
  • Submitted: 2006-09-18
  • Updated: 2010-12-14
  • Resolved: 2007-03-24
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6u2 b01Fixed
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Description
The statement "new DescriptorSupport()" produces the following stack when the JMX debugging is used.
Tried JDK 6 b59g (aka Beta), b86 (aka Beta2) and b99.
All other constructors fail equally.
Works fine without any debugging.

Exception in thread "main" java.lang.IllegalArgumentException: Null Map
        at javax.management.ImmutableDescriptor.<init>(ImmutableDescriptor.java:85)
        at javax.management.modelmbean.DescriptorSupport.hashCode(DescriptorSupport.java:777)
        at javax.management.modelmbean.DescriptorSupport.debug(DescriptorSupport.java:1260)
        at javax.management.modelmbean.DescriptorSupport.debug(DescriptorSupport.java:1266)
        at javax.management.modelmbean.DescriptorSupport.<init>(DescriptorSupport.java:160)
        at defect.Main.main(Main.java:29)

Comments
EVALUATION The problem is that the debug calls within the constructors end up using the partially-constructed state of the object. In particular, the descriptorMap field is still null at this stage, even though a constructed DescriptorSupport never has a null descriptorMap. The simplest solution would be to remove these debug statements entirely. I do not think it is useful to trace the creation of descriptors. Possibly the constructors that already include some fields could continue to be traced, but the debug call should be after the call to init(whatever).
18-09-2006