question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

J17 - Javac fail to compile code with manifold preprocessor

See original GitHub issue

Describe the bug Compiler fail to compile multimodule maven project (without real use of manifold in source code, attached only manifold preprocessor and rt dependency in parent).

To Reproduce Steps to reproduce the behavior:

  1. Add manifold preprocessor to annotationProcessorPaths in BOM file
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.8.1</version>
                    <configuration>
                        <debug>true</debug>
                        <debuglevel>lines,vars,source</debuglevel>
                        <parameters>true</parameters>
                        <source>${maven.compiler.source}</source>
                        <target>${maven.compiler.target}</target>
                        <compilerArgs>
                            <arg>--add-modules</arg>
                            <arg>jdk.incubator.vector</arg>
                            <arg>--add-modules</arg>
                            <arg>jdk.incubator.foreign</arg>
                            <arg>-Xplugin:Manifold</arg>
                        </compilerArgs>
                        <annotationProcessorPaths>
                            <path>
                                <groupId>org.projectlombok</groupId>
                                <artifactId>lombok</artifactId>
                                <version>${lombok.version}</version>
                            </path>
                            <path>
                                <groupId>systems.manifold</groupId>
                                <artifactId>manifold-preprocessor</artifactId>
                                <version>${manifold.version}</version>
                            </path>
                        </annotationProcessorPaths>
                    </configuration>
                </plugin>
  1. Add manifold-ext-rt to dependencies in BOM file
            <dependency>
                <groupId>systems.manifold</groupId>
                <artifactId>manifold-ext-rt</artifactId>
                <version>${manifold.version}</version>
            </dependency>
  1. Run maven clean install or Build-Rebuild Project in IDEA

Expected behavior Project normally compile, without exceptions.

Desktop (please complete the following information):

  • OS Type & Version: Win 10 LTSC 21H2 (19044.1586)
  • Java/JDK version: 17GA, 17u35
  • IDE version (IntelliJ IDEA or Android Studio): IDEA 2021.2.2
  • Manifold version: 2022.1.7
  • Manifold IntelliJ plugin version: 2021.2.47

Additional context

  1. Project use lombok code-generation.
  2. Project use incubator parts: vector api, foreign

Stack trace

D:\JDK\jdk-17u35\bin\java.exe -Dmaven.multiModuleProjectDirectory=D:\finex\finex-server --enable-preview --add-modules jdk.incubator.foreign --add-modules jdk.incubator.vector -Dmaven.home=D:\Soft\apache-maven-3.8.2 -Dclassworlds.conf=D:\Soft\apache-maven-3.8.2\bin\m2.conf "-Dmaven.ext.class.path=C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2021.2.2\plugins\maven\lib\maven-event-listener.jar" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2021.2.2\lib\idea_rt.jar=53224:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2021.2.2\bin" -Dfile.encoding=UTF-8 -classpath D:\Soft\apache-maven-3.8.2\boot\plexus-classworlds-2.6.0.jar;D:\Soft\apache-maven-3.8.2\boot\plexus-classworlds.license org.codehaus.classworlds.Launcher -Didea.version=2021.2.2 clean install
WARNING: Using incubator modules: jdk.incubator.foreign, jdk.incubator.vector
[INFO] Scanning for projects...
...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] FinEx Server                                                       [pom]
[INFO] finex-server-build                                                 [pom]
[INFO] Finex Server Netty Module                                          [jar]
[INFO] FinEx Server Core                                                  [jar]
[INFO] FinEx Server Auth                                                  [jar]
[INFO] FinEx Server World                                                 [jar]
[INFO] 
[INFO] -----------------------< ru.finex:finex-server >------------------------
[INFO] Building FinEx Server 1.0-SNAPSHOT                                 [1/6]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ finex-server ---
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ finex-server ---
[INFO] Installing D:\finex\finex-server\pom.xml to C:\Users\zcxv\.m2\repository\ru\finex\finex-server\1.0-SNAPSHOT\finex-server-1.0-SNAPSHOT.pom
[INFO] 
[INFO] --------------------< ru.finex:finex-server-build >---------------------
[INFO] Building finex-server-build 1.0-SNAPSHOT                           [2/6]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ finex-server-build ---
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ finex-server-build ---
[INFO] Installing D:\finex\finex-server\server-build\pom.xml to C:\Users\zcxv\.m2\repository\ru\finex\finex-server-build\1.0-SNAPSHOT\finex-server-build-1.0-SNAPSHOT.pom
[INFO] 
[INFO] --------------------< ru.finex:finex-netty-network >--------------------
[INFO] Building Finex Server Netty Module 1.0.0-SNAPSHOT                  [3/6]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ finex-netty-network ---
[INFO] Deleting D:\finex\finex-server\netty-network\target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ finex-netty-network ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ finex-netty-network ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 8 source files to D:\finex\finex-server\netty-network\target\classes
An exception has occurred in the compiler (17). 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, the following diagnostic, and the parameters passed to the Java compiler in your report. Thank you.
java.lang.NullPointerException: Cannot invoke "java.util.Queue.add(Object)" because "this.deferred" is null
	at jdk.compiler/com.sun.tools.javac.util.Log$DeferredDiagnosticHandler.report(Log.java:150)
	at jdk.compiler/com.sun.tools.javac.util.Log.report(Log.java:660)
	at jdk.compiler/com.sun.tools.javac.util.AbstractLog.warning(AbstractLog.java:163)
	at jdk.compiler/com.sun.tools.javac.comp.Modules.setupAllModules(Modules.java:1350)
	at jdk.compiler/com.sun.tools.javac.comp.Modules.lambda$initModules$0(Modules.java:235)
	at jdk.compiler/com.sun.tools.javac.comp.Modules.enter(Modules.java:267)
	at jdk.compiler/com.sun.tools.javac.comp.Modules.initModules(Modules.java:231)
	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.initModules(JavaCompiler.java:1021)
	at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.<init>(JavacProcessingEnvironment.java:1126)
	at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.next(JavacProcessingEnvironment.java:1153)
	at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1393)
	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1234)
	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:916)
	at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:104)
	at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.invocationHelper(JavacTaskImpl.java:152)
	at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:100)
	at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:94)
	at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess(JavaxToolsCompiler.java:126)
	at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile(JavacCompiler.java:174)
	at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:1134)
	at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:187)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
	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:56)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:972)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:293)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:196)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
	at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] An unknown compilation problem occurred
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] FinEx Server 1.0-SNAPSHOT .......................... SUCCESS [  0.185 s]
[INFO] finex-server-build 1.0-SNAPSHOT .................... SUCCESS [  0.005 s]
[INFO] Finex Server Netty Module 1.0.0-SNAPSHOT ........... FAILURE [  1.478 s]
[INFO] FinEx Server Core 1.0.0-SNAPSHOT ................... SKIPPED
[INFO] FinEx Server Auth 1.0.0-SNAPSHOT ................... SKIPPED
[INFO] FinEx Server World 1.0.0-SNAPSHOT .................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.758 s
[INFO] Finished at: 2022-03-27T10:52:30+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project finex-netty-network: Compilation failure
...

Process finished with exit code 1

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rsmckinneycommented, Apr 28, 2022

@zcxv Thanks for your cooperation!

A fix is available with release 2022.1.11

0reactions
zcxvcommented, Apr 28, 2022

Yay, it’s works! Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

javac -source 1.7 -target 1.7 · Issue #151 - GitHub
Manifold components, both compile-time and runtime, including the preprocessor, require at least Java 8. So 1.7 is not supported.
Read more >
"Error running javac compiler" when trying to ... - Stack Overflow
I am trying to compile some Java code from a public GitHub repository that uses Ant. Working from the command line in Linux...
Read more >
A Preprocessor for Java - Manifold
First things first, the preprocessor is a javac plugin which means it plugs directly into your Java compiler and runs as part of...
Read more >
Manifold is a Java compiler plugin, its features include ...
It is therefore tied to a specific JDK release, and is intentionally non-portable -- the moment it stops being developed, even existing code...
Read more >
Lesson: Common Problems (and Their Solutions) (The Java ...
If you see any compiler errors, then your program did not successfully compile, and the compiler did not create a .class file. Carefully...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found