osgiequinoxbndtools

Running Xtext in Equinox


I am trying to run a project using Xtext inside the Equinox OSGi runtime. As a minimum example, I only added org.eclipse.xtext to my runtime. However, I end up with many bundles staying in the STARTING phase:

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

I am using Bndtools in Eclipse which also resolved the needed bundles. Below you find my bndrun file:

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

Any idea what is wrong here?


Solution

  • Nothing is wrong.

    Eclipse makes heavy use of Bundle-ActivationPolicy: lazy. The reasons for this are complicated and mostly legacy, but it means that these bundles stay in STARTING state until some other bundle needs to load a class from them (e.g. a DS component implementation class, or something referenced from plugin.xml). At that point they transition to the full ACTIVE state.

    In other words, the STARTING state does not indicate that anything is wrong.