运行 Equinox 中的 Xtext
Running Xtext in Equinox
我正在尝试 运行 在 Equinox OSGi 运行 时间使用 Xtext 的项目。作为最小示例,我只将 org.eclipse.xtext 添加到我的 运行 时间。但是,我最终有很多捆绑包停留在 STARTING
阶段:
g! ss
"Framework is launched."
id State Bundle
0 ACTIVE org.eclipse.osgi_3.13.100.v20180827-1536
1 ACTIVE com.google.guava_20.0.0
2 ACTIVE com.google.guava_25.1.0.jre
3 ACTIVE com.google.inject_4.2.2
4 ACTIVE log4j_1.2.17
5 ACTIVE org.antlr.runtime_3.2.0
6 ACTIVE org.apache.felix.gogo.command_1.1.0
7 ACTIVE org.apache.felix.gogo.runtime_1.1.2
8 ACTIVE org.apache.felix.gogo.shell_1.1.2
9 STARTING org.eclipse.emf.common_2.15.0.v20180723-1316
10 STARTING org.eclipse.emf.ecore_2.15.0.v20180722-1159
11 STARTING org.eclipse.emf.ecore.xmi_2.15.0.v20180706-1146
12 STARTING org.eclipse.equinox.common_3.10.200.v20181021-1645
13 ACTIVE org.eclipse.equinox.console_1.3.200.v20181115-0906
14 ACTIVE org.eclipse.xtend.lib_2.16.0.v20181203-0507
15 ACTIVE org.eclipse.xtend.lib.macro_2.16.0.v20181203-0507
16 STARTING org.eclipse.xtext_2.16.0.v20181203-0514
17 ACTIVE org.eclipse.xtext.util_2.16.0.v20181203-0514
18 ACTIVE org.eclipse.xtext.xbase.lib_2.16.0.v20181203-0507
19 ACTIVE org.sonatype.inject_1.4.2
我在 Eclipse 中使用 Bndtools,它也解决了所需的包。下面是我的 bnd运行 文件:
-runfw: org.eclipse.osgi;version='[3.13.100.v20180827-1536,3.13.100.v20180827-1536]'
-runee: JavaSE-1.8
-runrequires: \
bnd.identity;id='org.apache.felix.gogo.shell',\
bnd.identity;id='org.eclipse.equinox.console',\
bnd.identity;id='org.apache.felix.gogo.runtime',\
bnd.identity;id='org.apache.felix.gogo.command',\
bnd.identity;id='org.eclipse.xtext'
-runproperties: \
org.osgi.framework.storage.clean=onFirstInit,\
eclipse.consoleLog=true,\
osgi.console=,\
osgi.console.enable.builtin=false
-runprogramargs: console
-runsystempackages: sun.misc
-runbundles: \
com.google.guava;version='[20.0.0,20.0.1)',\
com.google.guava;version='[25.1.0,25.1.1)',\
com.google.inject;version='[4.2.2,4.2.3)',\
log4j;version='[1.2.17,1.2.18)',\
org.antlr.runtime;version='[3.2.0,3.2.1)',\
org.apache.felix.gogo.command;version='[1.1.0,1.1.1)',\
org.apache.felix.gogo.runtime;version='[1.1.2,1.1.3)',\
org.apache.felix.gogo.shell;version='[1.1.2,1.1.3)',\
org.eclipse.emf.common;version='[2.15.0,2.15.1)',\
org.eclipse.emf.ecore;version='[2.15.0,2.15.1)',\
org.eclipse.emf.ecore.xmi;version='[2.15.0,2.15.1)',\
org.eclipse.equinox.common;version='[3.10.200,3.10.201)',\
org.eclipse.equinox.console;version='[1.3.200,1.3.201)',\
org.eclipse.xtend.lib;version='[2.16.0,2.16.1)',\
org.eclipse.xtend.lib.macro;version='[2.16.0,2.16.1)',\
org.eclipse.xtext;version='[2.16.0,2.16.1)',\
org.eclipse.xtext.util;version='[2.16.0,2.16.1)',\
org.eclipse.xtext.xbase.lib;version='[2.16.0,2.16.1)',\
org.sonatype.inject;version='[1.4.2,1.4.3)'
知道这里出了什么问题吗?
一切正常。
Eclipse 大量使用 Bundle-ActivationPolicy: lazy
。这样做的原因很复杂,而且大多是遗留问题,但这意味着这些 bundle 会保持 STARTING
状态,直到其他 bundle 需要从它们加载 class(例如 DS 组件实现 class ,或引用自 plugin.xml
的内容)。那时他们过渡到完整的 ACTIVE
状态。
换句话说,STARTING
状态并不表示有任何问题。
我正在尝试 运行 在 Equinox OSGi 运行 时间使用 Xtext 的项目。作为最小示例,我只将 org.eclipse.xtext 添加到我的 运行 时间。但是,我最终有很多捆绑包停留在 STARTING
阶段:
g! ss
"Framework is launched."
id State Bundle
0 ACTIVE org.eclipse.osgi_3.13.100.v20180827-1536
1 ACTIVE com.google.guava_20.0.0
2 ACTIVE com.google.guava_25.1.0.jre
3 ACTIVE com.google.inject_4.2.2
4 ACTIVE log4j_1.2.17
5 ACTIVE org.antlr.runtime_3.2.0
6 ACTIVE org.apache.felix.gogo.command_1.1.0
7 ACTIVE org.apache.felix.gogo.runtime_1.1.2
8 ACTIVE org.apache.felix.gogo.shell_1.1.2
9 STARTING org.eclipse.emf.common_2.15.0.v20180723-1316
10 STARTING org.eclipse.emf.ecore_2.15.0.v20180722-1159
11 STARTING org.eclipse.emf.ecore.xmi_2.15.0.v20180706-1146
12 STARTING org.eclipse.equinox.common_3.10.200.v20181021-1645
13 ACTIVE org.eclipse.equinox.console_1.3.200.v20181115-0906
14 ACTIVE org.eclipse.xtend.lib_2.16.0.v20181203-0507
15 ACTIVE org.eclipse.xtend.lib.macro_2.16.0.v20181203-0507
16 STARTING org.eclipse.xtext_2.16.0.v20181203-0514
17 ACTIVE org.eclipse.xtext.util_2.16.0.v20181203-0514
18 ACTIVE org.eclipse.xtext.xbase.lib_2.16.0.v20181203-0507
19 ACTIVE org.sonatype.inject_1.4.2
我在 Eclipse 中使用 Bndtools,它也解决了所需的包。下面是我的 bnd运行 文件:
-runfw: org.eclipse.osgi;version='[3.13.100.v20180827-1536,3.13.100.v20180827-1536]'
-runee: JavaSE-1.8
-runrequires: \
bnd.identity;id='org.apache.felix.gogo.shell',\
bnd.identity;id='org.eclipse.equinox.console',\
bnd.identity;id='org.apache.felix.gogo.runtime',\
bnd.identity;id='org.apache.felix.gogo.command',\
bnd.identity;id='org.eclipse.xtext'
-runproperties: \
org.osgi.framework.storage.clean=onFirstInit,\
eclipse.consoleLog=true,\
osgi.console=,\
osgi.console.enable.builtin=false
-runprogramargs: console
-runsystempackages: sun.misc
-runbundles: \
com.google.guava;version='[20.0.0,20.0.1)',\
com.google.guava;version='[25.1.0,25.1.1)',\
com.google.inject;version='[4.2.2,4.2.3)',\
log4j;version='[1.2.17,1.2.18)',\
org.antlr.runtime;version='[3.2.0,3.2.1)',\
org.apache.felix.gogo.command;version='[1.1.0,1.1.1)',\
org.apache.felix.gogo.runtime;version='[1.1.2,1.1.3)',\
org.apache.felix.gogo.shell;version='[1.1.2,1.1.3)',\
org.eclipse.emf.common;version='[2.15.0,2.15.1)',\
org.eclipse.emf.ecore;version='[2.15.0,2.15.1)',\
org.eclipse.emf.ecore.xmi;version='[2.15.0,2.15.1)',\
org.eclipse.equinox.common;version='[3.10.200,3.10.201)',\
org.eclipse.equinox.console;version='[1.3.200,1.3.201)',\
org.eclipse.xtend.lib;version='[2.16.0,2.16.1)',\
org.eclipse.xtend.lib.macro;version='[2.16.0,2.16.1)',\
org.eclipse.xtext;version='[2.16.0,2.16.1)',\
org.eclipse.xtext.util;version='[2.16.0,2.16.1)',\
org.eclipse.xtext.xbase.lib;version='[2.16.0,2.16.1)',\
org.sonatype.inject;version='[1.4.2,1.4.3)'
知道这里出了什么问题吗?
一切正常。
Eclipse 大量使用 Bundle-ActivationPolicy: lazy
。这样做的原因很复杂,而且大多是遗留问题,但这意味着这些 bundle 会保持 STARTING
状态,直到其他 bundle 需要从它们加载 class(例如 DS 组件实现 class ,或引用自 plugin.xml
的内容)。那时他们过渡到完整的 ACTIVE
状态。
换句话说,STARTING
状态并不表示有任何问题。