[英]Java Xtext/EMF Resource Factory Impl NoClassDefFoundError
更新 :我通過刪除並重新導入項目以及相關性來解決它
我最近將Eclipse從neon3建模版更新為oxygen2建模版。 雖然我的代碼以neon3完美工作,在oxygen2導入我的工作區和更新類路徑和依存關系,同時對程序的執行,之后NoClassDefFoundError
上發生org/eclipse/emf/ecore/xmi/impl/EcoreResourceFactoryImpl
。
在這里,我提供了產生錯誤堆棧以及堆棧一部分的代碼
/*
* generated by Xtext 2.10.0
*/
public class MyAppDslStandaloneSetupGenerated implements ISetup {
@Override
public Injector createInjectorAndDoEMFRegistration() {
// register default ePackages
if (!Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().containsKey("ecore"))
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(
"ecore", new EcoreResourceFactoryImpl());
if (!Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().containsKey("xmi"))
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(
"xmi", new XMIResourceFactoryImpl());
Injector injector = createInjector();
register(injector);
return injector;
}
...
}
堆棧跟蹤:
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/eclipse/emf/ecore/xmi/impl/EcoreResourceFactoryImpl
at com.xtext.myapp.MyAppDslStandaloneSetupGenerated.createInjectorAndDoEMFRegistration(MyAppDslStandaloneSetupGenerated.java:27)
...
Caused by: java.lang.ClassNotFoundException: org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl
插件依賴項:
我已經在網上進行了一些研究,但是我不知道出了什么問題。 的
確保在插件的依賴項上添加/可用了org.eclipse.emf.ecore.xmi
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.