繁体   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