Eclipse OSGi Bundle控制台异常

时间:2015-08-05 12:39:42

标签: eclipse osgi

我正在使用Eclipse Juno来运行OSGi。但是在运行时我无法看到控制台并得到以下错误:

我试图将我的捆绑包作为OSGI框架运行,但我得到了以下输出,我不知道错误在哪里:

!SESSION 2015-08-05 17:54:16.831 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.7.0_65
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Command-line arguments:  -console -configuration runtime

!ENTRY org.eclipse.osgi 4 0 2015-08-05 17:54:17.182
!MESSAGE Could not find bundle: unknown
!STACK 0
org.osgi.framework.BundleException: Could not find bundle: unknown
    at org.eclipse.core.runtime.internal.adaptor.ConsoleManager.checkForConsoleBundle(ConsoleManager.java:58)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:331)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:231)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.main(EclipseStarter.java:208)

!ENTRY org.eclipse.osgi 4 0 2015-08-05 17:54:17.198
!MESSAGE Application error
!STACK 1
java.lang.IllegalStateException: Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resolved and started (see config.ini).
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:78)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.main(EclipseStarter.java:208)

请帮忙。

1 个答案:

答案 0 :(得分:0)

你需要在MANIFEST.MF中公开你的服务,这个文件位于META-INF目录中,你可以使用这个maven插件自动完成这项工作:

http://felix.apache.org/documentation/subprojects/apache-felix-maven-bundle-plugin-bnd.html