Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » WrappedException: The path is unmapped
WrappedException: The path is unmapped [message #1019749] Sat, 16 March 2013 14:54 Go to next message
José Miguel P. is currently offline José Miguel P.Friend
Messages: 66
Registered: March 2010
Member

Hi

I'm trying build a xText grammar using maven tycho. In local it's working ok (using maven), but in any other machine I always get this error:

[INFO] org.eclipse.emf.common.util.WrappedException: java.io.IOException: The path '/com.example/src-gen/com/example/Package.java' is unmapped
[ERROR] 	at org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAdapter.generateJava(AbstractGeneratorAdapter.java:1112)
[ERROR] 	at org.eclipse.emf.codegen.ecore.genmodel.generator.GenPackageGeneratorAdapter.generatePackageInterface(GenPackageGeneratorAdapter.java:467)
[ERROR] 	at org.eclipse.emf.codegen.ecore.genmodel.generator.GenPackageGeneratorAdapter.generateModel(GenPackageGeneratorAdapter.java:219)
[ERROR] 	at org.eclipse.emf.codegen.ecore.genmodel.generator.GenBaseGeneratorAdapter.doGenerate(GenBaseGeneratorAdapter.java:221)
[ERROR] 	at org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAdapter.generate(AbstractGeneratorAdapter.java:290)
[ERROR] 	at org.eclipse.emf.codegen.ecore.generator.Generator.generate(Generator.java:617)
[ERROR] 	at org.eclipse.emf.codegen.ecore.generator.Generator.generate(Generator.java:528)
[ERROR] 	at org.eclipse.xtext.generator.ecore.EcoreGeneratorFragment.doGenerate(EcoreGeneratorFragment.java:158)
[ERROR] 	at org.eclipse.xtext.generator.ecore.EcoreGeneratorFragment.generate(EcoreGeneratorFragment.java:225)
[ERROR] 	at org.eclipse.xtext.generator.CompositeGeneratorFragment.generate(CompositeGeneratorFragment.java:92)
[ERROR] 	at org.eclipse.xtext.generator.LanguageConfig.generate(LanguageConfig.java:113)
[ERROR] 	at org.eclipse.xtext.generator.Generator.generate(Generator.java:361)
[ERROR] 	at org.eclipse.xtext.generator.Generator.invokeInternal(Generator.java:128)
[ERROR] 	at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:126)
[ERROR] 	at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.invoke(Mwe2Bridge.java:34)
[ERROR] 	at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:201)
[ERROR] 	at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.invoke(AbstractCompositeWorkflowComponent.java:35)
[ERROR] 	at org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:19)
[ERROR] 	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:102)
[ERROR] 	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:79)
[ERROR] 	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:71)
[ERROR] 	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:76)
[ERROR] 	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:35)
(.....)


This is a problem like described at http://www.eclipse.org/forums/index.php/m/758189/#msg_758189 it seems that EcorePlugin.getPlatformResourceMap() is not returning a properly value.

Any idea how fix it?

Thanks in advance!
Re: WrappedException: The path is unmapped [message #1019758 is a reply to message #1019749] Sat, 16 March 2013 15:26 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi,

is the project structure the same in both cases?


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: WrappedException: The path is unmapped [message #1019768 is a reply to message #1019758] Sat, 16 March 2013 16:09 Go to previous messageGo to next message
José Miguel P. is currently offline José Miguel P.Friend
Messages: 66
Registered: March 2010
Member

Hi Christian

Yes, it's the same structure.

I have detected the problem, I think the mapping is formed using the .project file.
The function protected void registerProject(File file) wait a .project file, and extract the name from this file.

Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new FileInputStream(file));
String name = document.getDocumentElement().getElementsByTagName("name").item(0).getTextContent();
URI uri = URI.createFileURI(file.getParentFile().getCanonicalPath() + File.separator);
EcorePlugin.getPlatformResourceMap().put(name, uri);
if (bundleNameMapping.get(name) != null) {
	EcorePlugin.getPlatformResourceMap().put(bundleNameMapping.get(name), uri);
}


When I run the mwe2 file from maven, .project file doesn't exist so it can't create the mapping.

If the last is correct. Is there any way of specify the uri without .project file?

Thanks in advance!
Re: WrappedException: The path is unmapped [message #1019772 is a reply to message #1019768] Sat, 16 March 2013 16:24 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi,

what exactly do you try to do? btw using maven tycho you usually have a .project file.


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: WrappedException: The path is unmapped [message #1019776 is a reply to message #1019772] Sat, 16 March 2013 16:31 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
P.S: did you have a look at https://github.com/aphethean/xtext-maven-examples

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: WrappedException: The path is unmapped [message #1019796 is a reply to message #1019776] Sat, 16 March 2013 17:42 Go to previous messageGo to next message
José Miguel P. is currently offline José Miguel P.Friend
Messages: 66
Registered: March 2010
Member

Hi!

Yes, I have followed this example, in addition to others similars for create the tycho structure.

In this example, .project is shared at git repository, so there is not problem. In my case, we don't share .projects because some times there is local information.

We use to generate eclipse projects running mvn eclipse:eclipse but for build we don't need it, so we don't share it.

Building xText seems mandatory to share the .project file, in fact my problem have been fixed sharing this file at xText project, but, given that we normally don't share .project file, Is there other way of construct the PlatformResourceMap without .project?

Thanks so much Christian Smile
Re: WrappedException: The path is unmapped [message #1019801 is a reply to message #1019796] Sat, 16 March 2013 18:00 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi,

have a look at the sourcecode of the Standalonesetup. build your own version (subclass) that does the same a the part you showed does.


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Sat, 16 March 2013 18:02]

Report message to a moderator

Re: WrappedException: The path is unmapped [message #1023938 is a reply to message #1019801] Mon, 25 March 2013 13:56 Go to previous message
José Miguel P. is currently offline José Miguel P.Friend
Messages: 66
Registered: March 2010
Member

Thanks for all Christian and sorry for the delay.

At the end, I have share a small .project that only contains the project name.

Thanks so much Smile
Previous Topic:Xtext Standalone Code Generator build with Maven
Next Topic:Xtext Code generator Problem
Goto Forum:
  


Current Time: Fri Mar 29 08:52:17 GMT 2024

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

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

Back to the top