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

Comments

Projects
None yet
6 participants
@lombokissues
Collaborator

lombokissues commented Jul 14, 2015

Migrated from Google Code (issue 791)

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

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

Collaborator

lombokissues commented Jul 14, 2015

👤 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

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

👤 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 ..."

Collaborator

lombokissues commented Jul 14, 2015

👤 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

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

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

Collaborator

lombokissues commented Jul 14, 2015

👤 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 label Jul 14, 2015

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

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

It will take some time to check. Please wait

Collaborator

lombokissues commented Jul 14, 2015

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

It will take some time to check. Please wait

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

👤 david.iacovangelo@adtech.com   🕗 Jun 18, 2015 at 10:36 UTC

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

Collaborator

lombokissues commented Jul 14, 2015

👤 david.iacovangelo@adtech.com   🕗 Jun 18, 2015 at 10:36 UTC

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

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

End of migration

Collaborator

lombokissues commented Jul 14, 2015

End of migration

@bsodzik

This comment has been minimized.

Show comment
Hide comment
@bsodzik

bsodzik 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!

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

This comment has been minimized.

Show comment
Hide comment
@ouaibsky

ouaibsky Sep 21, 2015

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"

ouaibsky commented Sep 21, 2015

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

This comment has been minimized.

Show comment
Hide comment
@rspilker

rspilker Dec 18, 2015

Collaborator

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

Collaborator

rspilker commented Dec 18, 2015

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

@ouaibsky

This comment has been minimized.

Show comment
Hide comment
@ouaibsky

ouaibsky Dec 19, 2015

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 

ouaibsky commented Dec 19, 2015

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

This comment has been minimized.

Show comment
Hide comment
@lathspell

lathspell Mar 8, 2016

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.

lathspell commented Mar 8, 2016

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

This comment has been minimized.

Show comment
Hide comment
@eaaltonen

eaaltonen Apr 15, 2016

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.

eaaltonen commented Apr 15, 2016

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

This comment has been minimized.

Show comment
Hide comment
@rspilker

rspilker May 11, 2016

Collaborator

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

Collaborator

rspilker commented May 11, 2016

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

@rspilker rspilker closed this May 11, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment