[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.emf] Problem loading XMI resource

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. (file:///C:/Doctorat/Dev/eclipse/ws/bpc4s.specializing/bin/repository/processes/ordering/dynamic.xmi, 2, 211)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:315)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:397)
at ca.uqam.latece.bpc4s.specialization.EmfTest.testParseInformationalViewReader(EmfTest.java:54)
....
If I remove xmlns:xmi="http://www.omg.org/XMI";, It's giving Feature 'xsi' not found..


Any help will be appreciated

Thanks