Hi all,
I have an xmi file that I generated from an ecore model using the
ecore model editor from ecplise
with Create dynamic instance.
the xmi file is shown below :
<?xml version="1.0" encoding="ASCII"?>
<bp:Process xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:bp="ca.uqam.latece.bpc4s"
xsi:schemaLocation="ca.uqam.latece.bpc4s ./../../bp.ecore"
name="Ordering">
<succession nextStep="//@ownedCoursePart.0" name="Succession0">
<previousStep href="../../resource/shared/changePart/Start.xmi#/"/>
<successorEvent href="../../resource/shared/event/Event_Start.xmi#/"/>
</succession>
<succession previousStep="//@ownedCoursePart.0"
nextStep="//@ownedCoursePart.1" name="Succession1">
<successorEvent href="../../resource/shared/event/Event_Start.xmi#/"/>
<predeccesorEvent
href="../../resource/shared/event/Event_Finish.xmi#/"/>
</succession>
....
....
</bp:Process>
This file opens without any problem using the eclipse ecore editor.
When I tried to load the same file using the following code,
ResourceSet resourceSet = new ResourceSetImpl();
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("xmi",
new XMIResourceFactoryImpl());
BpPackage.eINSTANCE.eClass(); URI uri =
URI.createURI(fileURI ,true);
Resource resource = resourceSet.getResource(uri, true);
It s giving Feature Not found Exception
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException:
org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 'xmi' not
found.