WrappedException: The path is unmapped [message #1019749] |
Sat, 16 March 2013 14:54 |
|
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 #1019768 is a reply to message #1019758] |
Sat, 16 March 2013 16:09 |
|
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 #1019796 is a reply to message #1019776] |
Sat, 16 March 2013 17:42 |
|
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
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04043 seconds