Lombok: 1.16.2 Wrong class loader used to load "lombok.javac.apt.Processor"

Created on 15 Jul 2015  路  13Comments  路  Source: projectlombok/lombok

_Migrated from Google Code (issue 791)_

parked

Most helpful comment

By chance I experienced the same error. NetBeans created my "Maven -> Java Application" project with a pom.xml that used the maven-compiler-plugin version 2.3.2. After updating that version number to the current 3.5.1 it compiled fine. I use JDK 1.8.0_72 with Maven 3.3.9 and NetBeans 8.1.

All 13 comments

:bust_in_silhouette: ol.loginov   :clock8: Feb 20, 2015 at 13:14 UTC
- What steps will reproduce the problem?
1. Create maven project using maven-archetype-quickstart archetype with any artefactId and groupId.
2. Add maven dependency "org.projectlombok:lombok:1.16.2"
3. For Main class of project add field, set @ Getter on it and invoke getter in main() method.
4. Run "mvn compile" command to build the project
5. Got a compilation failure "cannot find symbol"
- What is the expected output? What do you see instead?

Expected to build the project successfully

  • What version of the product are you using? On what operating system?

Maven:
Apache Maven 3.0.3 (r1075438; 2011-02-28 20:31:09+0300)
Maven home: /home/oregu-shared/local/apache-maven-3.0.3
Java version: 1.7.0_76, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-oracle/jre
Default locale: ru_RU, platform encoding: UTF-8
OS name: "linux", version: "3.16.0-30-generic", arch: "amd64", family: "unix"

lombok-1.16.2.jar.sha1 - abcc131bb227dcdd30437ee1cc164579767b03b4
lombok-1.16.2-sources.jar.sha1 - d290f2c24acbbd5c036b1091e4bd149e2fe9877c

  • Please provide any additional information below.

I see in debugger this piece of code (in lombok.core.AnnotationProcessor$JavacDescriptor). It fails to find class "lombok.javac.apt.Processor":

try {
ClassLoader classLoader = findAndPatchClassLoader(procEnv);
processor = (Processor)Class.forName("lombok.javac.apt.Processor", false, classLoader).newInstance();
} catch (Exception e) {
...
}

I think the problem is that "classLoader" here is not ShadowClassLoader, so it cannot find lombok.javac.apt.Processor.SCL.lombok class file.

:bust_in_silhouette: ol.loginov   :clock8: Feb 20, 2015 at 13:17 UTC

Sorry, issue title is not right :)
It should be "Wrong class loader used ..." instead of "Wrong class loader user ..."

:bust_in_silhouette: reinierz   :clock8: Apr 14, 2015 at 20:47 UTC

Hello ol.loginov, can you check if this bug still occurs in lombok v1.16.4 which is out now.

:bust_in_silhouette: ol.loginov   :clock8: Apr 17, 2015 at 08:12 UTC

It will take some time to check. Please wait

:bust_in_silhouette: david.[email protected]   :clock8: Jun 18, 2015 at 10:36 UTC

Im having the same problem (using 1.16.4) -.-

_End of migration_

I have experienced the same problem with version 1.16.4

You found a bug in lombok; lombok.javac.apt.Processor is not available. Lombok will not run during this compilation: java.lang.ClassNotFoundException: lombok.javac.apt.Processor

Some more details

Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100)
Maven home: /home/tprzybyl/softwares/maven
Java version: 1.7.0_79, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.16.0-44-generic", arch: "amd64", family: "unix"

But the funny thing is that it appears only in some projects, while others work just fine. I am reverting version to 1.14.8. Good luck hunting this bug down!

Hello
same probleme

mvn -V clean package -e
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T13:57:37+02:00)
Maven home: /Users/clalleme/opt/apache-maven-3.3.3
Java version: 1.8.0_51, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre
Default locale: fr_FR, platform encoding: UTF-8
OS name: "mac os x", version: "10.10.5", arch: "x86_64", family: "mac"

We've added some debug information in the latest edge release. Can you give this one a try?

I tried but sounds the same
Where are the debug information: stdout ? or a file ?

[WARNING] /Users/clalleme/IdeaProjects/demog/src/main/java/org/icroco/haura/knxip/KnxHeader.java:[5,26] [deprecation] Builder in lombok.experimental has been deprecated
[WARNING] /Users/clalleme/IdeaProjects/demog/src/main/java/org/icroco/haura/knxip/KnxHpai.java:[5,26] [deprecation] Builder in lombok.experimental has been deprecated
[WARNING] /Users/clalleme/IdeaProjects/demog/src/main/java/org/icroco/haura/knxip/EKnxCode.java:[11,7] You found a bug in lombok; lombok.javac.apt.LombokProcessor is not available. Lombok will not run during this compilation: java.lang.ClassNotFoundException: lombok.javac.apt.LombokProcessor
[WARNING] 356)
/Users/clalleme/IdeaProjects/demog/src/main/java/org/icroco/haura/knxip/KnxHeader.java:[5,26] [deprecation] Builder in lombok.experimental has been deprecated
[WARNING] /Users/clalleme/IdeaProjects/demog/src/main/java/org/icroco/haura/knxip/KnxHpai.java:[5,26] [deprecation] Builder in lombok.experimental has been deprecated
[INFO] 5 warnings 

By chance I experienced the same error. NetBeans created my "Maven -> Java Application" project with a pom.xml that used the maven-compiler-plugin version 2.3.2. After updating that version number to the current 3.5.1 it compiled fine. I use JDK 1.8.0_72 with Maven 3.3.9 and NetBeans 8.1.

For us this problem has occurred all versions of Lombok since 1.14.8 when used with maven-compiler-plugin version 2.3.2. Updating to 3.5.1 according to @lathspell s suggestion resolved it.

Several reports suggest that using the 3.5.1 maven-compiler-plugin fixes this problem.

Was this page helpful?
0 / 5 - 0 ratings