Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » How to fix a "Package with uri not found." error
How to fix a "Package with uri not found." error [message #693542] Wed, 06 July 2011 17:50 Go to next message
Benson  is currently offline Benson Friend
Messages: 4
Registered: July 2011
Junior Member
Build Identifier: 20090619-0625

The following code provides me with the following error,
"Package with uri htt..// not found.".
I was hoping someone could possibly explain to me what is happening. Within
the contents of the project.xmi file it contains that uri and this file was
exported from Rhapsody. This .xmi file is a model diagram. I found out that
EMF allows an interpretation of this model as a UML and in turn I was hoping I
could traverse that UML interpretation rather than the .xmi text. My ultimate
goal is to recreate that Rhapsody model in Eclipse.

Here is the beginning of the stack trace:

org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Package with uri htt..// not found. (file:/C:/project.xmi, 3, 80)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.handleErrors(
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(
at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(

(the htt..// is a weblink)


String pathToXMI = "C:\\project.xmi";
File XMIFile = new File(pathToXMI);
URI coreXMI = URI.createFileURI(pathToXMI);

Resource resource = resourceFact.createResource(coreXMI);
try {

resource.load(new FileInputStream(XMIFile), Collections.EMPTY_MAP);

} catch (FileNotFoundException e) {
} catch (IOException e) {

I believe I have to register the package but I'm not exactly sure how to... any form of assistance would be greatly appreciated.

Re: How to fix a "Package with uri not found." error [message #881360 is a reply to message #693542] Mon, 04 June 2012 12:04 Go to previous message
Endre  ovács is currently offline Endre ovácsFriend
Messages: 3
Registered: February 2011
Junior Member
sorry for reviving such old thread, but this might come handy for someone google-ing this question:

I just encountered the same error, then it came to my mind that i haven't initialized my generated package.
It can be done easily through:


if we take a closer look at its code:

YourGeneratedPackage eINSTANCE =;
Previous Topic:qualified association
Next Topic:Problem in a loop parcour XML
Goto Forum:

Current Time: Thu May 24 08:13:26 GMT 2018

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

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

Back to the top