Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » java.lang.RuntimeException: path to .genmodel is unmapped
java.lang.RuntimeException: path to .genmodel is unmapped [message #1777645] Fri, 01 December 2017 09:07 Go to next message
Patrik Nandorf is currently offline Patrik NandorfFriend
Messages: 161
Registered: January 2013
Location: Sweden
Senior Member
Hi,

When creating an xtext project from existing an ecore model I get an error when generating the xtext artifacts. The genmodel isn't mapped.

The project is created usign xtext 2.13 and I select to create a language server:
- no Eclipse plugin, only Generic IDE Support
- Preferred build system: Gradle
- Build Language Server: Fat Jar
- Source Layout: Maven/Gradle

(I'm trying to follow this http://typefox.io/building-a-vs-code-extension-with-xtext-and-the-language-server-protocol which works if I start from a grammar)

The output I get in the console is as follows:
0    [main] INFO  text.xtext.generator.XtextGenerator  - Initializing Xtext generator
4    [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Adding generated EPackage 'org.eclipse.xtext.common.types.TypesPackage'
97   [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Registering project org.xtext.example.mydsl at 'file:/home/solnarf/oomph/installations/papyrus-oxygen-nightly/workspaces/ws-xtext-lsp2/org.xtext.example.mydsl.parent/org.xtext.example.mydsl/'
97   [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Registering project org.xtext.example.mydsl.ide at 'file:/home/solnarf/oomph/installations/papyrus-oxygen-nightly/workspaces/ws-xtext-lsp2/org.xtext.example.mydsl.parent/org.xtext.example.mydsl.ide/'
105  [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Using resourceSet registry. The registered Packages will not be registered in the global EPackage.Registry.INSTANCE!
320  [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher  - Problems running workflow org.xtext.example.mydsl.GenerateMyDsl: java.io.IOException: The path '/my.dsl.model/model/MyDSL.genmodel' is unmapped
java.lang.RuntimeException: Problems running workflow org.xtext.example.mydsl.GenerateMyDsl: java.io.IOException: The path '/my.dsl.model/model/MyDSL.genmodel' is unmapped
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:104)
	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)
Caused by: org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: java.io.IOException: The path '/my.dsl.model/model/MyDSL.genmodel' is unmapped
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:319)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:278)
	at org.eclipse.xtext.resource.XtextResourceSet.getResource(XtextResourceSet.java:265)
	at org.eclipse.xtext.xtext.generator.XtextGeneratorResourceSetInitializer.loadResource(XtextGeneratorResourceSetInitializer.java:51)
	at org.eclipse.xtext.xtext.generator.XtextGeneratorResourceSetInitializer.lambda$initialize$0(XtextGeneratorResourceSetInitializer.java:41)
	at java.util.ArrayList.forEach(ArrayList.java:1249)
	at org.eclipse.xtext.xtext.generator.XtextGeneratorResourceSetInitializer.initialize(XtextGeneratorResourceSetInitializer.java:43)
	at org.eclipse.xtext.xtext.generator.XtextGeneratorLanguage.initialize(XtextGeneratorLanguage.java:219)
	at org.eclipse.xtext.xtext.generator.StandardLanguage.initialize(StandardLanguage.java:175)
	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)
	... 4 more
Caused by: java.io.IOException: The path '/my.dsl.model/model/MyDSL.genmodel' is unmapped
	at org.eclipse.emf.ecore.resource.impl.PlatformResourceURIHandlerImpl.createInputStream(PlatformResourceURIHandlerImpl.java:535)
	at org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl.createInputStream(ExtensibleURIConverterImpl.java:360)
	at org.eclipse.xtext.resource.XtextResourceSet$1.createInputStream(XtextResourceSet.java:298)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1269)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
	... 19 more


Re: java.lang.RuntimeException: path to .genmodel is unmapped [message #1777646 is a reply to message #1777645] Fri, 01 December 2017 09:10 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 11626
Registered: July 2009
Senior Member
did you add a gradle dependency to the defining plugin?
does the jar file include the genmodel files and if yes in which location?


Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @chrdietrich
Blog : christiandietrich.wordpress.com
Re: java.lang.RuntimeException: path to .genmodel is unmapped [message #1777655 is a reply to message #1777646] Fri, 01 December 2017 09:39 Go to previous messageGo to next message
Patrik Nandorf is currently offline Patrik NandorfFriend
Messages: 161
Registered: January 2013
Location: Sweden
Senior Member
Christian Dietrich wrote on Fri, 01 December 2017 10:10
did you add a gradle dependency to the defining plugin?

I just ran the wizard and then tried to create the xtext artifacts. How do I do that? I'm quite new to Gradle, sorry.

Quote:
does the jar file include the genmodel files and if yes in which location?

Not sure which jar file you are referring to.
Re: java.lang.RuntimeException: path to .genmodel is unmapped [message #1777659 is a reply to message #1777655] Fri, 01 December 2017 09:49 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 11626
Registered: July 2009
Senior Member
the jar file of the project with the genmodel
== my.dsl.model


Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @chrdietrich
Blog : christiandietrich.wordpress.com

[Updated on: Fri, 01 December 2017 09:50]

Report message to a moderator

Re: java.lang.RuntimeException: path to .genmodel is unmapped [message #1777668 is a reply to message #1777659] Fri, 01 December 2017 11:19 Go to previous messageGo to next message
Patrik Nandorf is currently offline Patrik NandorfFriend
Messages: 161
Registered: January 2013
Location: Sweden
Senior Member
It is in 'model/MyDSL.genmodel' in my.dsl.model.jar
Re: java.lang.RuntimeException: path to .genmodel is unmapped [message #1777669 is a reply to message #1777668] Fri, 01 December 2017 11:20 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 11626
Registered: July 2009
Senior Member
and is that stuff added to the depenencies in build.gradle of mydsl?

Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @chrdietrich
Blog : christiandietrich.wordpress.com
Re: java.lang.RuntimeException: path to .genmodel is unmapped [message #1777673 is a reply to message #1777669] Fri, 01 December 2017 11:39 Go to previous messageGo to next message
Patrik Nandorf is currently offline Patrik NandorfFriend
Messages: 161
Registered: January 2013
Location: Sweden
Senior Member
If you by mydsl mean the project containing the genmodel, then no. I haven't changed any gradle files as I'm a gradle illiterate. I exported the jar manually.

I assume that the 'genmodel project' needs to be build with gradle and then that it is referenced somehow from the 'xtext projects' gradle files?

My naive assumption was that the xtext wizard would set this up.
Re: java.lang.RuntimeException: path to .genmodel is unmapped [message #1777675 is a reply to message #1777673] Fri, 01 December 2017 11:49 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 11626
Registered: July 2009
Senior Member
no it does not. it does not know where these other project come from, if they are in the same ractor etc
i recommend you to either move the metamodel project to the mydsl.parent, adapt settings.gradle, and add a project(":xxxxx") dependency to build.gradle
or to provide it by a second maven/gradle build and then reference it as jar, and use/add a repo to the configuration.
=> you need to have some basic gradle knowledge.



Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @chrdietrich
Blog : christiandietrich.wordpress.com
Re: java.lang.RuntimeException: path to .genmodel is unmapped [message #1777677 is a reply to message #1777675] Fri, 01 December 2017 11:58 Go to previous message
Patrik Nandorf is currently offline Patrik NandorfFriend
Messages: 161
Registered: January 2013
Location: Sweden
Senior Member
Christian Dietrich wrote on Fri, 01 December 2017 12:49
=> you need to have some basic gradle knowledge.


I realize that :-) Thanks for the help.
Previous Topic:How to delete generated files
Next Topic:Create intermediate EMF model for additional Validation and for Code generation
Goto Forum:
  


Current Time: Tue Jan 23 02:21:58 GMT 2018

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

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