JDK-8154240 : [TESTBUG] Add @build of test library classes to runtime/NMT tests to avoid NoClassDefFoundError
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2016-04-14
  • Updated: 2016-06-17
  • Resolved: 2016-06-17
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 9
9Resolved
Related Reports
Duplicate :  
Description
Sometimes NMT tests failed when executed in parallel with following error:
java.lang.NoClassDefFoundError: jdk/test/lib/JDKToolFinder
	at jdk.test.lib.ProcessTools.createJavaProcessBuilder(ProcessTools.java:150)
	at jdk.test.lib.ProcessTools.createJavaProcessBuilder(ProcessTools.java:146)
	at CommandLineEmptyArgument.main(CommandLineEmptyArgument.java:38)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-internal/Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(java.base@9-internal/NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-internal/DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(java.base@9-internal/Method.java:531)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:110)
	at java.lang.Thread.run(java.base@9-internal/Thread.java:804)
Caused by: java.lang.ClassNotFoundException: jdk.test.lib.JDKToolFinder
	at jdk.internal.loader.BuiltinClassLoader.loadClass(java.base@9-internal/BuiltinClassLoader.java:366)
	at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(java.base@9-internal/ClassLoaders.java:184)
	at java.lang.ClassLoader.loadClass(java.base@9-internal/ClassLoader.java:419)
	... 9 more

Adding explicit @build statements for test library classes can help to avoid such errors.