Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Import XMI
Import XMI [message #608661] Fri, 06 July 2007 14:59
Eclipse UserFriend
Originally posted by:

I would like to import XMI to Eclipse, specifically RSA, however this
error appears when attempting to load it via Java code.

Package with uri '' not found

I believe that the project being created via Java is a Java project, not
the desired UML project.

Please help me to specify that my Java code will specify that a UML model
is to be created.

Here's my code:

* Created on July 5, 2007, 3:37 PM
* To change this template, choose Tools | Template Manager
* and open the template in the editor.

package loadxmi;
import org.eclipse.emf.common.util.URI;
import java.util.Collections;
//import org.eclipse.emf.*;
import org.eclipse.emf.ecore.resource.*;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;

* @author mereditk
public class Main {

/** Creates a new instance of Main */
public Main() {

* @param args the command line arguments
public static void main(String[] args) {

// Create a resource set.
ResourceSet resourceSet = new ResourceSetImpl();

// Register the default resource factory -- only needed for

resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put(
Resource.Factory.Registry.DEFAULT_EXTENSION, new

// Register the package -- only needed for stand-alone!
//LibraryPackage libraryPackage = LibraryPackage.eINSTANCE;

// Get the URI of the model file.
//URI fileURI = URI.createFileURI(new File("c:/documents and
//URI fileURI = URI.createFileURI(new
URI fileURI = URI.createFileURI(new File("C:/Documents and
// Demand load the resource for this file.
Resource resource = resourceSet.getResource(fileURI, true);

// Print the contents of the resource to System.out.
{, Collections.EMPTY_MAP);
catch (IOException e) {}

Previous Topic:Live validation as default
Next Topic:[Teneo] Identifier for my objects
Goto Forum:

Current Time: Fri Aug 19 12:23:35 GMT 2022

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

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

Back to the top