从Eclipse运行的RCP应用程序运行正常,导出它会抛出InjectionExceptions

时间:2022-06-24 11:13:44

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).

我正在尝试执行我最近从Eclipse Indigo转移到Photon的RCP应用程序。在更改/更新所需的库之后,我设法运行应用程序而没有将产品作为Eclipse应用程序启动(来自Eclipse IDE)。

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

但是,当我将产品导出到本机可执行文件并启动它时,我得到几个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)

etc.

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中启动)所以我已经手动添加了缺少的插件对产品,但仍然没有运气。我已将最终插件列表(启动配置中的一个)上传到此pastebin,以查看它是否与它有些相关。从产品自动生成的插件列表实际上是相同的,但包含7个插件少(然后我添加,如上所述)。

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?).

我是Eclipse Photon和所有这些注入机制的新手,但我很确定我的项目不直接使用它(也许包含的一些新插件间接使用它?)。

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.

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

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

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

Regards

1 个解决方案

#1


1  

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

可能没有启动OSGi声明服务插件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

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

#1


1  

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

可能没有启动OSGi声明服务插件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

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