JDK-8212197 : OpenDataException thrown when constructing CompositeData for StackTraceElement
  • Type: Bug
  • Component: core-svc
  • Sub-Component: java.lang.management
  • Affected Version: 11
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2018-10-15
  • Updated: 2019-02-11
  • Resolved: 2018-10-16
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 11 JDK 12
11.0.2Fixed 12 b16Fixed
Related Reports
Relates :  
Relates :  
Description
See http://mail.openjdk.java.net/pipermail/jdk-dev/2018-October/002107.html

javax.management.openmbean.OpenDataException: Argument value of wrong type for item lineNumber: value java.lang.ref.Reference, type javax.management.openmbean.SimpleType(name=java.lang.Integer)
	at java.management/javax.management.openmbean.CompositeDataSupport.<init>(CompositeDataSupport.java:235)
	at java.management/javax.management.openmbean.CompositeDataSupport.<init>(CompositeDataSupport.java:118)
	at java.management/sun.management.StackTraceElementCompositeData.getCompositeData(StackTraceElementCompositeData.java:91)
Caused: java.lang.AssertionError
	at java.management/sun.management.StackTraceElementCompositeData.getCompositeData(StackTraceElementCompositeData.java:96)
	at java.management/sun.management.StackTraceElementCompositeData.toCompositeData(StackTraceElementCompositeData.java:74)
	at java.management/sun.management.ThreadInfoCompositeData.getCompositeData(ThreadInfoCompositeData.java:82)
	at java.management/sun.management.ThreadInfoCompositeData.toCompositeData(ThreadInfoCompositeData.java:72)
Caused: java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.netbeans.modules.sampler.SamplesOutputStream.toCompositeData(SamplesOutputStream.java:178)
Caused: java.lang.RuntimeException
	at org.netbeans.modules.sampler.SamplesOutputStream.toCompositeData(SamplesOutputStream.java:184)
	at org.netbeans.modules.sampler.SamplesOutputStream.access$400(SamplesOutputStream.java:44)
	at org.netbeans.modules.sampler.SamplesOutputStream$Sample.writeToStream(SamplesOutputStream.java:285)
	at org.netbeans.modules.sampler.SamplesOutputStream$Sample.access$300(SamplesOutputStream.java:253)
	at org.netbeans.modules.sampler.SamplesOutputStream.close(SamplesOutputStream.java:202)
[catch] at org.netbeans.modules.sampler.Sampler.stopSampling(Sampler.java:231)
	at org.netbeans.modules.sampler.Sampler.stop(Sampler.java:207)
	at org.netbeans.core.ui.sampler.SelfSamplerAction$1.doInBackground(SelfSamplerAction.java:90)
	at java.desktop/javax.swing.SwingWorker$1.call(SwingWorker.java:304)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.desktop/javax.swing.SwingWorker.run(SwingWorker.java:343)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
 
Comments
Fix Request This regression breaks NetBeans self profiling capability of the IDE and is a blocker to NetBeans 10 release because of their dependency on `sun.management.ThreadInfoCompositeData` internal API. NetBeans will investigate if the public API is sufficient to replace the use of JDK internal API. JMX monitoring of JDK 11 VM is not impacted. The fix is simple and low risk. The patch can be applied cleanly to jdk11u.
17-10-2018

This is a regression introduced by the fix for JDK-8198253 that causes OpenDataException be thrown when converting StackTraceElement into a CompositeData because itemValues are not in the same order as in itemNames passed to `CompositeDataSupport(compositeType, itemNames, itemValues)`. The fix is to make sure the order of itemNames and itemValues matches. Review thread: http://mail.openjdk.java.net/pipermail/serviceability-dev/2018-October/025527.html
17-10-2018