This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 255330 - It is not possible to take heap dump
Summary: It is not possible to take heap dump
Status: RESOLVED FIXED
Alias: None
Product: profiler
Classification: Unclassified
Component: Engine (show other bugs)
Version: 8.0
Hardware: All All
: P2 normal (vote)
Assignee: Tomas Hurka
URL:
Keywords: JDK_9
Depends on:
Blocks:
 
Reported: 2015-09-16 12:40 UTC by Tomas Hurka
Modified: 2015-09-17 01:25 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Hurka 2015-09-16 12:40:42 UTC
It is not possible to take heap dump if profiled application is running on JDK 9 build with Jigsaw.
Heap dump initialisation fails with:

javax.management.ReflectionException: Exception thrown trying to invoke the MBean's constructor
	at com.sun.jmx.mbeanserver.MBeanInstantiator.instantiate(java.management@9.0/MBeanInstantiator.java:320)
	at com.sun.jmx.mbeanserver.MBeanInstantiator.instantiate(java.management@9.0/MBeanInstantiator.java:566)
	at com.sun.jmx.mbeanserver.MBeanInstantiator.instantiate(java.management@9.0/MBeanInstantiator.java:491)
	at com.sun.jmx.mbeanserver.JmxMBeanServer.instantiate(java.management@9.0/JmxMBeanServer.java:952)
	at org.netbeans.lib.profiler.server.system.HeapDump.initialize16(HeapDump.java:119)
	at org.netbeans.lib.profiler.server.system.HeapDump.initialize(HeapDump.java:83)
	at org.netbeans.lib.profiler.server.ProfilerInterface.initProfilerInterface(ProfilerInterface.java:536)
	at org.netbeans.lib.profiler.server.ProfilerServer.initSupportingFunctionality(ProfilerServer.java:985)
	at org.netbeans.lib.profiler.server.ProfilerServer.doActivate(ProfilerServer.java:919)
	at org.netbeans.lib.profiler.server.ProfilerServer.activate(ProfilerServer.java:523)
Caused by: java.lang.IllegalAccessException: Class com.sun.jmx.mbeanserver.MBeanInstantiator (module java.management) can not access a member of class com.sun.management.internal.HotSpotDiagnostic (module jdk.management) with modifiers "public", module jdk.management does not export com.sun.management.internal to module java.management
	at sun.reflect.Reflection.throwIllegalAccessException(java.base@9.0/Reflection.java:453)
	at sun.reflect.Reflection.ensureMemberAccess(java.base@9.0/Reflection.java:128)
	at java.lang.reflect.AccessibleObject.slowCheckMemberAccess(java.base@9.0/AccessibleObject.java:384)
	at java.lang.reflect.AccessibleObject.checkAccess(java.base@9.0/AccessibleObject.java:376)
	at java.lang.reflect.Constructor.newInstance(java.base@9.0/Constructor.java:414)
	at com.sun.jmx.mbeanserver.MBeanInstantiator.instantiate(java.management@9.0/MBeanInstantiator.java:308)
	... 9 more
Comment 1 Tomas Hurka 2015-09-16 14:13:11 UTC
Fixed in profiler-main

changeset:   291576:eaf686854873
user:        Tomas Hurka <thurka@netbeans.org>
date:        Wed Sep 16 16:11:44 2015 +0200
summary:     bugfix #255330, use MBeanServer.invoke() to take heap dump instead of reflection
Comment 2 Quality Engineering 2015-09-17 01:25:38 UTC
Integrated into 'main-silver', will be available in build *201509170002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/eaf686854873
User: Tomas Hurka <thurka@netbeans.org>
Log: bugfix #255330, use MBeanServer.invoke() to take heap dump instead of reflection