Launching
Emergency occured at lat=3776999 lon=-12244694 heading=90 speed=50
!SESSION 2012-01-08 20:25:14.148 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.6.0_23
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments: -dev file:/home/ryan/workspace/.metadata/.plugins/org.eclipse.pde.core/Toast/dev.properties -os linux -ws gtk -arch x86_64 -consoleLog -console
!ENTRY org.eclipse.osgi 4 0 2012-01-08 20:25:14.940
!MESSAGE Could not find bundle: org.eclipse.equinox.console
!STACK 0
org.osgi.framework.BundleException: Could not find bundle: org.eclipse.equinox.console
at org.eclipse.osgi.framework.internal.core.ConsoleManager.checkForConsoleBundle(ConsoleManager.java:211)
at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:296)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:175)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:624)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:579)
at org.eclipse.equinox.launcher.Main.run(Main.java:1433)
at org.eclipse.equinox.launcher.Main.main(Main.java:1409)
When I tried switching back to the version of the org.eclipse.osgi package that came with Indigo all was well, but that was not the goal, I wanted to be up an running with the Juno bundles. I realized that I needed to add the org.eclipse.equinox.console bundle, but this was a bit elusive at first. Adding the packages exported by the org.eclipse.equinox.console bundle to my bundle's imported packages does nothing to fix the problem, and neither does adding the bundle itself to my bundle's required plugins. I found this out by actually debugging the Equinox runtime to find that even when these packages or bundles are added as dependencies they are not loaded into the runtime. The required changes must take place in the run configuration, or what effectively amounts to command line arguments to org.eclipse.osgi_3.8.0xxx.jar. So I added the org.eclipse.equinox.console bundle to my run configuration targets, got a few more complaints about missing bundles and ultimately wound up also adding org.apache.felix.gogo.shell and org.apache.felix.gogo.runtime.
What this does behind the scenes is creates the following config.ini file that is used in conjunction with the -configuration flag for the org.eclipse.osgi_3.8.0xxx.jar.
#Configuration File
#Sun Jan 08 20:50:34 PST 2012
osgi.bundles=reference\:file\:/home/ryan/workspace/org.equinoxosgi.toast.client.emergency@start,reference\:file\:/home/ryan/workspace/org.equinoxosgi.toast.dev.airbag@start,reference\:file\:/home/ryan/eclipse/juno/eclipse/plugins/org.eclipse.equinox.console_1.0.0.v20111215-1210.jar@start,reference\:file\:/home/ryan/eclipse/juno/eclipse/plugins/org.apache.felix.gogo.shell_0.8.0.v201110170705.jar@start,reference\:file\:/home/ryan/eclipse/juno/eclipse/plugins/org.apache.felix.gogo.runtime_0.8.0.v201108120515.jar@start,reference\:file\:/home/ryan/workspace/org.equinoxosgi.toast.dev.gps@start
osgi.bundles.defaultStartLevel=4
osgi.install.area=file\:/home/ryan/eclipse/juno/eclipse
osgi.framework=file\:/home/ryan/eclipse/juno/eclipse/plugins/org.eclipse.osgi_3.8.0.v20111210-1354.jar
osgi.configuration.cascaded=false
Which tells the osgi runtime to load the required components for console interaction. I found this out by using the getprop command from the osgi> prompt.
With this out of the way we are now running happily
I hope that this helps someone trying to build an Equinox application in Juno. I have also tested this with openjdk-7 and all is well.
4 comments:
Just great!
Helped me today! Thanks. :)
That was really useful. Thanks
very nice, it also works for me.
Post a Comment