Search code examples
equinox

java -jar "org.eclipse.osgi_3.9.0.v20130529-1710.jar" -consoleLog : Unable to acquire application service


I am trying to start up the equinox framework, similar to here:

java -jar "org.eclipse.osgi_3.9.0.v20130529-1710.jar" -consoleLog

However, I receive the following error:

!SESSION 2013-07-04 22:49:46.256 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.6.0_25
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_GB
Command-line arguments:  -consoleLog

!ENTRY org.eclipse.osgi 4 0 2013-07-04 22:49:46.692
!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:74)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.main(EclipseStarter.java:152)

Question: Are there any more recent instructions for eclipse equinox osgi framework 3.9.0?


Solution

  • I changed the command to:

    java -jar "org.eclipse.osgi_3.9.0.v20130529-1710.jar" -consoleLog -console -configuration=C:\Dev\configuration\config.ini 
    

    The config.ini file:

    osgi.bundles=reference\:file\:C\:/Dev/configuration/org.eclipse.equinox.console_1.1.0.201307051018.jar@start,reference\:file\:C\:/Dev/configuration/org.apache.felix.gogo.runtime-0.8.0.jar@start,reference\:file\:C\:/Dev/configuration/org.apache.felix.gogo.shell-0.8.0.jar@start,,reference\:file\:C\:/Dev/configuration/org.apache.felix.gogo.command-0.8.0.jar@start
    

    I downloaded:

    http://repo1.maven.org/maven2/org/apache/felix/org.apache.felix.gogo.shell/0.8.0/org.apache.felix.gogo.shell-0.8.0.jar http://repo1.maven.org/maven2/org/apache/felix/org.apache.felix.gogo.command/0.8.0/org.apache.felix.gogo.command-0.8.0.jar http://repo1.maven.org/maven2/org/apache/felix/org.apache.felix.gogo.runtime/0.8.0/org.apache.felix.gogo.runtime-0.8.0.jar

    I checked out the source for org.eclipse.equinox.console and built using eclipse.
    The source was checked out from here: git://git.eclipse.org/gitroot/equinox/rt.equinox.bundles.git.
    Note that the timestamp (201307051018) in the filename in the config.ini was the time I built the jar.

    Starting still gave me an error message, but this time I had the gogo shell:

    !SESSION 2013-07-05 14:15:41.837 -----------------------------------------------
    eclipse.buildId=unknown
    java.version=1.6.0_25
    java.vendor=Sun Microsystems Inc.
    BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_GB
    Framework arguments:  -configuration=C:\Dev\configuration\config.ini
    Command-line arguments:  -consoleLog -configuration=C:\Dev\configuration\config.ini -console
    
    !ENTRY org.eclipse.osgi 4 0 2013-07-05 14:15:42.479
    !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:75)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:372)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:226)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.main(EclipseStarter.java:199)
    bundleresource://8.fwk501544898/gosh_profile: ERROR: java.lang.RuntimeException: Command name evaluates to null: ${.context} bundle 0
    g! ss
    "Framework is launched."
    
    
    id  State       Bundle
    0   ACTIVE      org.eclipse.osgi_3.10.0.qualifier
    6   ACTIVE      org.eclipse.equinox.console_1.1.0.201307051018
    7   ACTIVE      org.apache.felix.gogo.runtime_0.8.0
    8   ACTIVE      org.apache.felix.gogo.shell_0.8.0
    9   ACTIVE      org.apache.felix.gogo.command_0.8.0
    g! 
    

    Adding eclipse.ignoreApp=true to config.ini removed the IllegalStateException, resulting in:

    Debug options:
        file:/C:/Dev/eclipse_source/rt.equinox.framework/bundles/org.eclipse.osgi/.options loaded
    Time to load bundles: 12
    bundleresource://8.fwk516992923/gosh_profile: ERROR: java.lang.RuntimeException: Command name evaluates to null: ${.context} bundle 0
    g! ss
    "Framework is launched."
    
    
    id  State       Bundle
    0   ACTIVE      org.eclipse.osgi_3.10.0.qualifier
    6   ACTIVE      org.eclipse.equinox.console_1.1.0.201307051018
    7   ACTIVE      org.apache.felix.gogo.runtime_0.8.0
    8   ACTIVE      org.apache.felix.gogo.shell_0.8.0
    9   ACTIVE      org.apache.felix.gogo.command_0.8.0
    g!