JDK-8213299 : runtime/appcds/jigsaw/classpathtests/EmptyClassInBootClassPath.java failed with java.lang.NoSuchMethodException
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang:reflect
  • Affected Version: 12
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-11-02
  • Updated: 2019-08-15
  • Resolved: 2019-01-11
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 12 JDK 13
12 b28Fixed 13Fixed
Related Reports
Relates :  
Relates :  
Sub Tasks
JDK-8213308 :  
Description
Error info copied from test log:
[STDERR]
java version "12-internal" 2019-03-19
Java(TM) SE Runtime Environment (fastdebug build 12-internal+0-jdk12-jdk.761)
Java HotSpot(TM) 64-Bit Server VM (fastdebug build 12-internal+0-jdk12-jdk.761, mixed mode, sharing)

----------System.err:(26/1440)----------
 stdout: [bootLoader loaded class
cls = class com.sun.tools.javac.Main
java.lang.NoSuchMethodException: com.sun.tools.javac.Main.main()
];
 stderr: [java version "12-internal" 2019-03-19
Java(TM) SE Runtime Environment (fastdebug build 12-internal+0-jdk12-jdk.761)
Java HotSpot(TM) 64-Bit Server VM (fastdebug build 12-internal+0-jdk12-jdk.761, mixed mode, sharing)
]
 exitValue = 0

java.lang.RuntimeException: 'java.lang.NoSuchMethodException: com.sun.tools.javac.Main.main([Ljava.lang.String;)' missing from stdout/stderr

at jdk.test.lib.process.OutputAnalyzer.shouldContain(OutputAnalyzer.java:151)
at jdk.test.lib.cds.CDSTestUtils.checkMatches(CDSTestUtils.java:460)
at jdk.test.lib.cds.CDSTestUtils$Result.assertNormalExit(CDSTestUtils.java:193)
at EmptyClassInBootClassPath.main(EmptyClassInBootClassPath.java:83)
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:567)
at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:246)
at java.base/java.lang.Thread.run(Thread.java:835)

JavaTest Message: Test threw exception: java.lang.RuntimeException
JavaTest Message: shutting down test

result: Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: 'java.lang.NoSuchMethodException: com.sun.tools.javac.Main.main([Ljava.lang.String;)' missing from stdout/stderr 


Started this bug at P3 since it is a tier2 failure on three platforms.
Comments
As discussed on core-libs, http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-December/057648.html , the modified method used to construct exception messages seems to have a bug omitting parameter information.
14-01-2019

This test doesn't need to check the exact parameter types, as it just checks if the requested Main method can be found. So we can relax the error message match to be static final String EXPECTED_EXCEPTION = "java.lang.NoSuchMethodException: com.sun.tools.javac.Main.main" to avoid unnecessary dependency on the exact message format used by the JDK.
18-12-2018

Thanks [~ccheung] and [~darcy]. I've created the subtask to ProblemList. Code review out shortly.
02-11-2018

The code for NoSuchMethodException was not updated as part of JDK-6304578, but the toString output for methods, constructors, and classes was altered. The intention was that the string output would be unaffected unless the method/constructor or class had type arguments. That appears to not always be the case, despite the testing that various exact string results were replicated. I recommend problem listing this test until the unexpected interaction is run down.
02-11-2018

Here's a fix for the test: diff --git a/test/hotspot/jtreg/runtime/appcds/jigsaw/classpathtests/EmptyClassInBootClassPath.java b/test/hotspot/jtreg/runtime/appcds/jigsaw/classpathtests/EmptyClassInBootClassPath.java --- a/test/hotspot/jtreg/runtime/appcds/jigsaw/classpathtests/EmptyClassInBootClassPath.java +++ b/test/hotspot/jtreg/runtime/appcds/jigsaw/classpathtests/EmptyClassInBootClassPath.java @@ -49,7 +49,7 @@ public class EmptyClassInBootClassPath { static final String EXPECTED_EXCEPTION = - "java.lang.NoSuchMethodException: com.sun.tools.javac.Main.main([Ljava.lang.String;)"; + "java.lang.NoSuchMethodException: com.sun.tools.javac.Main.main()"; public static void main(String[] args) throws Exception { String[] className = {"com/sun/tools/javac/Main"}; JarBuilder.build("emptyClass", className); So the change for JDK-6304578 changed the NoSuchMethodException message causing this test to fail. Is the change on the exception message an intended change for JDK-6304578?
02-11-2018

The jdk12-jdk-761 CI job set only contains this change set: Changeset: 6b31efbf833e Author: darcy Date: 2018-11-01 20:37 -0700 URL: http://hg.openjdk.java.net/jdk/jdk/rev/6b31efbf833e 6304578: (reflect) toGenericString fails to print bounds of type variables on generic methods Reviewed-by: vromero, plevart, briangoetz, mcimadamore ! src/java.base/share/classes/java/lang/Class.java ! src/java.base/share/classes/java/lang/reflect/Constructor.java ! src/java.base/share/classes/java/lang/reflect/Executable.java ! src/java.base/share/classes/java/lang/reflect/Method.java ! test/jdk/java/lang/Class/GenericStringTest.java ! test/jdk/java/lang/reflect/Constructor/GenericStringTest.java ! test/jdk/java/lang/reflect/Method/GenericStringTest.java Update: [~darcy], [~iklam], [~ccheung], and/or [~jiangli] - Can you folks brainstorm about how this change could possibly have made this test unhappy? We're seeing failures in tier2 and tier3 since the above fix was pushed.
02-11-2018

This test is failing in every tier2 and tier3 job set so the frequency is high. Bumping from P3 -> P2.
02-11-2018