簡體   English   中英

Java Xtext / EMF資源工廠Impl NoClassDefFoundError

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM