2
我正在關注加載動態元模型的文章http://www.ibm.com/developerworks/library/os-eclipse-dynamicemf/。動態加載EMF模型時出錯
我加載使用此
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);
模型實例化的文檔,但,從來就得到了XMI文件已經存在於目錄此錯誤消息
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)
。
我能做什麼?
謝謝