Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » The path is unmapped
The path is unmapped [message #1834634] Fri, 13 November 2020 22:15 Go to next message
John Doe is currently offline John DoeFriend
Messages: 138
Registered: October 2020
Senior Member
Hi all,

I have created a UML Profile in Papyrus, generated and Ecore model and then generated an XText grammar from that Ecore model. The thing is that now I get some errors.

// automatically generated by Xtext
grammar org.xtext.example.mydsl1.MyDsl with org.eclipse.xtext.common.Terminals

import "http://www.eclipse.org/uml2/5.0.0/UML" 
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
import "http://www.eclipse.org/uml2/5.0.0/Types" as types
import "http:///TrafficLightStateMachine.ecore" as TrafficLightStateMachine

TrafficLightStateMachine0 returns TrafficLightStateMachine::TrafficLightStateMachine:
	'TrafficLightStateMachine'
	'{'
		'base_StateMachine' base_StateMachine=[StateMachine|EString]
		'Event' '(' Event+=[TrafficLightStateMachine::Event|EString] ( "," Event+=[TrafficLightStateMachine::Event|EString])* ')' 
		'Lights' '(' Lights+=[TrafficLightStateMachine::Lights|EString] ( "," Lights+=[TrafficLightStateMachine::Lights|EString])* ')' 
		'End' End=[TrafficLightStateMachine::End|EString]
	'}';



This is part of the code I get, and on base_StateMachine... I get an error saying
"Cannot find compatible feature base_StateMachine in sealed EClass
TrafficLightStateMachine from imported package http:///TrafficLightStateMachine.ecore:
The existing reference 'base_StateMachine' has an incompatible
type 'StateMachine'. The expected type is 'StateMachine'."

Furthermore, when i try to debug it, the result I get is as follows:
0    [main] INFO  text.xtext.generator.XtextGenerator  - Initializing Xtext generator
5    [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Adding generated EPackage 'org.eclipse.xtext.common.types.TypesPackage'
131  [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Registering project org.xtext.example.mydsl1 at 'file:/Users/mlj01/eclipse-workspace/org.xtext.example.mydsl1/'
132  [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Registering project org.xtext.example.mydsl1.tests at 'file:/Users/mlj01/eclipse-workspace/org.xtext.example.mydsl1.tests/'
132  [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Registering project org.xtext.example.mydsl1.ide at 'file:/Users/mlj01/eclipse-workspace/org.xtext.example.mydsl1.ide/'
132  [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Registering project org.xtext.example.mydsl1.ui at 'file:/Users/mlj01/eclipse-workspace/org.xtext.example.mydsl1.ui/'
132  [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Registering project org.xtext.example.mydsl1.ui.tests at 'file:/Users/mlj01/eclipse-workspace/org.xtext.example.mydsl1.ui.tests/'
136  [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Using resourceSet registry. The registered Packages will not be registered in the global EPackage.Registry.INSTANCE!
277  [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher  - Problems running workflow org.xtext.example.mydsl1.GenerateMyDsl: java.io.IOException: The path '/TrafficLightStateMachine/trafficall4.genmodel' is unmapped
java.lang.RuntimeException: Problems running workflow org.xtext.example.mydsl1.GenerateMyDsl: java.io.IOException: The path '/TrafficLightStateMachine/trafficall4.genmodel' is unmapped
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:105)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:63)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:53)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:79)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:37)
Caused by: org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: java.io.IOException: The path '/TrafficLightStateMachine/trafficall4.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:266)
	at org.eclipse.xtext.xtext.generator.XtextGeneratorResourceSetInitializer.loadResource(XtextGeneratorResourceSetInitializer.java:52)
	at org.eclipse.xtext.xtext.generator.XtextGeneratorResourceSetInitializer.lambda$initialize$0(XtextGeneratorResourceSetInitializer.java:42)
	at java.util.ArrayList.forEach(ArrayList.java:1257)
	at org.eclipse.xtext.xtext.generator.XtextGeneratorResourceSetInitializer.initialize(XtextGeneratorResourceSetInitializer.java:44)
	at org.eclipse.xtext.xtext.generator.XtextGeneratorLanguage.initialize(XtextGeneratorLanguage.java:219)
	at org.eclipse.xtext.xtext.generator.StandardLanguage.initialize(StandardLanguage.java:192)
	at org.eclipse.xtext.xtext.generator.XtextGenerator.initialize(XtextGenerator.java:186)
	at org.eclipse.xtext.xtext.generator.XtextGenerator.checkConfigurationInternal(XtextGenerator.java:140)
	at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent2.checkConfiguration(AbstractWorkflowComponent2.java:23)
	at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.preInvoke(Mwe2Bridge.java:69)
	at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.preInvoke(AbstractWorkflowComponent.java:208)
	at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.preInvoke(AbstractCompositeWorkflowComponent.java:31)
	at org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:20)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:103)
	... 4 more
Caused by: java.io.IOException: The path '/TrafficLightStateMachine/trafficall4.genmodel' is unmapped
	at org.eclipse.emf.ecore.resource.impl.PlatformResourceURIHandlerImpl.createInputStream(PlatformResourceURIHandlerImpl.java:578)
	at org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl.createInputStream(ExtensibleURIConverterImpl.java:358)
	at org.eclipse.xtext.resource.XtextResourceSet$1.createInputStream(XtextResourceSet.java:299)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1314)
	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


Do you know any way around this issue?

Thank you!
Re: The path is unmapped [message #1834635 is a reply to message #1834634] Fri, 13 November 2020 22:24 Go to previous messageGo to next message
John Doe is currently offline John DoeFriend
Messages: 138
Registered: October 2020
Senior Member
And this is my .mwe2 file

module org.xtext.example.mydsl1.GenerateMyDsl

import org.eclipse.xtext.xtext.generator.*
import org.eclipse.xtext.xtext.generator.model.project.*

var rootPath = ".."

Workflow {
	
	component = XtextGenerator {
		configuration = {
			project = StandardProjectConfig {
				baseName = "org.xtext.example.mydsl1"
				rootPath = rootPath
				runtimeTest = {
					enabled = true
				}
				eclipsePlugin = {
					enabled = true
				}
				eclipsePluginTest = {
					enabled = true
				}
				createEclipseMetaData = true
			}
			code = {
				encoding = "UTF-8"
				lineDelimiter = "\n"
				fileHeader = "/*\n * generated by Xtext \${version}\n */"
				preferXtendStubs = false
			}
		}
		language = StandardLanguage {
			name = "org.xtext.example.mydsl1.MyDsl"
			fileExtensions = "mydsl1"
			referencedResource = "platform:/resource/TrafficLightStateMachine/trafficall4.genmodel"
			fragment = ecore2xtext.Ecore2XtextValueConverterServiceFragment2 auto-inject {}

			formatter = {
				generateStub = true
				generateXtendStub = true
			}

			serializer = {
				generateStub = false
			}
			validator = {
				// composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
				// Generates checks for @Deprecated grammar annotations, an IssueProvider and a corresponding PropertyPage
				generateDeprecationValidation = true
			}
			generator = {
				generateXtendStub = true
			}
			junitSupport = {
				junitVersion = "5"
			}
		}
	}
}

[Updated on: Fri, 13 November 2020 22:26]

Report message to a moderator

Re: The path is unmapped [message #1834636 is a reply to message #1834635] Fri, 13 November 2020 23:33 Go to previous message
John Doe is currently offline John DoeFriend
Messages: 138
Registered: October 2020
Senior Member
Furthermore, I have two problems encountered at my .genmodel. They are as follows:

A containment reference of a type with a container feature platform:/resource/TrafficLightStateMachine/uml.ecore#//ElementImport/importingNamespace that requires instances to be contained cannot be populated

and


A containment reference of a type with a container feature platform:/resource/TrafficLightStateMachine/uml.ecore#//PackageImport/importingNamespace that requires instances to be contained cannot be populated
Previous Topic:Validator with property file involved
Next Topic:Couldn't resolve reference to EPackage
Goto Forum:
  


Current Time: Sat Jun 19 00:09:01 GMT 2021

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

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

Back to the top