JDK-8180311 : [TESTBUG] gc/stress/gclocker/TestGCLockerWithSerial fails with ClassNotFoundException: java.lang.management.ManagementFactory
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 10
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2017-05-12
  • Updated: 2020-09-01
  • Resolved: 2017-08-10
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 10
10 b21Fixed
Related Reports
Relates :  
Sub Tasks
JDK-8185879 :  
Description
This seems to affect only minimal VM:

----------System.out:(9/789)----------
[0.035s][info][gc] Using Serial
[1.299s][info][gc,heap,exit] Heap
[1.299s][info][gc,heap,exit]  def new generation   total 4864K, used 4260K [0x56600000, 0x56b40000, 0x75a00000)
[1.299s][info][gc,heap,exit]   eden space 4352K,  97% used [0x56600000, 0x56a291e0, 0x56a40000)
[1.299s][info][gc,heap,exit]   from space 512K,   0% used [0x56a40000, 0x56a40000, 0x56ac0000)
[1.299s][info][gc,heap,exit]   to   space 512K,   0% used [0x56ac0000, 0x56ac0000, 0x56b40000)
[1.299s][info][gc,heap,exit]  tenured generation   total 11008K, used 0K [0x75a00000, 0x764c0000, 0xb4200000)
[1.299s][info][gc,heap,exit]    the space 11008K,   0% used [0x75a00000, 0x75a00000, 0x75a00200, 0x764c0000)
[1.299s][info][gc,heap,exit]  Metaspace       used 4154K, capacity 4203K, committed 4248K, reserved 4400K
----------System.err:(22/1431)----------
java.lang.NoClassDefFoundError: java/lang/management/ManagementFactory
	at MemoryWatcher.<init>(TestGCLocker.java:89)
	at MemoryUser.<init>(TestGCLocker.java:154)
	at TestGCLocker.startMemoryUser(TestGCLocker.java:194)
	at TestGCLocker.main(TestGCLocker.java:213)
	at TestGCLockerWithSerial.main(TestGCLockerWithSerial.java:35)
	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:563)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:115)
	at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: java.lang.ClassNotFoundException: java.lang.management.ManagementFactory
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:552)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:185)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:473)
	... 11 more

JavaTest Message: Test threw exception: java.lang.NoClassDefFoundError: java/lang/management/ManagementFactory
JavaTest Message: shutting down test


Comments
The referenced java.lang.management.ManagementFactory does not exist in a minimal VM. The suggested fix is to exclude this test for minimal VM.
07-08-2017

Moving the integration_blocker label to JDK-8185879. Update: This test is only present in JDK10/hs. That makes this an integration_blocker so I'm putting back the label.
04-08-2017

The fix that added this test: JDK-8177968 is only in JDK10/hs so that makes this bug an integration_blocker.
04-08-2017

the test should either declare its dependency on java.management module w/ @modules tag or be rewritten to get rid of this dependency.
01-08-2017