Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » NoSuchMethodError when running Maven
NoSuchMethodError when running Maven [message #1801946] Tue, 29 January 2019 17:37 Go to next message
Claudenir Fonseca is currently offline Claudenir FonsecaFriend
Messages: 8
Registered: February 2016
Junior Member
Dear all,

I am facing an error when running Maven for my dsl and I don't what to check anymore. The error is the following:

org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main()] ERROR mf.mwe2.launch.runtime.Mwe2Launcher  - com.google.common.base.Throwables.throwIfUnchecked(Ljava/lang/Throwable;)V
java.lang.NoSuchMethodError: com.google.common.base.Throwables.throwIfUnchecked(Ljava/lang/Throwable;)V
	at org.eclipse.xtext.resource.DerivedStateAwareResource.installDerivedState(DerivedStateAwareResource.java:251)
	at org.eclipse.xtext.xbase.resource.BatchLinkableResource.getContents(BatchLinkableResource.java:148)
	at org.eclipse.xtext.xtext.generator.XtextGeneratorResourceSetInitializer.each(XtextGeneratorResourceSetInitializer.java:169)
	at org.eclipse.xtext.xtext.generator.XtextGeneratorResourceSetInitializer.registerGenModels(XtextGeneratorResourceSetInitializer.java:155)
	at org.eclipse.xtext.xtext.generator.XtextGeneratorResourceSetInitializer.initialize(XtextGeneratorResourceSetInitializer.java:44)
	at org.eclipse.xtext.xtext.generator.XtextGeneratorLanguage.initialize(XtextGeneratorLanguage.java:218)
	at org.eclipse.xtext.xtext.generator.StandardLanguage.initialize(StandardLanguage.java:189)
	at org.eclipse.xtext.xtext.generator.XtextGenerator.initialize(XtextGenerator.java:185)
	at org.eclipse.xtext.xtext.generator.XtextGenerator.checkConfigurationInternal(XtextGenerator.java:139)
	at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent2.checkConfiguration(AbstractWorkflowComponent2.java:21)
	at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.preInvoke(Mwe2Bridge.java:65)
	at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.preInvoke(AbstractWorkflowComponent.java:197)
	at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.preInvoke(AbstractCompositeWorkflowComponent.java:29)
	at org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:18)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:102)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:62)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:78)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:36)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:293)
	at java.lang.Thread.run(Thread.java:748)


Outside Maven, everything is working.
The method which fires the exception is in the class path and the containing dependence is listed in the target file.
The POM file is the automatically generated through the Xtext Wizard.

I have a guess that there can be some problem surrounding the POM file, since, after I have created the project, I created a separated Xcore project for the metamodel and introduced it to the DSL context. But still, the error message does not suggest some problem in there...

I'm attaching the POM files of the relevant parts.
Re: NoSuchMethodError when running Maven [message #1801948 is a reply to message #1801946] Tue, 29 January 2019 18:00 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13071
Registered: July 2009
Senior Member
this is https://github.com/eclipse/xtext/issues/1391
make sure you use guava 21 or an older xtext


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Tue, 29 January 2019 18:00]

Report message to a moderator

Re: NoSuchMethodError when running Maven [message #1801950 is a reply to message #1801948] Tue, 29 January 2019 18:35 Go to previous messageGo to next message
Claudenir Fonseca is currently offline Claudenir FonsecaFriend
Messages: 8
Registered: February 2016
Junior Member
Guava 21 is listed both in the classpath and contents of the Target Definition file.
Also, the whole purpose was to bring this project to the current version of Xtext.

In any case, I'll try xtext 2.15 and follow the updates for this issue.

Thanks Mr. Dietrich
Re: NoSuchMethodError when running Maven [message #1801951 is a reply to message #1801950] Tue, 29 January 2019 18:56 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13071
Registered: July 2009
Senior Member
i mean the dependencies at the place where you execute whatever fails (maven)

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: NoSuchMethodError when running Maven [message #1801990 is a reply to message #1801951] Wed, 30 January 2019 12:53 Go to previous messageGo to next message
Claudenir Fonseca is currently offline Claudenir FonsecaFriend
Messages: 8
Registered: February 2016
Junior Member
I tried adding adding Guava 21 to the list of dependencies in Maven, within exec-maven-plugin (which seems to execute them mwe2Launcher) and I saw no difference

Actually, the following warning suggests that I'm already working with the version 21.

WARNING: Skipping conflicting project com.google.guava at 'archive:file:/Users/claudenirmf/.m2/repository/com/google/guava/guava/14.0.1/guava-14.0.1.jar!/' and using 'archive:file:/Users/claudenirmf/.m2/repository/p2/osgi/bundle/com.google.guava/21.0.0.v20170206-1425/com.google.guava-21.0.0.v20170206-1425.jar!/' instead.


When I tried moving to Xtext 2.15 (by changing the version of xtext within maven and changing the repositories on the target file) I also got a NoSuchMethodError, but for a different method

org.eclipse.emf.codegen.ecore.genmodel.GenModel.clearCache...

This second error was even more strange because, as far as I was able to check, there was never a version of GenModel with such method.

Anyway, for now I'm working without Maven support. I'm probably going to leave it like this for a while and follow your discussion on the issue at GitHub.
Re: NoSuchMethodError when running Maven [message #1801991 is a reply to message #1801990] Wed, 30 January 2019 12:58 Go to previous messageGo to next message
Claudenir Fonseca is currently offline Claudenir FonsecaFriend
Messages: 8
Registered: February 2016
Junior Member
Btw, sorry for the confusion. There is a "clearCache()" method on GenBase, an interface extended by GenModel. Still, the problem does not make sense.

ERROR Mwe2Launcher       - org.eclipse.emf.codegen.ecore.genmodel.GenModel.clearCache()V
java.lang.NoSuchMethodError: org.eclipse.emf.codegen.ecore.genmodel.GenModel.clearCache()V
	at org.eclipse.emf.ecore.xcore.util.XcoreJvmInferrer.inferDeepStructure(XcoreJvmInferrer.java:234)
	at org.eclipse.emf.ecore.xcore.resource.XcoreModelAssociator$2.process(XcoreModelAssociator.java:176)
	at org.eclipse.emf.ecore.xcore.resource.XcoreModelAssociator$2.process(XcoreModelAssociator.java:1)
	at org.eclipse.xtext.util.concurrent.IUnitOfWork$Void.exec(IUnitOfWork.java:37)
	at org.eclipse.xtext.util.OnChangeEvictingCache.execWithoutCacheClear(OnChangeEvictingCache.java:128)
	at org.eclipse.emf.ecore.xcore.resource.XcoreModelAssociator.installDerivedState(XcoreModelAssociator.java:171)
	at org.eclipse.xtext.resource.DerivedStateAwareResource.installDerivedState(DerivedStateAwareResource.java:243)
	at org.eclipse.xtext.xbase.resource.BatchLinkableResource.getContents(BatchLinkableResource.java:148)
	at org.eclipse.xtext.xtext.generator.XtextGeneratorResourceSetInitializer.each(XtextGeneratorResourceSetInitializer.java:169)
	at org.eclipse.xtext.xtext.generator.XtextGeneratorResourceSetInitializer.registerGenModels(XtextGeneratorResourceSetInitializer.java:155)
	at org.eclipse.xtext.xtext.generator.XtextGeneratorResourceSetInitializer.initialize(XtextGeneratorResourceSetInitializer.java:44)
	at org.eclipse.xtext.xtext.generator.XtextGeneratorLanguage.initialize(XtextGeneratorLanguage.java:218)
	at org.eclipse.xtext.xtext.generator.StandardLanguage.initialize(StandardLanguage.java:189)
	at org.eclipse.xtext.xtext.generator.XtextGenerator.initialize(XtextGenerator.java:185)
	at org.eclipse.xtext.xtext.generator.XtextGenerator.checkConfigurationInternal(XtextGenerator.java:139)
	at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent2.checkConfiguration(AbstractWorkflowComponent2.java:21)
	at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.preInvoke(Mwe2Bridge.java:65)
	at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.preInvoke(AbstractWorkflowComponent.java:197)
	at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.preInvoke(AbstractCompositeWorkflowComponent.java:29)
	at org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:18)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:102)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:62)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:78)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:36)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:293)
	at java.lang.Thread.run(Thread.java:748)

[Updated on: Wed, 30 January 2019 13:08]

Report message to a moderator

Re: NoSuchMethodError when running Maven [message #1802009 is a reply to message #1801991] Wed, 30 January 2019 15:55 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 30372
Registered: July 2009
Senior Member
You must have a newer version of org.eclipse.emf.ecore.xcore with an older version of org.eclipse.emf.codegen.ecore.
Previous Topic:Xbase DSL Editor is extremely slow
Next Topic:Parsing error:coudn't reslolve reference
Goto Forum:
  


Current Time: Sun Aug 25 11:03:12 GMT 2019

Powered by FUDForum. Page generated in 0.02196 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top