JDK-8212795 : ThreadInfoCompositeData.toCompositeData fails to map ThreadInfo to CompositeData
  • Type: Bug
  • Component: core-svc
  • Sub-Component: java.lang.management
  • Affected Version: 11
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2018-10-23
  • Updated: 2019-02-11
  • Resolved: 2018-10-25
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
11.0.2Fixed
Related Reports
Relates :  
Relates :  
Description
JDK-8212197 doesn't completely fix the regression introduced by JDK-8198253.  NetBeans uses the internal API `sun.management.ThreadInfoCompositeData.toCompositeData(ThreadInfo)` which throws OpenDataException.

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)
	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)
	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:835)xx
Caused by: java.lang.IllegalArgumentException: Argument compositeType cannot be null.
	at java.management/javax.management.openmbean.CompositeDataSupport.<init>(CompositeDataSupport.java:206)
	at java.management/javax.management.openmbean.CompositeDataSupport.<init>(CompositeDataSupport.java:118)
	at java.management/sun.management.ThreadInfoCompositeData.getCompositeData(ThreadInfoCompositeData.java:130)
	at java.management/sun.management.ThreadInfoCompositeData.toCompositeData(ThreadInfoCompositeData.java:72)
	... 18 more

See also latest comments on https://issues.apache.org/jira/browse/NETBEANS-1359?focusedCommentId=16658301&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-16658301



Comments
Where/how can this be verified, when/where will this fix be available in a build for JDK 11 or 12?
31-10-2018

Fix Request Self profiling capability of NetBeans is broken by this regression. JDK-8212197 resolved the issue NB reported but later uncovered another issue due to their use of JDK internal API `sun.management.ThreadInfoCompositeData.toCompositeData`. This fix has been verified by NetBeans 10 [1] and self profiling capability is working with this fix. The patch applies cleanup to jdk11u repo. `sun.management.ThreadInfoCompositeData` internal API. [1] http://mail.openjdk.java.net/pipermail/serviceability-dev/2018-October/025742.html JDK-8212197 resolved one issue NB reported. because of their dependency on NetBeans will investigate if the public API is sufficient to replace the use of JDK internal API. The fix is simple and low risk. The patch can be applied cleanly to jdk11u.
25-10-2018