Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

NoSuchMethodError with xbase.lib 2.11 target and xbase.lib 2.10 host #122

Closed
meysholdt opened this issue Jan 11, 2017 · 14 comments
Closed
Labels
Milestone

Comments

@meysholdt
Copy link
Contributor

After upgrading the target platform of an Xtext project to 2.11.0-beta2, I got the following exception in the Error Log View. In the Xtend Editor, I got an error marker saying "org.eclipse.xtend2.lib.StringConcatenation.append(Ljava/lang/String;)V See error log for details"

In my host Eclipse, xbase.lib 2.10.0 is installed.

java.lang.NoSuchMethodError: org.eclipse.xtend2.lib.StringConcatenation.append(Ljava/lang/String;)V
	at org.eclipse.xtend.lib.annotations.DelegateProcessor$Util._delegateAccess(DelegateProcessor.java:502)
	at org.eclipse.xtend.lib.annotations.DelegateProcessor$Util.delegateAccess(DelegateProcessor.java:622)
	at org.eclipse.xtend.lib.annotations.DelegateProcessor$Util$1.appendTo(DelegateProcessor.java:421)
	at org.eclipse.xtend2.lib.StringConcatenation.append(StringConcatenation.java:129)
	at org.eclipse.xtend2.lib.StringConcatenation.append(StringConcatenation.java:108)
	at org.eclipse.xtext.xbase.compiler.JvmModelGenerator.appendCompilationTemplate(JvmModelGenerator.java:585)
	at org.eclipse.xtext.xbase.compiler.JvmModelGenerator.generateExecutableBody(JvmModelGenerator.java:1199)
	at org.eclipse.xtext.xbase.compiler.JvmModelGenerator._generateMember(JvmModelGenerator.java:933)
	at org.eclipse.xtext.xbase.compiler.JvmModelGenerator.generateMember(JvmModelGenerator.java:2015)
	at org.eclipse.xtext.xbase.compiler.JvmModelGenerator$2.apply(JvmModelGenerator.java:320)
	at org.eclipse.xtext.xbase.compiler.JvmModelGenerator$2.apply(JvmModelGenerator.java:1)
	at org.eclipse.xtext.xbase.lib.ObjectExtensions.operator_doubleArrow(ObjectExtensions.java:139)
	at org.eclipse.xtext.xbase.compiler.LoopExtensions$1.apply(LoopExtensions.java:40)
	at org.eclipse.xtext.xbase.lib.IteratorExtensions.forEach(IteratorExtensions.java:363)
	at org.eclipse.xtext.xbase.lib.IterableExtensions.forEach(IterableExtensions.java:333)
	at org.eclipse.xtext.xbase.compiler.LoopExtensions.forEach(LoopExtensions.java:43)
	at org.eclipse.xtext.xbase.compiler.JvmModelGenerator.generateMembersInBody(JvmModelGenerator.java:324)
	at org.eclipse.xtend.core.compiler.XtendGenerator.generateMembersInBody(XtendGenerator.java:697)
	at org.eclipse.xtext.xbase.compiler.JvmModelGenerator._generateBody(JvmModelGenerator.java:287)
	at org.eclipse.xtext.xbase.compiler.JvmModelGenerator.generateBody(JvmModelGenerator.java:1987)
	at org.eclipse.xtext.xbase.compiler.JvmModelGenerator._generateMember(JvmModelGenerator.java:870)
	at org.eclipse.xtext.xbase.compiler.JvmModelGenerator.generateMember(JvmModelGenerator.java:2019)
	at org.eclipse.xtext.xbase.compiler.JvmModelGenerator$2.apply(JvmModelGenerator.java:320)
	at org.eclipse.xtext.xbase.compiler.JvmModelGenerator$2.apply(JvmModelGenerator.java:1)
	at org.eclipse.xtext.xbase.lib.ObjectExtensions.operator_doubleArrow(ObjectExtensions.java:139)
	at org.eclipse.xtext.xbase.compiler.LoopExtensions.forEach(LoopExtensions.java:34)
	at org.eclipse.xtext.xbase.compiler.JvmModelGenerator.generateMembersInBody(JvmModelGenerator.java:324)
	at org.eclipse.xtend.core.compiler.XtendGenerator.generateMembersInBody(XtendGenerator.java:697)
	at org.eclipse.xtext.xbase.compiler.JvmModelGenerator._generateBody(JvmModelGenerator.java:287)
	at org.eclipse.xtext.xbase.compiler.JvmModelGenerator.generateBody(JvmModelGenerator.java:1987)
	at org.eclipse.xtext.xbase.compiler.JvmModelGenerator.generateType(JvmModelGenerator.java:231)
	at org.eclipse.xtext.xbase.compiler.JvmModelGenerator._internalDoGenerate(JvmModelGenerator.java:217)
	at org.eclipse.xtext.xbase.compiler.JvmModelGenerator.internalDoGenerate(JvmModelGenerator.java:1970)
	at org.eclipse.xtext.xbase.compiler.JvmModelGenerator.doGenerate(JvmModelGenerator.java:198)
	at org.eclipse.xtend.core.compiler.XtendGenerator.doGenerate(XtendGenerator.java:103)
	at org.eclipse.xtend.core.compiler.XtendGenerator.doGenerate(XtendGenerator.java:119)
	at org.eclipse.xtext.generator.GeneratorDelegate.doGenerate(GeneratorDelegate.java:43)
	at org.eclipse.xtext.builder.ParallelBuilderParticipant.handleChangedContents(ParallelBuilderParticipant.java:183)
	at org.eclipse.xtext.builder.ParallelBuilderParticipant.handleChangedContents(ParallelBuilderParticipant.java:172)
	at org.eclipse.xtext.builder.ParallelBuilderParticipant.doGenerate(ParallelBuilderParticipant.java:343)
	at org.eclipse.xtext.builder.ParallelBuilderParticipant$1.run(ParallelBuilderParticipant.java:308)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
@meysholdt meysholdt added this to the release_v2.11 milestone Jan 11, 2017
@cdietrich
Copy link
Member

Sounds like eclipse/xtext-lib@b2207e7

@meysholdt
Copy link
Contributor Author

append(String) was introduced here: eclipse/xtext-lib@da32a7d

@svenefftinge
Copy link
Member

I don't think we can do anything about it

@svenefftinge
Copy link
Member

(besides catching that exception and turning it into a "please update your eclipse plug-in"-message)

@spoenemann
Copy link
Member

At least we have to make sure that xbase.lib >= 2.11.0 is put into the classpath. Currently the Xtend editor creates a message

Couldn't find the mandatory library 'org.eclipse.xtext.xbase.lib' 2.8.0 or higher on the project's classpath.

We should fix this. Is the version 2.8.0 declared anywhere as lower bound for the Xtext editor?

@cdietrich
Copy link
Member

No I think it searches for a class that was introduced with 2.8

@spoenemann
Copy link
Member

So we could change this to search for StringConcatenation.append(String) instead?

@cdietrich
Copy link
Member

I think so

@cdietrich
Copy link
Member

see org.eclipse.xtend.core.validation.XtendValidator.checkClassPath(XtendFile)

@spoenemann
Copy link
Member

It's not necessary to have xbase.lib 2.11 in the classpath, even if the Xtend compiler version 2.11 is used. The generated code is still compatible with older library versions. The problem reported by @meysholdt is the other way around: having xbase.lib 2.11 in the classpath but an older Xtend compiler in the IDE leads to the exception. This is probably because the active annotations code is executed with the library from the compiler classpath, and not the project's library version. We can't fix this for existing Xtend 2.10 installations, but maybe we can improve the situation for the future.

Would it be possible to use the project's library when code involving active annotations is compiled?

@cdietrich
Copy link
Member

we had this issue again after eclipse/xtext-lib#55

@svenefftinge do you have any hints on @spoenemann s question

@svenefftinge
Copy link
Member

No, it is not possible, because we need to use the tool's classpath for everything else to not run into incompatible class versions. Also, a class is first resolved by the parent classloader (which includes xbase).

@cdietrich
Copy link
Member

so we should close this as wontfix?

@cdietrich
Copy link
Member

https://bugs.eclipse.org/bugs/show_bug.cgi?id=444914 adresss this issue as well with focus on better "catching" the problem so i will close this

@cdietrich cdietrich added this to the Release_2.13 milestone Sep 21, 2017
rmulvey added a commit to rmulvey/bridgepoint that referenced this issue Jun 21, 2018
There is a problem with the version having xbase.lib 2.11 in the
classpath but an older Xtend compiler in the IDE leads to the exception.
It is described in a few places:

https://www.eclipse.org/forums/index.php/t/1084743/
Also see this: eclipse/xtext-xtend#122
rmulvey added a commit to rmulvey/bridgepoint that referenced this issue Jun 21, 2018
There is a problem with the version having xbase.lib 2.11 in the
classpath but an older Xtend compiler in the IDE leads to the exception.
It is described in a few places:

https://www.eclipse.org/forums/index.php/t/1084743/
Also see this: eclipse/xtext-xtend#122
rmulvey added a commit to rmulvey/bridgepoint that referenced this issue Jul 2, 2018
There is a problem with the version having xbase.lib 2.11 in the
classpath but an older Xtend compiler in the IDE leads to the exception.
It is described in a few places:

https://www.eclipse.org/forums/index.php/t/1084743/
Also see this: eclipse/xtext-xtend#122
rmulvey added a commit to rmulvey/bridgepoint that referenced this issue Jul 2, 2018
There is a problem with the version having xbase.lib 2.11 in the
classpath but an older Xtend compiler in the IDE leads to the exception.
It is described in a few places:

https://www.eclipse.org/forums/index.php/t/1084743/
Also see this: eclipse/xtext-xtend#122
rmulvey added a commit to rmulvey/bridgepoint that referenced this issue Jul 3, 2018
There is a problem with the version having xbase.lib 2.11 in the
classpath but an older Xtend compiler in the IDE leads to the exception.
It is described in a few places:

https://www.eclipse.org/forums/index.php/t/1084743/
Also see this: eclipse/xtext-xtend#122
rmulvey added a commit to rmulvey/bridgepoint that referenced this issue Jul 3, 2018
There is a problem with the version having xbase.lib 2.11 in the
classpath but an older Xtend compiler in the IDE leads to the exception.
It is described in a few places:

https://www.eclipse.org/forums/index.php/t/1084743/
Also see this: eclipse/xtext-xtend#122
rmulvey added a commit to rmulvey/bridgepoint that referenced this issue Jul 26, 2018
There is a problem with the version having xbase.lib 2.11 in the
classpath but an older Xtend compiler in the IDE leads to the exception.
It is described in a few places:

https://www.eclipse.org/forums/index.php/t/1084743/
Also see this: eclipse/xtext-xtend#122
rmulvey added a commit to rmulvey/bridgepoint that referenced this issue Jul 26, 2018
There is a problem with the version having xbase.lib 2.11 in the
classpath but an older Xtend compiler in the IDE leads to the exception.
It is described in a few places:

https://www.eclipse.org/forums/index.php/t/1084743/
Also see this: eclipse/xtext-xtend#122
rmulvey added a commit to rmulvey/bridgepoint that referenced this issue Aug 3, 2018
There is a problem with the version having xbase.lib 2.11 in the
classpath but an older Xtend compiler in the IDE leads to the exception.
It is described in a few places:

https://www.eclipse.org/forums/index.php/t/1084743/
Also see this: eclipse/xtext-xtend#122
rmulvey added a commit to rmulvey/bridgepoint that referenced this issue Aug 3, 2018
There is a problem with the version having xbase.lib 2.11 in the
classpath but an older Xtend compiler in the IDE leads to the exception.
It is described in a few places:

https://www.eclipse.org/forums/index.php/t/1084743/
Also see this: eclipse/xtext-xtend#122
leviathan747 pushed a commit to leviathan747/bridgepoint that referenced this issue Aug 3, 2018
There is a problem with the version having xbase.lib 2.11 in the
classpath but an older Xtend compiler in the IDE leads to the exception.
It is described in a few places:

https://www.eclipse.org/forums/index.php/t/1084743/
Also see this: eclipse/xtext-xtend#122
leviathan747 pushed a commit to leviathan747/bridgepoint that referenced this issue Aug 3, 2018
There is a problem with the version having xbase.lib 2.11 in the
classpath but an older Xtend compiler in the IDE leads to the exception.
It is described in a few places:

https://www.eclipse.org/forums/index.php/t/1084743/
Also see this: eclipse/xtext-xtend#122
rmulvey added a commit to rmulvey/bridgepoint that referenced this issue Aug 3, 2018
There is a problem with the version having xbase.lib 2.11 in the
classpath but an older Xtend compiler in the IDE leads to the exception.
It is described in a few places:

https://www.eclipse.org/forums/index.php/t/1084743/
Also see this: eclipse/xtext-xtend#122
rmulvey added a commit to rmulvey/bridgepoint that referenced this issue Aug 3, 2018
There is a problem with the version having xbase.lib 2.11 in the
classpath but an older Xtend compiler in the IDE leads to the exception.
It is described in a few places:

https://www.eclipse.org/forums/index.php/t/1084743/
Also see this: eclipse/xtext-xtend#122
rmulvey added a commit to rmulvey/bridgepoint that referenced this issue Aug 21, 2018
There is a problem with the version having xbase.lib 2.11 in the
classpath but an older Xtend compiler in the IDE leads to the exception.
It is described in a few places:

https://www.eclipse.org/forums/index.php/t/1084743/
Also see this: eclipse/xtext-xtend#122
rmulvey added a commit to rmulvey/bridgepoint that referenced this issue Aug 21, 2018
There is a problem with the version having xbase.lib 2.11 in the
classpath but an older Xtend compiler in the IDE leads to the exception.
It is described in a few places:

https://www.eclipse.org/forums/index.php/t/1084743/
Also see this: eclipse/xtext-xtend#122
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants