OSGi Bundle helloworld所遇到问题

来源:互联网 发布:linux中安装maven 编辑:程序博客网 时间:2024/05/15 02:57

OSGi Bundle之Hello World

http://developer.51cto.com/art/200909/152209.htm


按照这篇文章介绍的helloworld在eclipse上跑osgi发现报错,去掉配置项的-console后可以跑起helloworld

但是肯定是需要这个控制台的,带上控制台发现报错如下:


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:297)

at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)

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:601)

at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)

at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)

at org.eclipse.equinox.launcher.Main.run(Main.java:1438)

at org.eclipse.equinox.launcher.Main.main(Main.java:1414)


经测试需要引入org.eclipse.equinox.console包,再次运行又报错:


org.osgi.framework.BundleException: The bundle "org.eclipse.equinox.console_1.0.0.v20120522-1841 [11]" could 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.resume(AbstractBundle.java:390)

at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1177)

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 2013-05-19 00:43:53.968

!MESSAGE Bundle initial@reference:file:plugins/org.eclipse.equinox.console_1.0.0.v20120522-1841.jar was not resolved.


!ENTRY org.eclipse.osgi 4 0 2013-05-19 00:43:53.972

!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:297)

at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)

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:601)

at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)

at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)

at org.eclipse.equinox.launcher.Main.run(Main.java:1438)

at org.eclipse.equinox.launcher.Main.main(Main.java:1414)

Caused by: org.osgi.framework.BundleException: The bundle "org.eclipse.equinox.console_1.0.0.v20120522-1841 [11]" could 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 more

Root exception:

org.osgi.framework.BundleException: The bundle "org.eclipse.equinox.console_1.0.0.v20120522-1841 [11]" could 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)

at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:297)

at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)

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:601)

at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)

at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)

at org.eclipse.equinox.launcher.Main.run(Main.java:1438)

at org.eclipse.equinox.launcher.Main.main(Main.java:1414)


这时需要引入

org.apache.felix.gogo.command
org.apache.felix.gogo.runtime

org.apache.felix.gogo.shell

问题解决!


原创粉丝点击