Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.16.2 Wrong class loader used to load "lombok.javac.apt.Processor" #826

Closed
lombokissues opened this issue Jul 14, 2015 · 13 comments
Closed
Labels
parked Without further feedback this bug cannot be processed. If no feedback is provided, we close these.

Comments

@lombokissues
Copy link

Migrated from Google Code (issue 791)

@lombokissues
Copy link
Author

👤 ol.loginov   🕗 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.

@lombokissues
Copy link
Author

👤 ol.loginov   🕗 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 ..."

@lombokissues
Copy link
Author

👤 reinierz   🕗 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.

@lombokissues lombokissues added the parked Without further feedback this bug cannot be processed. If no feedback is provided, we close these. label Jul 14, 2015
@lombokissues
Copy link
Author

👤 ol.loginov   🕗 Apr 17, 2015 at 08:12 UTC

It will take some time to check. Please wait

@lombokissues
Copy link
Author

👤 [email protected]   🕗 Jun 18, 2015 at 10:36 UTC

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

@lombokissues
Copy link
Author

End of migration

@bsodzik
Copy link

bsodzik commented Jul 24, 2015

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!

@ouaibsky
Copy link

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"

@rspilker
Copy link
Collaborator

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

@ouaibsky
Copy link

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 

@lathspell
Copy link

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.

@eaaltonen
Copy link

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.

@rspilker
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parked Without further feedback this bug cannot be processed. If no feedback is provided, we close these.
Projects
None yet
Development

No branches or pull requests

6 participants