Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » EcoreGeneratorFragment: path is unmapped
EcoreGeneratorFragment: path is unmapped [message #758189] Tue, 22 November 2011 09:47 Go to next message
Matthijs  is currently offline Matthijs Friend
Messages: 11
Registered: August 2011
Junior Member
Hi

In the xtext project where the grammar is defined I have a mwe2 workflow to generate the language infrastructure. The workflow fails because of an unmapped path exception (path '/org.batok.dsl.entity/src-gen/org/batok/dsl/entity/entity/EntityPackage.java' is unmapped). The odd thing is that the same mwe2 workflow works fine on Windows - I can run it in Eclipse and from a maven build without any problems. However it fails while running it on Linux with a Hudson/Jenkins build.

Any suggestions for this issue?

In the workflow the usual platform StandaloneSetup:

bean = StandaloneSetup {
scanClassPath = true
platformUri = "${runtimeProject}/.."
registerGeneratedEPackage = "org.eclipse.xtext.xbase.XbasePackage"
registerGenModelFile = "platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel"
registerGenModelFile = "platform:/resource/org.eclipse.xtext.common.types/model/JavaVMTypes.genmodel"
}

Stack trace:
[java] 11362 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://org.batok/Entity' from 'file:/var/lib/jenkins/jobs/BatokTrunk/workspace/trunk/batok-dsl/org.batok.dsl.entity/src-gen/org/batok/dsl/entity/Entity.genmodel'
[java] org.eclipse.emf.common.util.WrappedException: java.io.IOException: The path '/org.batok.dsl.entity/src-gen/org/batok/dsl/entity/entity/EntityPackage.java' is unmapped
[java] at org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAdapter.generateJava(AbstractGeneratorAdapter.java:1112)
[java] at org.eclipse.emf.codegen.ecore.genmodel.generator.GenPackageGeneratorAdapter.generatePackageInterface(GenPackageGeneratorAdapter.java:467)

Regards
Matthijs Galesloot
Re: EcoreGeneratorFragment: path is unmapped [message #758277 is a reply to message #758189] Tue, 22 November 2011 14:35 Go to previous messageGo to next message
Meinte Boersma is currently offline Meinte BoersmaFriend
Messages: 434
Registered: July 2009
Location: Leiden, Netherlands
Senior Member
Hmmm, probably a tricky one, this one... (It's also more of an EMF thing than it is an Xtext thing.)

EMF's path mapping is done by a URIConverter implementation which holds a map which is (also) populated by StandaloneSetup, e.g. by #scanFolder(), triggered by #setPlatformUri(String). You could try and debug the URIConverter impl. used and see what actually causes the IOException. I expect the hierarchy from the workspace's root is the same under Linux as it is in Windows.


Re: EcoreGeneratorFragment: path is unmapped [message #758424 is a reply to message #758189] Wed, 23 November 2011 09:00 Go to previous messageGo to next message
Volker Wegert is currently offline Volker WegertFriend
Messages: 182
Registered: July 2009
Senior Member
Matthijs,

I had a similar problem. It turned out that I had renamed the Xtext
project and some packages, and somehow the old name was left in the
project file. I don't know how this could happen, but manually
correcting the .project file fixed the issue for me.

Volker

Am 22.11.11 10:47, schrieb Matthijs:
> Hi
> In the xtext project where the grammar is defined I have a mwe2 workflow
> to generate the language infrastructure. The workflow fails because of
> an unmapped path exception (path
> '/org.batok.dsl.entity/src-gen/org/batok/dsl/entity/entity/EntityPackage.java'
> is unmapped). The odd thing is that the same mwe2 workflow works fine on
> Windows - I can run it in Eclipse and from a maven build without any
> problems. However it fails while running it on Linux with a
> Hudson/Jenkins build.
> Any suggestions for this issue?
> In the workflow the usual platform StandaloneSetup:
> bean = StandaloneSetup {
> scanClassPath = true
> platformUri = "${runtimeProject}/.."
> registerGeneratedEPackage = "org.eclipse.xtext.xbase.XbasePackage"
> registerGenModelFile =
> "platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel"
> registerGenModelFile =
> "platform:/resource/org.eclipse.xtext.common.types/model/JavaVMTypes.genmodel"
>
> }
>
> Stack trace: [java] 11362 [main] INFO
> clipse.emf.mwe.utils.GenModelHelper - Registered GenModel
> 'http://org.batok/Entity' from
> 'file:/var/lib/jenkins/jobs/BatokTrunk/workspace/trunk/batok-dsl/org.batok.dsl.entity/src-gen/org/batok/dsl/entity/Entity.genmodel'
>
> [java] org.eclipse.emf.common.util.WrappedException:
> java.io.IOException: The path
> '/org.batok.dsl.entity/src-gen/org/batok/dsl/entity/entity/EntityPackage.java'
> is unmapped
> [java] at
> org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAdapter.generateJava(AbstractGeneratorAdapter.java:1112)
>
> [java] at
> org.eclipse.emf.codegen.ecore.genmodel.generator.GenPackageGeneratorAdapter.generatePackageInterface(GenPackageGeneratorAdapter.java:467)
>
>
> Regards
> Matthijs Galesloot


--
* Volker Wegert * http://www.volker-wegert.de/contact *
Re: EcoreGeneratorFragment: path is unmapped [message #759276 is a reply to message #758277] Mon, 28 November 2011 08:48 Go to previous messageGo to next message
Matthijs  is currently offline Matthijs Friend
Messages: 11
Registered: August 2011
Junior Member
I have checked the contents of EcorePlugin.getPlatformResourceMap(). The URIConverter calls the EcorePlugin to resolve paths, and the PlatformResourceMap provides the basis for the mappings. It appears that on the linux/hudson build an entry for the current current xtext grammar project is missing. Other child projects from the platform URI do appear in the map.

Maybe there is some oddness in the technology setup. I am running mwe2 from a maven/tycho build.

A workaround is possible by adding the project to the map. I have made a subclass of StandaloneSetup to run this code:

Map<String, URI> map = EcorePlugin.getPlatformResourceMap();
map.put(project, URI.createFileURI(getPlatformRootPath() + "/" + project + "/"));

This seems to do the trick, I am still testing to be sure.
Re: EcoreGeneratorFragment: path is unmapped [message #1076697 is a reply to message #759276] Wed, 31 July 2013 18:59 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
Matthijs wrote on Mon, 28 November 2011 09:48

A workaround is possible by adding the project to the map. I have made a subclass of StandaloneSetup to run this code: ...


I just ran into the same issue, witnessed by the fact that the workaround indeed fixed the problem.

Digging deeper I found the following root cause:
We played by Maven/SVN best practice to *not* persist the .project and .classpath files (because they can be derived from the pom when checking out the project using m2e).
This led to the quite invisible difference between working on a local machine where projects had been checked out in Eclipse and builds on Jenkins which had the "raw" SVN checkout.
Nothing in the tool chain would complain about missing files, only the EcoreGenerator would reference the genmodel by its file URI instead of mapping this to a platform:/resource URI, for no visible reason.

Should I file a RFE to report this issue in a humanly readable form? Would this bug go to EMF or to Xtext?


cheers,
Stephan
Re: EcoreGeneratorFragment: path is unmapped [message #1076706 is a reply to message #1076697] Wed, 31 July 2013 19:15 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

standalonesetup.setPlatformUri should actually do the very same. but ihmo the problem is unsolveable since you want to refer to resources with the name in the .project file.
unless the foldername == project name this should be no problem. but if there is no .project file and and project name != foldername wherefrom should Xtext guess the project name?


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: EcoreGeneratorFragment: path is unmapped [message #1076769 is a reply to message #1076706] Wed, 31 July 2013 20:59 Go to previous message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
I see my suggestion wasn't obvious, so I fleshed it out into a proper RFE:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=414169

Short version: my suggestion wasn't about always guessing the right thing, but about more precisely reporting when necessary information is missing, and where it was expected.

If the tool needs help it should ideally tell me in a way that enables me to provide that help Smile

cheers,
Stephan
Previous Topic:about outline view
Next Topic:Error This expression is not allowed in this context
Goto Forum:
  


Current Time: Thu Apr 25 09:08:01 GMT 2024

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

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

Back to the top