Run an OSGi engineering error solution in Eclipse

Source: Internet
Author: User

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=unknown
Java.version=1.6.0_35
Java.vendor=sun Microsystems INC.
BootLoader Constants:os=win32, arch=x86_64, Ws=win32, Nl=en_us
Command-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 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: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, hurriedly do as shown;

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=unknown
Java.version=1.6.0_35
Java.vendor=sun Microsystems INC.
BootLoader Constants:os=win32, arch=x86_64, Ws=win32, Nl=en_us
Command-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 0
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.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 0
Org.osgi.framework.BundleException:Could 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.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 more
Root 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, see the prior log entry for the root cause if It exists:
! 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.

It is a depressed panic, and then began a variety of search

Finally found the ultimate solution, that is to add three org.eclipse.equinox.console must be the dependent bundle, respectively:

View Plaincopy to Clipboardprint?
    1. <span style="Font-family:microsoft yahei;font-size:14px;" > Org.apache.felix.gogo.command org.apache.felix.gogo.runtime org.apache.felix.gogo.shell</span >

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:

Also: Add configuration parameters

Run an OSGi engineering error solution in Eclipse

Related Article

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.