【问题标题】:OSGI knopflerfish missing packages or can not resolve oll oof themOSGI knopflerfish 缺少包或无法全部解决
【发布时间】:2017-03-24 04:41:54
【问题描述】:

我有一个包含一些 jar 依赖项的包,但我不知道为什么,当我运行这个包时,它无法解析来自 slf4j.jar 的包。

这是knopflerfish显示的错误:

WARNING: Prefs file removed in background /root/.java/.userPrefs/prefs.xml
[stderr] ## DEBUG: errors - FrameworkErrorEvent bundle #43
[stderr] ## DEBUG: errors - FrameworkErrorEvent throwable: 
[stderr] org.osgi.framework.BundleException: Bundle#43, unable to resolve: Missing package(s) or can not resolve all of the them:
org.slf4j -- Could not resolve exporting bundle - org.slf4j;version=1.6.1 Bundle[id=29,gen=0].

这是我的bundle manifest

Manifest-Version: 1.0
Bundle-SymbolicName: MapMatching
Export-Package: its.fac.mapmatching.bundle, its.fac.mapmatching.impl, 
 its.fac.mapmatching.thread, its.fac.mapmatching.utils
Bundle-Version: 1.0.4
Bundle-Name: MapMatching
Bundle-ClassPath: .
Bundle-Activator: its.fac.mapmatching.bundle.Activator
Bundle-ManifestVersion: 3
Import-Package: its.fac.mapmatching.services, its.fac.mapmatching.type
 s, its.fac.poti.api.services, org.postgis, org.slf4j, its.fac.mapmatc
 hing.factory, its.fac.poti.api.types, org.osgi.framework, org.osgi.ut
 il.tracker

【问题讨论】:

    标签: java osgi knopflerfish


    【解决方案1】:

    您需要安装一个用于导出包 org.slf4j 的包。我不知道 konpflerfish 中是否有一个标准包。在 Apache karaf 中,我们为此使用 pax-logging。我认为 logback 也可以提供这个。

    【讨论】:

    • 再次感谢 Christian,我已经解决了这个问题,将 jar 添加为内部,而不是外部 jar。
    猜你喜欢
    • 2013-10-22
    • 2012-11-15
    • 1970-01-01
    • 2018-09-29
    • 2016-09-20
    • 1970-01-01
    • 2015-12-20
    • 2012-03-06
    • 1970-01-01
    相关资源
    最近更新 更多