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:
code:
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)
.......