我正在关注文章http://www.ibm.com/developerworks/library/os-eclipse-dynamicemf/以动态加载元模型。
我使用这个加载模型实例文档
ResourceSet load_resourceSet = new ResourceSetImpl();
// ResourceSet load_resourceSet2 = new ResourceSetImpl();
/*
* Register XMI Factory impl ementation using DEFAULT_EXTENSION
*/
load_resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("*", //$NON-NLS-1$
new XMIResourceFactoryImpl());
/*
* Add bookStoreEPackage to package registry
*/
load_resourceSet.getPackageRegistry().put("http:///com.ibm.dynamic.example.bookstore.ecore",
bookStoreEPackage);
// load_resourceSet2.getResourceFactoryRegistry().getExtensionToFactoryMap().put("*", //$NON-NLS-1$
// new XMIResourceFactoryImpl());
/*
* Load the resources using the URI
*/
Resource modelo_esquerda = load_resourceSet
.getResource(URI.createURI("./BookStore.xmi"), true);
但是,我收到了这个错误信息
Exception in thread "main" org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.emf.ecore.xmi.ClassNotFoundException: Class 'BookStore' is not found or is abstract. (.\BookStore.xmi, 9, 34)
XMI 文件已存在于目录中。
我可以做什么?
谢谢