United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6471865 Unable to create a modelmbean.DescriptorSupport with debugging ON
JDK-6471865 : Unable to create a modelmbean.DescriptorSupport with debugging ON

Details
Type:
Bug
Submit Date:
2006-09-18
Status:
Resolved
Updated Date:
2010-12-14
Project Name:
JDK
Resolved Date:
2007-03-24
Component:
core-svc
OS:
generic
Sub-Component:
javax.management
CPU:
other,generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:
6u2 (b01)

Related Reports
Duplicate:
Duplicate:
Relates:

Sub Tasks

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).
                                     
2006-09-18



Hardware and Software, Engineered to Work Together