Thursday, December 23, 2010

Solving inside Eclipse IDE: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://*' not found

When opening an XMI file (EMF model) inside the Eclipse Modeling IDE you may sometimes encounter the following error:

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://www.abispulsa.com/model/1.0' not found. (platform:/resource/com.abispulsa.model/src/model/Catalog.xmi, 2, 126)
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 org.eclipse.emf.ecore.presentation.EcoreEditor.createModelGen(EcoreEditor.java:1062)
at org.eclipse.emf.ecore.presentation.EcoreEditor.createModel(EcoreEditor.java:1082)
at org.eclipse.emf.ecore.presentation.EcoreEditor.createPages(EcoreEditor.java:1147)
...

When this happens in your application, you can register the package to fix it.

However in this case the error happens when you want to edit an XMI file (EMF model) inside the Eclipse IDE.

To fix it open the file using the plain XML Editor, and change the line :

<abispulsa:Catalog xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:abispulsa="http://www.abispulsa.com/model/1.0">

to point to the metamodel's location using xsi:schemaLocation :

<abispulsa:Catalog xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:abispulsa="http://www.abispulsa.com/model/1.0" xsi:schemaLocation="http://www.abispulsa.com/model/1.0 abispulsa.ecore">

Now you can open the file in the EMF Editor successfully.

11 comments:

  1. I have exactly the situation you describe here, but happen to be unable to point to an matching .ecore file:
    In Rational Software Architect I created an Data model based on Oracle specifics. The resulting model, among other extensions, uses

    xmlns:SQLSchema="http:///org/eclipse/datatools/modelbase/sql/schema.ecore"

    Having looked into all .jar-Files of the installation I was unable to find a matching File. Instead I found .class-Files in org.eclipse.datatools.modelbase.sql_1.0.900.v20091201_1500.jar that seem to represent the ecore-Metamodel in Java. Is it possible to convert such classes back to an .ecore-Metamodel or is there another option to make the editor understand that a metamodel representation is available?

    ReplyDelete
  2. Satchel understood that the great white players such as Joe DiMaggio for example, received treatment from others that cambridge satchel would help propel their star status and legendary accomplishments. He knew if he was going to ensure his own legacy, he would need to do that self promotion himself. In a way, it's as if Satchel Paige understood cambridge satchel company in this early era the importance of having a personal brand. He even contributed to discrepancies about his age in order to make his accomplishments more extraordinary. We hear that one of the greatest mysteries of the 30's and 40's was the true age of messi jersey!

    ReplyDelete
  3. Wow Gold can be used to buy weapons and items, which are essential to finish the tasks or to conquer the enemies in game. Different items have different values, including the most common weapons. They are commonly measured and traded with certain amount of Cheap WOW Gold. So many regular gamers spend several hours every day to farm enough World Of Warcraft Gold to exchange the great weapons they seeking for. But obviously, it's time-consuming and frustrated because you could be beaten constantly.Welcome to www.zyy.com to Buy wow Gold.

    ReplyDelete
  4. Cute story. Makes me want to be better. Thanks for sharing. You are wonderful.

    Cheap RS Gold

    Cheap MapleStory Mesos

    ReplyDelete
  5. Every World of Warcraft fans, good new for you! It has just been several days after the halloween's day, now we are about to celebrate another big festival, the thanksgiving day. Do not miss fantastic contents that will be available in the game. You will not only be able to get aboundant World of Warcraft gold as rewards, you will also be able to experience totally new storys in the game with your friends, you will not like to miss it.

    ReplyDelete
  6. However in this case the error happens when you want to edit an XMI file (EMF model) inside the Eclipse IDE.

    To fix it open the file using the plain XML Editor, and change the line :guild wars 2 gold
    buy guild wars 2 gold
    cheap guild wars 2 gold
    cheapest guild wars 2 gold
    guild wars 2 gold for sale

    ReplyDelete
  7. I have exactly the situation you describe here, but happen to be unable to point to an matching .ecore file:
    In Rational Software Architect I created an Data model based on Oracle specifics. The resulting model, among other extensions, uses
    swtor gold
    buy swtor gold
    cheap swtor gold
    tor credits
    buy tor credits
    cheap tor credits

    ReplyDelete
  8. That is really cool. Thanks for finding it. Some really good ideas there, this is going to be a real time sink. You can learn more: China tourism | China travel service | China vacation packages

    ReplyDelete
  9. Since our founding in 2002, Hanbridge Mandarin has provided thousands of learners with high-quality campus-based courses, online classes, and intensive cultural immersion programs. Utilizing?easy, fun and rewarding methods, we work hard to ensure our students can understand, use and ultimately master Mandarin communication skills.

    More Chinese learning tags : mandarin Chinese | learn mandarin Chinese | learning mandarin Chinese

    ReplyDelete
  10. Nice article, thanks for the information. It's very complete information. I will bookmark for next reference
    jaring futsal | jaring golf | jaring pengaman proyek |
    jaring pengaman bangunan | jaring pengaman gedung
    http://www.jual-jaring.blogspot.com/
    http://www.agen-jaring.blogspot.com/
    http://www.pancasamudera-safetynet.blogspot.com/
    http://www.toko-jaring.blogspot.com/
    http://www.pusat-jaring.blogspot.com/
    http://jualjaringpengaman.blogspot.com/
    https://pancasamudera.wordpress.com/
    https://pasangjaringfutsal.wordpress.com/
    https://jualtambangmurah.wordpress.com/
    https://tokojaring.wordpress.com/
    https://jualjaringfutsal.wordpress.com/
    https://jaringfutsal.wordpress.com/


    ReplyDelete