akshattandon / projectlombok

Automatically exported from code.google.com/p/projectlombok
0 stars 0 forks source link

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

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
* 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.

Original issue reported on code.google.com by ol.logi...@gmail.com on 20 Feb 2015 at 1:14

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

Original comment by ol.logi...@gmail.com on 20 Feb 2015 at 1:17

GoogleCodeExporter commented 9 years ago

Original comment by r.spilker on 20 Feb 2015 at 4:07

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

Original comment by reini...@gmail.com on 14 Apr 2015 at 8:47

GoogleCodeExporter commented 9 years ago
It will take some time to check. Please wait

Original comment by ol.logi...@gmail.com on 17 Apr 2015 at 8:12