Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » load model from xmi file
load model from xmi file [message #1856475] Mon, 12 December 2022 16:33 Go to next message
wld blm is currently offline wld blmFriend
Messages: 6
Registered: December 2022
Junior Member
Hello,

I'm new to EMF, I'm given 2 xmi files (a metamodel and a model) and I have to load them in my project.
When I try to load the model I have this error Exception in thread "main" org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Package with uri '*' not found. (, 8, 17)

I read a lot about this error and people says that we have to register the package but I don't really understand what that means. All i have is this 2 xmi files.

Thank to y'all
Re: load model from xmi file [message #1856483 is a reply to message #1856475] Tue, 13 December 2022 07:19 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33143
Registered: July 2009
Senior Member
I can only guess what exactly you've tried and what the resources look like... Maybe all you need to do is register the metadata's namespace URI before you load the model:
    EPackage ePackage = (EPackage)metadataModel.getContents().get(0);
    resourceSet.getPackageRegistry().put(ePackage .getNsURI(), ePackage);


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: load model from xmi file [message #1856505 is a reply to message #1856483] Tue, 13 December 2022 15:48 Go to previous message
wld blm is currently offline wld blmFriend
Messages: 6
Registered: December 2022
Junior Member
Thanks for your answer,
actually i'v found how to do it here it's very well explained and yes it's exactly what you posted.

Regards
Previous Topic:[CDO] Release 4.21 Is Now Available
Next Topic:failed to read genmodel
Goto Forum:
  


Current Time: Thu May 02 08:17:26 GMT 2024

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

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

Back to the top