XText 嵌入编辑器注入失败

XText embed edditor failed to inject

我尝试在 Eclipse 工具中打开嵌入式编辑器。 我有一个目标平台,其中指定了所有需要的插件并启动了产品。 但是,如果我尝试添加代码以嵌入 XText 编辑器,则会出现错误:

我使用了以下链接中的代码来嵌入 XText 编辑器。 Xtext DSL embedded editor in a dialog

目标平台:

堆栈跟踪:

    0    [main] ERROR org.eclipse.xtext.xtext.ui.internal.Activator  - Failed to create injector for org.eclipse.xtext.Xtext

!ENTRY org.apache.log4j 4 0 2020-07-09 11:56:48.422
!MESSAGE org.eclipse.xtext.xtext.ui.internal.Activator  - Failed to create injector for org.eclipse.xtext.Xtext

9    [main] ERROR org.eclipse.xtext.xtext.ui.internal.Activator  - Guice creation errors:

1) Error injecting method, java.lang.IllegalStateException: Missing contribution for type: org.eclipse.xtext.ui.containers.JavaProjectsState
  at org.eclipse.xtext.ui.shared.Access$InternalProviderForContribution.inject(Unknown Source)
  at org.eclipse.xtext.service.MethodBasedModule.configure(MethodBasedModule.java:76)

1 error
com.google.inject.CreationException: Guice creation errors:

1) Error injecting method, java.lang.IllegalStateException: Missing contribution for type: org.eclipse.xtext.ui.containers.JavaProjectsState
  at org.eclipse.xtext.ui.shared.Access$InternalProviderForContribution.inject(Unknown Source)
  at org.eclipse.xtext.service.MethodBasedModule.configure(MethodBasedModule.java:76)

1 error
    at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:435)
    at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:175)
    at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:109)
    at com.google.inject.Guice.createInjector(Guice.java:95)
    at com.google.inject.Guice.createInjector(Guice.java:72)
    at com.google.inject.Guice.createInjector(Guice.java:62)
    at org.eclipse.xtext.xtext.ui.internal.Activator.createInjector(Activator.java:67)
    at org.eclipse.xtext.xtext.ui.internal.Activator.getInjector(Activator.java:55)
    at org.eclipse.xtext.xtext.ui.XtextExecutableExtensionFactory.getInjector(XtextExecutableExtensionFactory.java:26)
    at org.eclipse.xtext.ui.guice.AbstractGuiceAwareExecutableExtensionFactory.create(AbstractGuiceAwareExecutableExtensionFactory.java:54)
    at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:265)
    at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:63)
    at org.eclipse.ui.internal.WorkbenchPlugin.lambda[=10=](WorkbenchPlugin.java:288)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:72)
    at org.eclipse.ui.internal.WorkbenchPlugin.createExtension(WorkbenchPlugin.java:286)
    at org.eclipse.ui.internal.dialogs.WorkbenchPreferenceNode.createPage(WorkbenchPreferenceNode.java:52)
    at org.eclipse.jface.preference.PreferenceDialog.createPage(PreferenceDialog.java:1279)
    at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.createPage(FilteredPreferenceDialog.java:343)
    at org.eclipse.jface.preference.PreferenceDialog.showPage(PreferenceDialog.java:1166)
    at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.showPage(FilteredPreferenceDialog.java:635)
    at org.eclipse.jface.preference.PreferenceDialog.lambda[=10=](PreferenceDialog.java:660)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:72)
    at org.eclipse.jface.preference.PreferenceDialog.selectionChanged(PreferenceDialog.java:657)
    at org.eclipse.jface.viewers.StructuredViewer.run(StructuredViewer.java:817)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
    at org.eclipse.ui.internal.JFaceUtil.lambda[=10=](JFaceUtil.java:47)
    at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:176)
    at org.eclipse.jface.viewers.StructuredViewer.firePostSelectionChanged(StructuredViewer.java:814)
    at org.eclipse.jface.viewers.StructuredViewer.handlePostSelect(StructuredViewer.java:1183)
    at org.eclipse.jface.viewers.StructuredViewer.lambda[=10=](StructuredViewer.java:1206)
    at org.eclipse.swt.events.SelectionListener.widgetSelected(SelectionListener.java:84)
    at org.eclipse.jface.util.OpenStrategy.firePostSelectionEvent(OpenStrategy.java:263)
    at org.eclipse.jface.util.OpenStrategy.access(OpenStrategy.java:258)
    at org.eclipse.jface.util.OpenStrategy.lambda(OpenStrategy.java:428)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3919)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3550)
    at org.eclipse.jface.window.Window.runEventLoop(Window.java:823)
    at org.eclipse.jface.window.Window.open(Window.java:799)
    at org.eclipse.ui.internal.OpenPreferencesAction.run(OpenPreferencesAction.java:66)
    at org.eclipse.jface.action.Action.runWithEvent(Action.java:474)
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:580)
    at org.eclipse.jface.action.ActionContributionItem.lambda(ActionContributionItem.java:412)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4131)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1056)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3944)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3547)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1173)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1062)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
    at org.eclipse.ui.internal.Workbench.lambda(Workbench.java:635)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:559)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:155)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:660)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:597)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1468)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1441)
Caused by: java.lang.IllegalStateException: Missing contribution for type: org.eclipse.xtext.ui.containers.JavaProjectsState
    at org.eclipse.xtext.ui.shared.internal.SharedStateContributionRegistryImpl.getLazySingleContributedInstance(SharedStateContributionRegistryImpl.java:98)
    at org.eclipse.xtext.ui.shared.Access$InternalProviderForContribution.inject(Access.java:67)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.google.inject.internal.SingleMethodInjector.invoke(SingleMethodInjector.java:71)
    at com.google.inject.internal.SingleMethodInjector.inject(SingleMethodInjector.java:90)
    at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:110)
    at com.google.inject.internal.MembersInjectorImpl.call(MembersInjectorImpl.java:75)
    at com.google.inject.internal.MembersInjectorImpl.call(MembersInjectorImpl.java:73)
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1024)
    at com.google.inject.internal.MembersInjectorImpl.injectAndNotify(MembersInjectorImpl.java:73)
    at com.google.inject.internal.Initializer$InjectableReference.get(Initializer.java:147)
    at com.google.inject.internal.Initializer.injectAll(Initializer.java:92)
    at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:173)
    ... 69 more

!ENTRY org.apache.log4j 4 0 2020-07-09 11:56:48.428
!MESSAGE org.eclipse.xtext.xtext.ui.internal.Activator  - Guice creation errors:

1) Error injecting method, java.lang.IllegalStateException: Missing contribution for type: org.eclipse.xtext.ui.containers.JavaProjectsState
  at org.eclipse.xtext.ui.shared.Access$InternalProviderForContribution.inject(Unknown Source)
  at org.eclipse.xtext.service.MethodBasedModule.configure(MethodBasedModule.java:76)

1 error

https://www.eclipse.org/forums/index.php/t/1083153/

我已经更改了 xtext(使用 2.21)和 mwe2 的更新站点(我已经检查了这个文件作为示例 https://git.eclipse.org/c/emf-parsley/org.eclipse.emf-parsley.git/tree/devtools/org.eclipse.emf.parsley.targetplatform/2020-03.target

<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
      <unit id="org.eclipse.emf.mwe.sdk.feature.group" version="0.0.0"/>
      <unit id="org.eclipse.emf.mwe2.runtime.sdk.feature.group" version="0.0.0"/>
      <unit id="org.eclipse.emf.mwe2.language.sdk.feature.group" version="0.0.0"/>
      <repository location="https://download.eclipse.org/modeling/emft/mwe/updates/releases/2.11.2"/>
    </location>
    <location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
        <unit id="org.eclipse.xtext.sdk.feature.group" version="0.0.0"/>
        <repository location="https://download.eclipse.org/modeling/tmf/xtext/updates/releases/2.21.0/"/>
    </location>