[slf4j-dev] [Bug 75] New: Cyclic dependency in OSGi
bugzilla-daemon at pixie.qos.ch
bugzilla-daemon at pixie.qos.ch
Wed Feb 27 11:26:15 CET 2008
http://bugzilla.slf4j.org/show_bug.cgi?id=75
Summary: Cyclic dependency in OSGi
Product: SLF4J
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P2
Component: Core API
AssignedTo: dev at slf4j.org
ReportedBy: mirkojahn at gmail.com
The API bundle of SLF4j (slf4j-api-1.X.0.jar) exports the API packages and
imports the org.slf4j.impl package. All implementation bundles like LOGBack in
return have to import the API packages and export their impl. of
org.slf4j.impl.* classes. This creates a pretty nasty cycle, although it might
not be necessary to have a concrete implementation available, if logging is not
desired in a particular deployment for instance. For this reason, the import
should be defined as optional:
Import-Package: org.slf4j.impl;version=${project.version};resolution:=optional
OSGi would then look internally (inside the API bundle) for the resources/
classes, where a default Logger could be returned, which is doing nothing.
BTW, the export statements are missing the uses clause and all exports should
be imported as well (see blog entries of Peter Kriens). Here is an example
(generated with Eclipse Manifest-Editor):
Export-Package: org.slf4j;version="1.4.3";uses:="org.slf4j.spi",
org.slf4j.helpers;version="1.4.3";uses:="org.slf4j.spi,org.slf4j",
org.slf4j.spi;version="1.4.3";uses:="org.slf4j"
Import-Package: org.slf4j;version="[1.4.0,2.0.0)",
org.slf4j.helpers;version="[1.4.0,2.0.0)",
org.slf4j.spi;version="[1.4.0,2.0.0)",
org.slf4j.impl;version="[1.4.0,2.0.0)";resolution:=optional
--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the slf4j-dev
mailing list