Today, in the course of learning OSGi, the first HelloWorld plug-in project was built as described in the book, and the following error occurred during the running process:
! SESSION 2014-06-09 21:04:49.038-----------------------------------------------eclipse.buildid= Unknownjava.version=1.6.0_35java.vendor=sun Microsystems Inc.bootloader Constants:os=win32, ARCH=x86_64, WS=win32, Nl=en_uscommand-line arguments:-dev file:e:/xjtu/.metadata/.plugins/org.eclipse.pde.core/hello OSGI/ Dev.properties-os Win32-ws Win32-arch x86_64-consolelog-console! ENTRY Org.eclipse.osgi 4 0 2014-06-09 21:04:49.616! MESSAGE Could not find bundle:org.eclipse.equinox.console! STACK 0org.osgi.framework.bundleexception:could not find bundle:org.eclipse.equinox.console at Org.eclipse.osgi.fram Ework.internal.core.ConsoleManager.checkForConsoleBundle (consolemanager.java:211) at Org.eclipse.core.runtime.adaptor.EclipseStarter.startup (eclipsestarter.java:298) at Org.eclipse.core.runtime.adaptor.EclipseStarter.run (eclipsestarter.java:177) at SUN.REFLECT.NATIVEMETHODACCESSORIMPL.INVOKE0 (Native Method) at Sun.reflect.NativeMethodAccessorImpl.invoke ( Nativemethodaccessorimpl.java:39) at Sun.reflect.DelegatingMethodAccessorImpl.invoke (delegatingmethodaccessorimpl.java:25) at Java.lang.reflect.Method.invoke (method.java:597) at Org.eclipse.equinox.launcher.Main.invokeFramework (Main.java : 636) at Org.eclipse.equinox.launcher.Main.basicRun (main.java:591) at Org.eclipse.equinox.launcher.Main.run ( main.java:1450) at Org.eclipse.equinox.launcher.Main.main (main.java:1426)
So Google found on the internet need to introduce org.eclipse.equinox.console this bundle, quickly, as shown in
I thought I could do it, and behold ..., see below (Waiting for me is more exception)
! SESSION 2014-06-09 21:09:17.097-----------------------------------------------eclipse.buildid= Unknownjava.version=1.6.0_35java.vendor=sun Microsystems Inc.bootloader Constants:os=win32, ARCH=x86_64, WS=win32, Nl=en_uscommand-line arguments:-dev file:e:/xjtu/.metadata/.plugins/org.eclipse.pde.core/hello OSGI/ Dev.properties-os Win32-ws Win32-arch x86_64-consolelog-console! ENTRY org.eclipse.equinox.console 4 0 2014-06-09 21:09:17.725! MESSAGE frameworkevent error! STACK 0org.osgi.framework.bundleexception:the Bundle "org.eclipse.equinox.console_1.0.100.v20130429-0953 [6]" could Not being resolved. Reason:missing Constraint:import-package:org.apache.felix.service.command; version= "0.8.0" at Org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError (Abstractbundle.java : 1332) at Org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException ( abstractbundle.java:1316) at Org.eclipse.osgi.framework.internal.core.BundleHost.startWorker (Bundlehost.java:323) at Org.eclipse.osgi.framework.internal.core.AbstractBundle.resume (abstractbundle.java:390) at Org.eclipse.osgi.framework.internal.core.Framework.resumeBundle (framework.java:1176) at Org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles (startlevelmanager.java:559) at Org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles (startlevelmanager.java:544) at Org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL (startlevelmanager.java:457) at Org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel (startlevelmanager.java:243) at Org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent (startlevelmanager.java:438) at Org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent (startlevelmanager.java:1) at Org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent (eventmanager.java:230) at Org.eclipse.osgi.framework.eventmgr.eventmanager$eventthread.run (eventmanager.java:340)! ENTRY Org.eclipse.osgi 4 0 2014-06-09 21:09:17.725! MESSAGE Bundle [Email protected]:file:plugins/org.eclipse.equinox.console_1.0.100.v20130429-0953.jar is not resolved.! ENTRY Org.eclipse.osgi 4 0 2014-06-09 21:09:17.725! MESSAGE Could Not start bundle:org.eclipse.equinox.console! STACK 0org.osgi.framework.bundleexception:could not start bundle:org.eclipse.equinox.console at Org.eclipse.osgi.fra Mework.internal.core.ConsoleManager.checkForConsoleBundle (consolemanager.java:217) at Org.eclipse.core.runtime.adaptor.EclipseStarter.startup (eclipsestarter.java:298) at Org.eclipse.core.runtime.adaptor.EclipseStarter.run (eclipsestarter.java:177) at SUN.REFLECT.NATIVEMETHODACCESSORIMPL.INVOKE0 (Native Method) at Sun.reflect.NativeMethodAccessorImpl.invoke ( nativemethodaccessorimpl.java:39) at Sun.reflect.DelegatingMethodAccessorImpl.invoke ( DELEGATINGMETHODACCESSORIMPL.JAVA:25) at Java.lang.reflect.Method.invoke (method.java:597) at Org.eclipse.eqUinox.launcher.Main.invokeFramework (main.java:636) at Org.eclipse.equinox.launcher.Main.basicRun (main.java:591) At Org.eclipse.equinox.launcher.Main.run (main.java:1450) at Org.eclipse.equinox.launcher.Main.main (main.java:1426 ) caused by:org.osgi.framework.BundleException:The bundle "org.eclipse.equinox.console_1.0.100.v20130429-0953 [6]" Could not being resolved. Reason:missing Constraint:import-package:org.apache.felix.service.command; version= "0.8.0" at Org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError (Abstractbundle.java : 1332) at Org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException ( abstractbundle.java:1316) at Org.eclipse.osgi.framework.internal.core.BundleHost.startWorker (bundlehost.java:323 ) at Org.eclipse.osgi.framework.internal.core.AbstractBundle.start (abstractbundle.java:300) at Org.eclipse.osgi.framework.internal.core.ConsoleManager.checkForConsoleBundle (consolemanager.java:215) ... Ten MorerooT exception:org.osgi.framework.BundleException:The bundle "org.eclipse.equinox.console_1.0.100.v20130429-0953 [6]" Could not being resolved. Reason:missing Constraint:import-package:org.apache.felix.service.command; version= "0.8.0" at Org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError (Abstractbundle.java : 1332) at Org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException ( abstractbundle.java:1316) at Org.eclipse.osgi.framework.internal.core.BundleHost.startWorker (bundlehost.java:323 ) at Org.eclipse.osgi.framework.internal.core.AbstractBundle.start (abstractbundle.java:300) at Org.eclipse.osgi.framework.internal.core.ConsoleManager.checkForConsoleBundle (consolemanager.java:215) at Org.eclipse.core.runtime.adaptor.EclipseStarter.startup (eclipsestarter.java:298) at Org.eclipse.core.runtime.adaptor.EclipseStarter.run (eclipsestarter.java:177) at SUN.REFLECT.NATIVEMETHODACCESSORIMPL.INVOKE0 (Native Method) at Sun.refleCt. Nativemethodaccessorimpl.invoke (nativemethodaccessorimpl.java:39) at Sun.reflect.DelegatingMethodAccessorImpl.invoke (DELEGATINGMETHODACCESSORIMPL.JAVA:25) at Java.lang.reflect.Method.invoke (method.java:597) at Org.eclipse.equinox.launcher.Main.invokeFramework (Main.java : 636) at Org.eclipse.equinox.launcher.Main.basicRun (main.java:591) at Org.eclipse.equinox.launcher.Main.run ( main.java:1450) at Org.eclipse.equinox.launcher.Main.main (main.java:1426)! ENTRY Org.eclipse.osgi 2 0 2014-06-09 21:09:17.735! MESSAGE one or more bundles is not resolved because the following root constraints is not resolved:! Subentry 1 Org.eclipse.osgi 2 0 2014-06-09 21:09:17.735! MESSAGE Bundle [Email protected]:file:plugins/org.eclipse.equinox.console_1.0.100.v20130429-0953.jar is not resolved.! Subentry 2 org.eclipse.equinox.console 2 0 2014-06-09 21:09:17.735! MESSAGE Missing Imported Package org.apache.felix.service.command_0.8.0.! ENTRY Org.eclipse.osgi 2 0 2014-06-09 21:09:17.745! MESSAge The following is a complete list of bundles which be not resolved and see the prior log entry for the root cause if it E xists:! Subentry 1 Org.eclipse.osgi 2 0 2014-06-09 21:09:17.745! MESSAGE Bundle org.eclipse.equinox.console_1.0.100.v20130429-0953 [6] was not resolved.! Subentry 2 org.eclipse.equinox.console 2 0 2014-06-09 21:09:17.745! MESSAGE Missing Imported Package org.apache.felix.service.command_0.8.0.! Subentry 2 org.eclipse.equinox.console 2 0 2014-06-09 21:09:17.745! MESSAGE Missing Optionally imported package org.osgi.service.cm_0.0.0.
is really depressed panic, and then began various search ...
Finally found the ultimate solution, that is to add three org.eclipse.equinox.console must be the dependent bundle, respectively:
Org.apache.felix.gogo.command
Org.apache.felix.gogo.runtime
Org.apache.felix.gogo.shell
to summarize: When the run Times is wrong, only the selection of Org.eclipse.equinox.console will still error, when there is a dependency between OSGi formation, to use Org.eclipse.equinox.console must have an OSGi build that it needs to rely on, so when debugging, choose the three bundles above, in addition to choosing the OSGi build that you wrote. It seems that this problem was not dropped in previous versions of Eclipse, presumably after further refactoring. In short, this way you can run smoothly.
To enter the SS command at the osgi> prompt, you can see the following details:
You can see that the HelloWorld bundle has been installed and parsed, but it hasn't started yet (this is because I set the not auto start);
After you enter start 1 at the osgi> prompt, and then again SS, you will find that the HelloWorld bundle has started (ACTIVE).