从Eclipse运行的RCP应用程序运行良好,将其导出会抛出InjectionExceptions [英] RCP application run from Eclipse runs fine, exporting it throws InjectionExceptions

查看:164
本文介绍了从Eclipse运行的RCP应用程序运行良好,将其导出会抛出InjectionExceptions的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试执行我最近从Eclipse Indigo转到Photon的RCP应用程序.更改/更新了所需的库之后,我已经成功运行了该应用程序,而没有将产品作为Eclipse应用程序(从Eclipse IDE)启动的问题.

I'm trying to execute my RCP application I recently moved from eclipse Indigo to Photon. After changing/updating the required libraries, I have managed to run the application without problems launching the product as an Eclipse application (from the Eclipse IDE).

但是,当我将产品导出到本机可执行文件并启动它时,会出现几个InjectionException

However, when I export the product to a native executable and launch it, I get several InjectionException

!SESSION 2018-09-06 16:48:55.406 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_171
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=es_ES
Framework arguments:  -clearPersistedState
Command-line arguments:  -os win32 -ws win32 -arch x86 -clean -clearPersistedState

!ENTRY org.eclipse.e4.ui.workbench 4 0 2018-09-06 16:48:59.412
!MESSAGE Unable to create class 'org.eclipse.e4.ui.internal.workbench.addons.CommandProcessingAddon' from bundle '52'
!STACK 0
org.eclipse.e4.core.di.InjectionException: Unable to process "CommandProcessingAddon.broker": no actual value was found for the argument "IEventBroker".
    at org.eclipse.e4.core.internal.di.InjectorImpl.reportUnresolvedArgument(InjectorImpl.java:489)
    at org.eclipse.e4.core.internal.di.InjectorImpl.resolveRequestorArgs(InjectorImpl.java:480)
    at org.eclipse.e4.core.internal.di.InjectorImpl.internalInject(InjectorImpl.java:126)
    at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:412)
    at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:345)
    at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:214)
    at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:108)
    at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:74)
    at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:51)
    at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:282)
    at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:617)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:597)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
...

!ENTRY org.eclipse.e4.ui.workbench 4 0 2018-09-06 16:48:59.419
!MESSAGE Unable to create class 'org.eclipse.e4.ui.internal.workbench.addons.ContextProcessingAddon' from bundle '52'
!STACK 0
org.eclipse.e4.core.di.InjectionException: Unable to process "ContextProcessingAddon.broker": no actual value was found for the argument "IEventBroker".
    at org.eclipse.e4.core.internal.di.InjectorImpl.reportUnresolvedArgument(InjectorImpl.java:489)
    at org.eclipse.e4.core.internal.di.InjectorImpl.resolveRequestorArgs(InjectorImpl.java:480)
    at org.eclipse.e4.core.internal.di.InjectorImpl.internalInject(InjectorImpl.java:126)
    at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:412)
    at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:345)
    at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:214)
    at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:108)
    at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:74)
    at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:51)
    at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:282)
    at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:617)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:597)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)

我检查了启动配置和产品上的插件列表是否相同(使用添加必需的插件"进行选择,并在启动配置中使用验证插件"进行了检查).实际上,在产品页面上按添加所需的插件似乎会使启动窗口中包含一些插件(似乎是必需的,以便应用程序在eclipse中启动),因此我手动添加了缺少的插件产品,但仍然没有运气.我已将最终的插件列表(启动配置中的一个)上传到此pastebin ,以查看它是否与它.从产品自动生成的插件列表实际上是相同的,但是少包含7个插件(如上所述,我添加了这个插件).

I have checked that the plugin list on the launch configuration and the product are the same (selected with "add required plugins" and checked with "validate plugins" on the launch configuration). In fact, pressing the add required plugins from the product page seems to leave some plugins out that the launch window includes (and seem to be needed in order to the application to launch in within eclipse) so I've added the missing plugins by hand to the product, but still no luck. I have uploaded the final plugin list (the one from the launch configuration) to this pastebin to see if it somewhat related to it. The plugin list automatically generated from the product is virtually the same but contains 7 plugins less (and I added then as I said above).

我是Eclipse Photon和所有这种注入机制的新手,但是我可以肯定我的项目不会直接使用它(也许其中包含的某些新插件会间接使用它吗?).

I'm new to Eclipse Photon and all this injection mechanism, but I'm pretty sure my project doesn't use it directly (maybe some new plugin that is included uses it indirectly?).

我使用了另一个答案中建议的-clean和-cleanPersistedState参数来处理注入问题,但是我仍然得到相同的结果.

I have used the -clean and -cleanPersistedState parameters as suggested in another answer to deal with the injection problems but I still get same results.

关于如何解决此问题或如何禁用注入的任何线索/哪个插件导致注入被调用?

Any clues on how to solve this or how to disable injection/which plugin is causing the injection to be called?

致谢

推荐答案

可能未启动OSGi声明性服务插件org.eclipse.equinox.ds,这将阻止事件代理工厂运行.

Probably the OSGi declarative services plugin org.eclipse.equinox.ds is not being started which would prevent the event broker factory from running.

如果您使用xxx.product文件配置RCP,请检查配置"选项卡的启动级别"部分.使用添加推荐"按钮添加推荐的启动配置,其中包括org.eclipse.equinox.ds

If you are using an xxx.product file to configure the RCP check the 'Start Levels' section of the 'Configuration' tab. Use the 'Add Recommended' button to add the recommended start configuration which includes org.eclipse.equinox.ds

更新:从Eclipse 2018-09开始,org.apache.felix.scr代替org.eclipse.equinox.ds,并且需要类似的启动级别配置.

Update: For Eclipse 2018-09 onwards org.apache.felix.scr replaces org.eclipse.equinox.ds and requires similar start level configuration.

这篇关于从Eclipse运行的RCP应用程序运行良好,将其导出会抛出InjectionExceptions的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆