Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Problem loading XMI resource
Problem loading XMI resource [message #423092] Mon, 22 September 2008 22:38 Go to next message
Abdel  is currently offline Abdel Friend
Messages: 10
Registered: July 2009
Junior Member
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.
( 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..

Any help will be appreciated

Thanks
Re: Problem loading XMI resource [message #423112 is a reply to message #423092] Tue, 23 September 2008 14:03 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
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 #423145 is a reply to message #423112] Tue, 23 September 2008 18:43 Go to previous messageGo to next message
Abdel  is currently offline Abdel Friend
Messages: 10
Registered: July 2009
Junior Member
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.
Re: Problem loading XMI resource [message #423148 is a reply to message #423145] Tue, 23 September 2008 19:31 Go to previous message
Ed Merks is currently offline Ed MerksFriend
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/
Previous Topic:Re: JMerge customization
Next Topic:Problems reloading a new XML schema
Goto Forum:
  


Current Time: Wed Apr 24 23:16:19 GMT 2024

Powered by FUDForum. Page generated in 0.02932 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top