我有一个带有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

最佳答案

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

09-26 20:12
查看更多