JDK-8191322 : Compiler failure but no compiler message on the console
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 9.0.1,10
  • Priority: P3
  • Status: Resolved
  • Resolution: Not an Issue
  • CPU: generic
  • Submitted: 2017-11-13
  • Updated: 2019-08-02
  • Resolved: 2017-12-19
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
10Resolved
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
javac 9.0.1

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 10.0.15063]

A DESCRIPTION OF THE PROBLEM :
https://issues.apache.org/jira/browse/MCOMPILER-308 is the root issue.
I can reproduce the problem with Java 9 and 9.0.1, not with Java7 or Java 8

REGRESSION.  Last worked in version 8u152

ADDITIONAL REGRESSION INFORMATION: 
java version "1.8.0_152"
Java(TM) SE Runtime Environment (build 1.8.0_152-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.152-b16, mixed mode)

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
git clone https://git-wip-us.apache.org/repos/asf/logging-log4j2.git
git checkout tags/log4j-2.9.1-rc1
mvn -e clean verify

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Compilation with success (as with Java7 and Java 8)
ACTUAL -
Compilation failure without message

REPRODUCIBILITY :
This bug can be reproduced always.


Comments
Filed a new core-libs issue for JarFileSystem issue: JDK-8193802. Closing this bug as Not an Issue.
19-12-2017

Additional info from submitter: this conclusion is spot on! the project actually caused their own problem. the log4j-api (Maven) module generates 2 jars: - log4j-api-2.10.1-SNAPSHOT.jar - log4j-api-2.10.1-SNAPSHOT-tests.jar The archiver shares configuration for both jars, including this Manifest flag. So the output issue must be fixed on our side. This JDK issue should be replaced with an issue to make the JarFileSystem more robust. I hope this is enough for you to continue, no small reproducible test case required anymore.
15-12-2017

Closing Incomplete, until we hear back whether there is a bad jar file involved.
11-12-2017

At this point, I don't see a javac problem here. The submitter talks about a mixup: " there's seems to be some kind of mixup, based on the path the artifactId should *not* be asm-xml, but either asm[1] or asm-util[2] " but given the description of the mixup involves artifactIds, that sounds more like a Maven mixup than a javac or file manager mixup. However, there obviously is a crash here, but the crash (NPE) is deep inside the JarFileSystem (i.e. core-libs, not javac), so it's not clear that javac should be doing anything more than it's already doing, to report an internal crash. Looking at the JarFileSystem code involved in the stacktrace, it seems that the jar file claims to be a MR-jar (it has the MULTI-RELEASE attribute) but does not have any versions (/META-INF/versions). This seems to indicate both of the following two issues: 1. The JarFileSystem code should be more robust in the face of malformed files 2. The proximate root cause is a malformed JAR file being provided/used in the submitter's environment. Neither of those are javac issues.
11-12-2017

Additional info from bug submitter: Ok, it took some time, but I'm a little bit closer. Part of the hidden logging is caused by Plexus-Javac-Compiler, probably because it cannot parse the content. Here is at least the output. I have to dive into the bad path elements, there's seems to be some kind of mixup, based on the path the artifactId should *not* be asm-xml, but either asm[1] or asm-util[2] At least we now see the exception. I hope this helps. warning: [path] bad path element "d:\maven_repo\.m2\repository\org\ow2\asm\asm-xml\5.0.3\asm-5.0.3.jar": no such file or directory warning: [path] bad path element "d:\maven_repo\.m2\repository\org\ow2\asm\asm-xml\5.0.3\asm-util-5.0.3.jar": no such file or directory warning: [options] bootstrap class path not set in conjunction with -source 1.7 3 warnings An exception has occurred in the compiler (9). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you. java.lang.NullPointerException at jdk.zipfs/jdk.nio.zipfs.JarFileSystem.getVersionMap(JarFileSystem.java:137) at jdk.zipfs/jdk.nio.zipfs.JarFileSystem.createVersionedLinks(JarFileSystem.java:112) at jdk.zipfs/jdk.nio.zipfs.JarFileSystem.<init>(JarFileSystem.java:85) at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.newFileSystem(ZipFileSystemProvider.java:134) at jdk.compiler/com.sun.tools.javac.file.JavacFileManager$ArchiveContainer.<init>(JavacFileManager.java:517) at jdk.compiler/com.sun.tools.javac.file.JavacFileManager.getContainer(JavacFileManager.java:319) at jdk.compiler/com.sun.tools.javac.file.JavacFileManager.list(JavacFileManager.java:715) at jdk.compiler/com.sun.tools.javac.code.ClassFinder.list(ClassFinder.java:722) at jdk.compiler/com.sun.tools.javac.code.ClassFinder.scanUserPaths(ClassFinder.java:655) at jdk.compiler/com.sun.tools.javac.code.ClassFinder.fillIn(ClassFinder.java:526) at jdk.compiler/com.sun.tools.javac.code.ClassFinder.complete(ClassFinder.java:293) at jdk.compiler/com.sun.tools.javac.code.Symbol.complete(Symbol.java:633) at jdk.compiler/com.sun.tools.javac.code.Symbol$PackageSymbol.members(Symbol.java:1120) at jdk.compiler/com.sun.tools.javac.code.Symtab.listPackageModules(Symtab.java:810) at jdk.compiler/com.sun.tools.javac.comp.Enter.visitTopLevel(Enter.java:344) at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:529) at jdk.compiler/com.sun.tools.javac.comp.Enter.classEnter(Enter.java:285) at jdk.compiler/com.sun.tools.javac.comp.Enter.classEnter(Enter.java:300) at jdk.compiler/com.sun.tools.javac.comp.Enter.complete(Enter.java:570) at jdk.compiler/com.sun.tools.javac.comp.Enter.main(Enter.java:554) at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:1052) at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:923) at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:302) at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:162) at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:57) at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:43)
11-12-2017

There is a behavioural difference from JDK9 build 165 to build 166. Build 165: [INFO] Reactor Summary: [INFO] [INFO] Apache Log4j 2 ..................................... SUCCESS [ 4.674 s] [INFO] Apache Log4j API Java 9 support .................... FAILURE [ 5.348 s] [INFO] Apache Log4j API ................................... SKIPPED [INFO] Apache Log4j Core .................................. SKIPPED [INFO] Apache Log4j Core Integration Tests ................ SKIPPED [INFO] Apache Log4j 1.x Compatibility API ................. SKIPPED [INFO] Apache Log4j SLF4J Binding ......................... SKIPPED [INFO] Apache Log4j to SLF4J Adapter ...................... SKIPPED Build 166: [INFO] Reactor Summary: [INFO] [INFO] Apache Log4j 2 ..................................... SUCCESS [ 4.534 s] [INFO] Apache Log4j API Java 9 support .................... SUCCESS [ 10.063 s] [INFO] Apache Log4j API ................................... SUCCESS [ 36.818 s] [INFO] Apache Log4j Core .................................. FAILURE [01:20 min] [INFO] Apache Log4j Core Integration Tests ................ SKIPPED [INFO] Apache Log4j 1.x Compatibility API ................. SKIPPED [INFO] Apache Log4j SLF4J Binding ......................... SKIPPED [INFO] Apache Log4j to SLF4J Adapter ...................... SKIPPED With build 165, it started failing from 'Apache Log4j API Java 9 support' onwards. But with build 166, it passed 'Apache Log4j API Java 9 support' and started failing from 'Apache Log4j Core' onwards.
17-11-2017

Issue is reproducible on 9 and 10 ea b31 below is the output. There is no compiler related error reported. == [INFO] Apache Log4j 2 ..................................... SUCCESS [ 3.763 s] [INFO] Apache Log4j API Java 9 support .................... SUCCESS [01:29 min] [INFO] Apache Log4j API ................................... SUCCESS [01:09 min] [INFO] Apache Log4j Core .................................. FAILURE [03:04 min]
15-11-2017

Additional information from submitter == Go to /scratch/fairoz/tools/apache-maven-3.5.0/conf and edit toolchains.xml Add the following entry: <toolchain> <type>jdk</type> <provides> <version>9</version> <vendor>oracle</vendor> </provides> <configuration> <jdkHome>/path/to/jdk/9</jdkHome> </configuration> </toolchain> ==
15-11-2017

Additional information requested from submitter to resolve the issue.
15-11-2017

Getting below issue during "mvn -e clean verify" == [ERROR] Failed to execute goal org.apache.maven.plugins:maven-toolchains-plugin:1.1:toolchain (default) on project log4j-api-java9: Cannot find matching toolchain definitions for the following toolchain types: [ERROR] jdk [ version='9' ] [ERROR] Please make sure you define the required toolchains in your ~/.m2/toolchains.xml file. [ERROR] -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-toolchains-plugin:1.1:toolchain (default) on project log4j-api-java9: Cannot find matching toolchain definitions for the following toolchain types: jdk [ version='9' ] Please make sure you define the required toolchains in your ~/.m2/toolchains.xml file. at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345) at org.apache.maven.cli.MavenCli.main(MavenCli.java:191) 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:564) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) Caused by: org.apache.maven.plugin.MojoFailureException: Cannot find matching toolchain definitions for the following toolchain types: jdk [ version='9' ] Please make sure you define the required toolchains in your ~/.m2/toolchains.xml file. at org.apache.maven.plugin.toolchain.ToolchainMojo.execute(ToolchainMojo.java:110) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) ... 20 more [ERROR] [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn <goals> -rf :log4j-api-java9
15-11-2017