Solution to OSGI engineering error running in kepler of Eclipse

Source: Internet
Author: User

The first helloworld plug-in project was built according to the book during OSGI learning today. The following error occurs 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.framework.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)
Therefore, google needs to introduce the bundle org. eclipse. equinox. console at the same time, as shown in

I thought this could be done, but I don't expect it.... Read the following (wait for me to see more exceptions) <喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> VcD4KPHA + PHByZSBjbGFzcz0 = "brush: java;">! SESSION 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. PDDE. core/Hello OSGI/dev. properties-OS win32-ws win32-arch x86_64-consoleLog-console! ENTRY org. eclipse. equinox. console 4 0 21:09:17. 725! MESSAGE FrameworkEvent ERROR! STACK 0org. osgi. framework. bundleException: The bundle "org. eclipse. equinox. console_1.0.100.v20130429-0953 [6] "cocould not be 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. getResolutio NFailureException (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 (StartLevelMan Ager. 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 (S TartLevelManager. 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 21:09:17. 725! MESSAGE Bundle initial @ reference: file: plugins/org. eclipse. equinox. console_1.0.100.v20130429-0953.jar was not resolved .! ENTRY org. eclipse. osgi 4 0 21:09:17. 725! MESSAGE cocould not start bundle: org. eclipse. equinox. console! STACK 0org. osgi. framework. bundleException: cocould not start bundle: org. eclipse. equinox. console at org. eclipse. osgi. framework. 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. nativeMethodAccessorI Mpl. 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] "cocould not be 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 )... 10 moreRoot exception: org. osgi. framework. bundleException: The bundle "org. eclipse. equinox. console_1.0.100.v20130429-0953 [6] "cocould not be 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. framew Ork. 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. in Voke (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 21:09:17. 735! MESSAGE One or more bundles are not resolved because the following root constraints are not resolved :! SUBENTRY 1 org. eclipse. osgi 2 0 21:09:17. 735! MESSAGE Bundle initial @ reference: file: plugins/org. eclipse. equinox. console_1.0.100.v20130429-0953.jar was not resolved .! SUBENTRY 2 org. eclipse. equinox. console 2 0 21:09:17. 735! MESSAGE Missing imported package org. apache. felix. service. command_0.8.0 .! ENTRY org. eclipse. osgi 2 0 21:09:17. 745! MESSAGE The following is a complete list of bundles which are not resolved, see the prior log entry for the root cause if it exists :! SUBENTRY 1 org. eclipse. osgi 2 0 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 21:09:17. 745! MESSAGE Missing imported package org. apache. felix. service. command_0.8.0 .! SUBENTRY 2 org. eclipse. equinox. console 2 0 21:09:17. 745! MESSAGE Missing optionally imported package org. osgi. service. cm_0.0.0.It was really depressing, so I started a variety of search...

Finally, the final solution is found, that is, add three necessary dependencies bundle for org. eclipse. equinox. console again, which are:

Org. apache. felix. gogo. command

Org. apache. felix. gogo. runtime

Org. apache. felix. gogo. shell

To sum up, only org. eclipse. equinox. the console still reports an error. At that time, because there is a dependency between OSGI components, org. eclipse. equinox. the console must have the OSGI build that it depends on. Therefore, during debugging, in addition to the OSGI build you have prepared, you must select the three bundle above. It seems that this problem has not been solved in the previous Eclipse version. It is estimated that this problem is due to further reconstruction. In short, we can Run smoothly in this way.

Enter the ss Command at the osgi> prompt and you can see the following details:

We can see that the HelloWorld bundle has been installed and parsed, but it has not been started yet (this is because I set it to not automatically start );

Enter start 1 after the osgi> prompt, and then ss again, you will find that helloworld bundle has been started (ACTIVE ).


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.