Details
-
Bug
-
Resolution: Fixed
-
None
-
None
-
None
-
Operating System: All
Platform: All
-
normal
-
P1
-
187
Description
I'm working on integrating slf4j 1.6 in an osgi environment and have
hit a stumbling block using the log4j-over-slf4j legacy support.
The bundle exports the org.apache.log4j package using the default
version (0.0.0) this causes problems when client code tries to use
these packages if they declare an explicit import version range - in
our case the imports are:
Import-Package: org.apache.log4j;version=[1.2.14,1.3)
0.0.0 is not in the range 1.2.14->1.3
In my environment I've rebuilt the log4j-over-slf4j bundle with the
following manifest which fixes the problem:
$ cat log4j-over-slf4j/src/main/resources/META-INF/MANIFEST.MF
Implementation-Title: log4j-over-slf4j
Bundle-SymbolicName: log4j.over.slf4j
Bundle-Name: log4j-over-slf4j
Bundle-Vendor: SLF4J.ORG
Export-Package: org.apache.log4j;version=1.2.14
Import-Package: org.slf4j, org.slf4j.helpers, org.slf4j.spi
However I'm just taking a wild guess that 1.2.14 is the version of the
log4j api that this bundle provides.