无法启动maven + tycho创建的Eclipse RCP应用程序

时间:2017-09-13 15:30:24

标签: eclipse maven eclipse-rcp xtext tycho

我发现了以下问题。 如果Eclipse IDE中由标准功能创建的Eclipse RCP应用程序的分发开始没有问题 如果由maven脚本创建的相同应用程序失败并出现错误

!SESSION 2017-09-13 13:32:10.129 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_131
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Command-line arguments:  -os win32 -ws win32 -arch x86_64

!ENTRY org.eclipse.osgi 4 0 2017-09-13 13:32:12.185
!MESSAGE Application error
!STACK 1
java.lang.IllegalStateException: Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resolved and started (see config.ini).
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:78)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
    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:673)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1492)

我提供了一些调查,发现未正确创建config.ini文件。某些root插件未标记为flag start。 这些是 : - org.eclipse.core.runtime_3.12.0.v20160606-1342.jar - org.eclipse.equinox.common_3.8.0.v20160509-1230.jar - org.eclipse.equinox.ds_1.4.400.v20160226-2036.jar - org.eclipse.equinox.event_1.3.200.v20160324-1850.jar - org.eclipse.update.configurator_3.3.400.v20160506-0750.jar

你能否告诉我这个问题的可能原因? 有没有办法正确配置生成config.ini?

提前致谢 亚历

1 个答案:

答案 0 :(得分:0)

我找到了解决这个问题的方法。这是: 必须将以下部分添加到产品定义

<configurations>
  <plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="0" />
  <plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
  <plugin id="org.eclipse.equinox.ds" autoStart="true" startLevel="2" />
  <plugin id="org.eclipse.equinox.event" autoStart="true" startLevel="2" />
  <plugin id="org.eclipse.equinox.simpleconfigurator" autoStart="true" startLevel="1" />
</configurations>

通常来说,XML的这一部分定义了在启动应用程序时自动启动哪个插件。产品定义是用于描述目标eclipse应用程序的文件。例如:

https://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.pde.doc.user%2Fguide%2Ftools%2Ffile_wizards%2Fnew_product_config.htm