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

Exception NoClassDefFoundError: com/sun/tools/javac/processing/JavacProcessingEnvironment with m2eclipse when build path changes #250

Closed
lombokissues opened this issue Jul 14, 2015 · 13 comments
Assignees
Milestone

Comments

@lombokissues
Copy link

Migrated from Google Code (issue 177)

@lombokissues
Copy link
Author

👤 sharedocs1   🕗 Jan 04, 2011 at 12:24 UTC

What steps will reproduce the problem?

  1. Download the attached Maven project "lombok-92"
  2. Import into an Eclipse with Maven integration installed
  3. Remove "src/main/java" from the build path

See the attached video "lombok-noclassdef.mp4". It shows first the sequence when running Eclipse without Lombok, then with Lombok (0.10.0-BETA).

What is the expected output? What do you see instead?

Should compile without problems. Instead, an

error: Exception thrown while constructing Processor object: java.lang.NoClassDefFoundError: com/sun/tools/javac/processing/JavacProcessingEnvironment

is returned.

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

OS: Vista SP2 x64
Java: 1.6.0_20-b02, Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)
Eclipse: Helios Service Release 1, Build id 20100917-0705
m2Eclipse: 0.10.2.20100623-1649
Maven Installation: Embedded (3.0-SNAPSHOT/0.10.2.20100623-1649)
Lombok: http://projectlombok.googlecode.com/files/lombok-0.10.0-BETA2.jar

Please provide any additional information below.

See eclipse-config.txt for my full Eclipse configuration, and log-error.txt for the message in the workspace log.

@lombokissues
Copy link
Author

👤 sharedocs1   🕗 Jan 04, 2011 at 12:24 UTC

🔗 lombok-noclassdef.mp4

@lombokissues
Copy link
Author

👤 sharedocs1   🕗 Jan 04, 2011 at 12:24 UTC

🔗 eclipse-config.txt View file

@lombokissues
Copy link
Author

👤 sharedocs1   🕗 Jan 04, 2011 at 12:24 UTC

🔗 log-error.txt View file

@lombokissues
Copy link
Author

👤 sharedocs1   🕗 Jan 04, 2011 at 12:24 UTC

🔗 lombok-92.zip

@lombokissues
Copy link
Author

👤 grootjans   🕗 Feb 07, 2011 at 19:25 UTC

@lombokissues lombokissues added the accepted The issue/enhancement is valid, sensible, and explained in sufficient detail label Jul 14, 2015
@lombokissues lombokissues added this to the 0.10.0 milestone Jul 14, 2015
@lombokissues
Copy link
Author

👤 r.spilker   🕗 Feb 07, 2011 at 21:51 UTC

Hi Andrew,

First of all, you've just been awarded the "Gold Trophy 2011" in the category "Most Complete Bug Reports". We've been able to reproduce the reported behavior.

I do have a couple of questions and remarks though:

  • Modifying the build path is a bit strange if you're using Maven. Is this something you've stumbled upon, the simplest way to reproduce the bug, or does this also occur in other scenarios?
  • I can only reproduce it when I remove src/main/java from the build path, but not for the other source folders, like resources or src/test/*. Is that the same for you?
  • I noticed that in your pom file, there is no reference to groupId "org.projectlombok" or artefactId "lombok". So this problem also occurs in projects that don't use lombok. Correct?
  • I can only reproduce the bug if there is a src/main/resources folder.

Roel

@lombokissues
Copy link
Author

👤 grootjans   🕗 Feb 07, 2011 at 22:37 UTC

@lombokissues
Copy link
Author

👤 sharedocs1   🕗 Feb 08, 2011 at 10:25 UTC

the "Gold Trophy 2011" in the category "Most Complete Bug Reports".

And it's only February! So I have almost a whole year to beat my own record ;-) On to your questions:

Modifying the build path is a bit strange if you're using Maven.

Agreed. As you suspected, this was just the first reliable "trigger" I could find. I normally see this after merging updates from a repo and then starting Eclipse. Obviously, this triggers a bunch of builds, and all I can assume is that the Maven plugin also checks or regenerates the build paths as part of this.

I can only reproduce it when I remove src/main/java from the build path

Haven't tried with other build paths. Again, this is not the normal scenario in which I see this. I wish I could find a way to reliably reproduce it in a more realistic scenario.

So this problem also occurs in projects that don't use lombok

Indeed. In fact, it even occurs in workspaces in which no projects use Lombok. It occurs as soon as the Lombok JAR is installed.

I can only reproduce the bug if there is a src/main/resources folder

Interesting. I wish I could say that makes it a very unusual test case and the problem can be ignored, but I think I'm not the only one using this folder ;-)

@lombokissues
Copy link
Author

👤 r.spilker   🕗 Feb 14, 2011 at 23:16 UTC

Good news, Everyone!!!

I think Roel and I nailed this one done. The commit is pathetically small: 2bacfa6 but nevertheless, it took quite a bit of research before we found this.

Can you check if we fixed it? You can grab an edge release from here:

https://projectlombok.org/download-edge.html

@lombokissues lombokissues removed the accepted The issue/enhancement is valid, sensible, and explained in sufficient detail label Jul 14, 2015
@lombokissues
Copy link
Author

👤 sharedocs1   🕗 Feb 17, 2011 at 19:53 UTC

Hartstikke bedankt! From the commit it certainly looks like a good one: adding a URL to a specific Plexus classloader and making sure you only do it once...I'm sure finding that was fun ;-)

Anyway, I can certainly confirm that the test case for this issue succeeds. I've been running with Lombok since you posted the fix and haven't seen the error in any other scenario yet either. So lookin' good so far.

@lombokissues
Copy link
Author

👤 r.spilker   🕗 Feb 21, 2011 at 21:02 UTC

Issue #165 has been merged into this issue.

@lombokissues
Copy link
Author

End of migration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants