Eclipse RCP测试正常但导出产品无法启动:应用未在注册表中找到
Eclipse RCP 3.x导出产品后无法启动的问题解决
问题描述
本地在产品文件的概览选项卡点击Launch as an eclipse application运行正常,但导出产品后exe无法打开,日志报错如下(xx为应用名称):
!ENTRY org.eclipse.osgi 4 0 2023-10-06 19:11:32.055 !MESSAGE Application error !STACK 1 java.lang.RuntimeException: Application "xx" could not be found in the registry. The applications available are: org.eclipse.equinox.app.error. at org.eclipse.equinox.internal.app.EclipseAppContainer.startDefaultApp(EclipseAppContainer.java:252) at org.eclipse.equinox.internal.app.MainApplicationLauncher.run(MainApplicationLauncher.java:33) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596) at org.eclipse.equinox.launcher.Main.run(Main.java:1467)
尝试将org.eclipse.core.runtime的启动级别改为1后,又出现依赖错误:无法满足org.eclipse.equinox.common 3.15版本的依赖,导致org.eclipse.core.runtime无法解析。
解决方案
1. 确认应用ID与插件依赖配置
- 检查产品配置文件中指定的应用ID,和包含该应用的插件的
plugin.xml里<application>扩展点的id完全一致,不能有拼写错误。 - 在产品配置的Dependencies标签下,确认包含该应用的插件已被勾选,导出时未被排除。
2. 调整启动级别,解决依赖冲突
不要直接修改org.eclipse.core.runtime的启动级别为1,而是优先配置前置依赖的启动级别:
- 打开产品文件,切换到Configuration标签
- 在
Start Levels区域点击Add...,添加org.eclipse.equinox.common并设置启动级别为1 - 保持
org.eclipse.core.runtime的启动级别为默认的2(无需强行改为1),确保它在common加载完成后再启动
3. 检查导出配置与目标平台
- 导出产品时,勾选
Export all plug-ins and fragments from the target platform,确保所有依赖插件(包括org.eclipse.equinox.common 3.15.x)都被包含。 - 检查导出后产品目录下的
configuration/config.ini文件,确认:osgi.bundles中包含org.eclipse.equinox.common@1:start和org.eclipse.core.runtime@2:start- 无错误的版本限制,保证
org.eclipse.equinox.common的版本符合org.eclipse.core.runtime的依赖要求
- 确认目标平台中包含
org.eclipse.equinox.common 3.15.x版本,且无版本冲突,自定义目标平台需确保所有必要Equinox插件已添加。
内容的提问来源于stack exchange,提问作者Kelly Wang
相关产品推荐
相关产品推荐

