|
Re: Problem loading XMI resource [message #423112 is a reply to message #423092] |
Tue, 23 September 2008 14:03 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
Abdel,
Comments below.
Abdel wrote:
> 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().getExtensionToFacto ryMap().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$1Diagnos ticWrappedException:
> org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 'xmi' not
> found.
I'd expect what you show should just work, but the error seems to
indicate that you aren't really loading with an XMIResourceImpl...
> ( file:///C:/Doctorat/Dev/eclipse/ws/bpc4s.specializing/bin/re pository/processes/ordering/dynamic.xmi,
> 2, 211)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:315)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:274)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
>
> at
> ca.uqam.latece.bpc4s.specialization.EmfTest.testParseInforma tionalViewReader(EmfTest.java:54)
>
> ....
> If I remove xmlns:xmi="http://www.omg.org/XMI", It's giving Feature
> 'xsi' not found.
This is even stranger since this is a namespace declaration and should
never be treated as a feature. I've never seen that before, so it makes
me think there's something important you've not shown...
>
>
> Any help will be appreciated
>
> Thanks
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Re: Problem loading XMI resource [message #423148 is a reply to message #423145] |
Tue, 23 September 2008 19:31 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
Abdel,
Perhaps some configuration issue with how 2.4 is installed? It's not
something I can reproduce nor something anyone else has reported even
though 2.4 has been out for quite a few months...
Abdel wrote:
> Thanks Ed,
>
> The problem I got, was with the version 2.4.0 of EMF, when I switched
> to the version 2.3.2 every thing works fine.
>
> Thank's again.
>
>
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03079 seconds