我对Eclipse 3.x开发很有经验,现在想开发E4应用程序。因此,我测试了一个简单的示例,以开始使用新事物。
我逐步按照本教程进行操作,但会导致相同的错误。但是,他没有得到那些错误。
我正在使用Eclipse Luna(4.4.2)并安装了E4 Tools(0.17)。我创建了一个新的Eclipse 4应用程序,并使用Import 3x-> View as CompatibilityViewApplication.e4xmi
作为共享部分添加到Common Resource Navigator(项目浏览器)中。然后,我添加了一个引用共享部分的占位符。我已将所有必要的插件添加到产品的依赖项中。我还添加了兼容性插件。
然而,当我启动应用程序,我得到一个InjectionException
在InjectorImpl#internalMake()#331
其简单地说就是:
if (unresolved(actualArgs) != -1) continue;
调试unresolved()
让我到以下几点(InjectorImpl#489
):
Creatable creatableAnnotation = desiredClass.getAnnotation(Creatable.class);
哪里desiredClass
是课org.eclipse.ui.internal.ViewReference
。然后,该函数返回1,导致大写和异常继续。stacktrace如下(此处已满):
!ENTRY org.eclipse.e4.ui.workbench 4 0 2015-05-06 13:00:05.899
!MESSAGE Unable to create class 'org.eclipse.ui.internal.e4.compatibility.CompatibilityView' from bundle '96'
!STACK 0
org.eclipse.e4.core.di.InjectionException: Could not find satisfiable constructor in org.eclipse.ui.internal.e4.compatibility.CompatibilityView
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:346)
at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:258)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)
...
为了解决这个问题,我必须遵循这个很棒的教程。正如@ greg-449已经提到的那样,您必须使用3.x RCP并将e4感知产品放在其顶部。然后兼容性层将被初始化。因此,您必须执行以下操作(本教程对此进行了详细描述):
其余内容在链接的教程中进行了描述。千万不能忘记添加-clearPersistedState到产品的启动选项。因此,您将看到应用程序模型的增量。如果要使用基于功能的产品,则应创建一个功能插件,该插件引用RCP插件并将其作为对产品的依赖项添加。因此,您不必按照教程中所述更改运行配置。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句