Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 398891 - Resource to namespace URI replacing error with subpackages
Summary: Resource to namespace URI replacing error with subpackages
Status: CLOSED DUPLICATE of bug 399832
Alias: None
Product: Viatra
Classification: Modeling
Component: Query (show other bugs)
Version: oldinquery   Edit
Hardware: PC Windows 8
: P3 normal
Target Milestone: M2   Edit
Assignee: Project Inbox CLA
QA Contact: Istvan Rath CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-23 10:39 EST by Abel Hegedus CLA
Modified: 2013-07-10 04:46 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Abel Hegedus CLA 2013-01-23 10:39:01 EST
When generating the globalEiq.xmi, we replace the platform URI to the namespace URI like this:
platform:/resource/descent.model/models/descent.ecore#//jitd/dungeon/Hero becomes http://dungeon.jitd.descent/1.0#//jitd/dungeon/Hero (the dungeon EPackage is inside jitd, inside descent)
However, when Xtext tries to resolve the later, it first retrieves the resource for http://dungeon.jitd.descent/1.0, which is unfortunatly NOT the resource for DescentPackage, but for the JitdPackage. Then it tries to find the "jitd" element inside the root element (//), and fails.

While we know that this URI manipulation happens in XMIResourceURIHandler, we do not know how to decide on a proper fragment handling strategy, as we have no information on which EPackage will be the toplevel content of the Resource that is used for proxy resolution...

Test case:
git clone https://miklosfoldenyi@bitbucket.org/miklosfoldenyi/descent.git

- Start eclipse with "descent" as the workspace

- Import all 4 projects into workspace

- Generate model files for "/model/descent.genmodel" in "descent.model" project.
 - right click and "Generate Model Code"

- None of the projects should have any error at this point.

- Open product definition file in "descent.client" project and click "Launch an Eclipse application"

The above was tested with Eclipse Juno 4.2, plugins installed:
  E4 CSS Spy (Incubation)	0.12.0.v20111206-1509-17B-7w3123161302752	org.eclipse.e4.tools.css.spy.feature.feature.group	Eclipse.org
  Eclipse e4 Tools (Incubation)	0.12.0.v20120529-2033-28Q1EVVFNTFtSK8WOZd51	org.eclipse.e4.core.tools.feature.feature.group	Eclipse.org
  Eclipse for RCP and RAP Developers	1.5.0.20120614-1633	epp.package.rcp	null
  Ecore Tools SDK	1.1.0.201205150811	org.eclipse.emf.ecoretools.sdk.feature.group	Eclipse Modeling Project
  EMF - Eclipse Modeling Framework SDK	2.8.1.v20120917-0436	org.eclipse.emf.sdk.feature.group	Eclipse Modeling Project
  EMF-IncQuery SDK (Incubation)	0.7.0.201301141652	org.eclipse.incquery.sdk.feature.source.feature.group	Budapest University of Technology and Economics, Fault Tolerant Systems Research Group
  Xtend SDK	2.3.0.v201206120633	org.eclipse.xtend.sdk.feature.group	Eclipse Xtend
  Xtext SDK	2.3.0.v201206120633	org.eclipse.xtext.sdk.feature.group	Eclipse Modeling Project
Comment 1 Abel Hegedus CLA 2013-02-11 10:05:28 EST

*** This bug has been marked as a duplicate of bug 399832 ***