Eclipse throwing LinkageError #767

Open
lombokissues opened this Issue Jul 14, 2015 · 12 comments

Projects

None yet

4 participants

@lombokissues
Collaborator

Migrated from Google Code (issue 732)

@lombokissues
Collaborator

👤 jorn86   🕗 Aug 29, 2014 at 09:15 UTC

What steps will reproduce the problem?
Not quite sure. It seems to be related to highlighting occurrences, but doesn't always occur. I could sometimes reproduce it by using F3 to go view a library call:

  1. Have a source file that calls a library.
  2. Use F3 to open the library file (make sure it isn't open already) to view the code for that call.
  3. Popup happens

What version of the product are you using? On what operating system?
Lombok 1.14.2 and 1.14.4
Eclipse 4.3
Java 1.7.0_40
Windows 7

Please provide any additional information below.
I've seen this happen with 2 different stacktraces in the error log. Both reference the same Lombok class, but no other Lombok code.

java.lang.LinkageError: lombok/eclipse/agent/PatchFixes
at org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlightingReconciler$PositionCollector.visit(SemanticHighlightingReconciler.java)
at org.eclipse.jdt.core.dom.SimpleName.accept0(SimpleName.java:149)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2514)
at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2562)
at org.eclipse.jdt.core.dom.QualifiedName.accept0(QualifiedName.java:170)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2514)
at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2562)
at org.eclipse.jdt.core.dom.QualifiedName.accept0(QualifiedName.java:170)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2514)
at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2562)
at org.eclipse.jdt.core.dom.QualifiedName.accept0(QualifiedName.java:170)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2514)
at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2562)
at org.eclipse.jdt.core.dom.PackageDeclaration.accept0(PackageDeclaration.java:231)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2514)
at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2562)
at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:218)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2514)
at org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlightingReconciler.reconcilePositions(SemanticHighlightingReconciler.java:371)
at org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlightingReconciler.reconciled(SemanticHighlightingReconciler.java:321)
at org.eclipse.jdt.internal.ui.javaeditor.ClassFileEditor$1.run(ClassFileEditor.java:716)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

java.lang.LinkageError: lombok/eclipse/agent/PatchFixes
at org.eclipse.jdt.internal.ui.search.OccurrencesFinder.addUsage(OccurrencesFinder.java)
at org.eclipse.jdt.internal.ui.search.OccurrencesFinder.visit(OccurrencesFinder.java:149)
at org.eclipse.jdt.core.dom.QualifiedName.accept0(QualifiedName.java:167)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2514)
at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2562)
at org.eclipse.jdt.core.dom.PackageDeclaration.accept0(PackageDeclaration.java:231)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2514)
at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2562)
at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:218)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2514)
at org.eclipse.jdt.internal.ui.search.OccurrencesFinder.performSearch(OccurrencesFinder.java:99)
at org.eclipse.jdt.internal.ui.search.OccurrencesFinder.getOccurrences(OccurrencesFinder.java:104)
at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.updateOccurrenceAnnotations(JavaEditor.java:3355)
at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor$6.selectionChanged(JavaEditor.java:3380)
at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup.calculateASTandInform(SelectionListenerWithASTManager.java:178)
at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup$3.run(SelectionListenerWithASTManager.java:155)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

@lombokissues
Collaborator

👤 jorn86   🕗 Nov 10, 2014 at 09:44 UTC

I've just seen this happen with Lombok 1.14.8 in Eclipse 4.4.0 on Java 1.8.0_25 as well.

@lombokissues
Collaborator

👤 r.spilker   🕗 Nov 10, 2014 at 09:46 UTC

Would you like to test using the edge release? It is experimental, but uses a different class loader infrastructure: https://projectlombok.org/download-edge.html

Do you have a reproduction recipe?

@lombokissues
Collaborator

👤 ddg412   🕗 Nov 20, 2014 at 21:47 UTC

I've also seen the issue (or similar) with:
Lombok 1.14.8
Eclipse 4.4.0
Java 1.7.0_05
Scientific Linux 6.4

For me, it happened when I opened an editor for a Java class that didn't even use Lombok. I had multiple projects in my workspace, however, and a different project does use Lombok.

!ENTRY org.eclipse.core.jobs 4 2 2014-11-20 21:32:01.065
!MESSAGE An internal error occurred during: "Requesting Java AST from selection".
!STACK 0
java.lang.LinkageError: loader (instance of lombok/patcher/equinox/EquinoxClassLoader): attempted duplicate class definition for name: "lombok/eclipse/agent/PatchFixes"
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
at lombok.patcher.equinox.EquinoxClassLoader.loadClass(EquinoxClassLoader.java:195)
at lombok.patcher.equinox.EquinoxClassLoader.overrideLoadResult(EquinoxClassLoader.java:313)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at org.eclipse.jdt.internal.ui.search.OccurrencesFinder.addUsage(OccurrencesFinder.java)
at org.eclipse.jdt.internal.ui.search.OccurrencesFinder.visit(OccurrencesFinder.java:150)
at org.eclipse.jdt.core.dom.QualifiedName.accept0(QualifiedName.java:168)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2759)
at org.eclipse.jdt.core.dom.PackageDeclaration.accept0(PackageDeclaration.java:225)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2759)
at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:210)
at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
at org.eclipse.jdt.internal.ui.search.OccurrencesFinder.performSearch(OccurrencesFinder.java:100)
at org.eclipse.jdt.internal.ui.search.OccurrencesFinder.getOccurrences(OccurrencesFinder.java:105)
at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.updateOccurrenceAnnotations(JavaEditor.java:3355)
at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor$6.selectionChanged(JavaEditor.java:3380)
at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup.calculateASTandInform(SelectionListenerWithASTManager.java:178)
at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup$3.run(SelectionListenerWithASTManager.java:155)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

@lombokissues
Collaborator

👤 r.spilker   🕗 Jan 09, 2015 at 15:51 UTC

Issue #798 has been merged into this issue.

@lombokissues
Collaborator

👤 shawn.tuatara   🕗 Feb 08, 2015 at 02:02 UTC

The comment in ﹟763 about toggling the mark occurrences fixed this issue temporarily for me. Would be nice to have this issue resolved as that is an important feature to see into the code better.

Lombok: 1.16.0
Eclipse: STS 3.6.3

@lombokissues
Collaborator

👤 reinierz   🕗 Apr 14, 2015 at 20:46 UTC

This may have been fixed in the latest release of lombok (v1.16.4); give it a shot?

@lombokissues
Collaborator

👤 igor.berman   🕗 Jul 08, 2015 at 06:12 UTC

I think, 1.16.4 fixed the problem

@lombokissues
Collaborator

End of migration

@msimko81

Having the same problem with 1.16.6.
The error occur when using 'val' type but is not always reproducible even on the same file after several eclipse restarts.
No message inside workbench error log, just the following popup window:

An internal error occurred during: "Requesting Java AST from selection".loader (instance of lombok/launch/ShadowClassLoader): attempted duplicate class definition for name: "lombok/launch/PatchFixesHider$PatchFixes"

@caarlos0
caarlos0 commented Jun 1, 2016

Same here

@tungpham

Same for me as well.

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