JDK-6858708 : HotspotDiagnosticMXBean.setVMOption() throws NullPointerException
  • Type: Bug
  • Component: core-svc
  • Sub-Component: java.lang.management
  • Affected Version: 7
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: x86
  • Submitted: 2009-07-09
  • Updated: 2010-09-29
  • Resolved: 2009-11-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 7
7 b77Fixed
Related Reports
Relates :  
Relates :  
Description
Just call HotSpotDiagnostic.setVMOption("HeapDumpPath","/tmp") and you get the exception below:

$ /usr/java/jdk1.7.0/bin/java -jar /tmp/Test/dist/Test.jar
Exception in thread "main" java.lang.NullPointerException
	at sun.management.HotSpotDiagnostic.setVMOption(HotSpotDiagnostic.java:113)
	at test.Main.main(Main.java:19)

$ /usr/java/jdk1.7.0/bin/java -version
java version "1.7.0-ea"
Java(TM) SE Runtime Environment (build 1.7.0-ea-b59)
Java HotSpot(TM) Client VM (build 16.0-b03, mixed mode, sharing)
$

Comments
EVALUATION http://hg.openjdk.java.net/jdk7/tl/jdk/rev/16bce7ce4fc9
16-11-2009

EVALUATION flag.getValue() for HeapDumpPath flag returns null, which causes that the type of flag is not recognized and error-reporting code in setVMOption() thrown NPE. Default value for HeapDumpPath flag is now null instead of an empty string due to CR 6604006.
09-07-2009