[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[emf-dev] why I got the following errors when a standalone app try to load EMF model

Hi. I am trying to use the following code to load a EMF model into my standalone app. but got exception, who know why it happen:


String fileName="c:/test.ecore";
URI ModelURI= URI.createFileURI(fileName);
ResourceSet resourceset = new ResourceSetImpl();
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("ecore",new XMIResourceFactoryImpl());

Resouce resource= resourceSet.getResource(ModelURI, true); //Exception was throw here

the exception is:

Package with uri 'http://www.eclipse.org/emf/2002/ECore' not found.
at org.eclipse.emf.ecore.xmi.imple.XMLHandler.getPackageForURI(XMLHandler.java:1029)

Huang RB