Uploaded image for project: 'SLF4J'
  1. SLF4J
  2. SLF4J-253

Not all packages from log4j-over-slf4j are exported in manifest

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: 1.6.x
    • Fix Version/s: None
    • Component/s: log4j-over-slf4j
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

      Description

      log4j-over-slf4j contains this packages:

      • org.apache.log4j
      • org.apache.log4j.helpers
      • org.apache.log4j.spi
      • org.apache.log4j.xml

      but only exports org.apache.log4j (from [1]):

      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=$

      {log4j.version}
      Import-Package: org.slf4j;version=${slf4j.api.minimum.compatible.version}, org.slf4j.helpers;version=${slf4j.api.minimum.compatible.version}, org.slf4j.spi;version=${slf4j.api.minimum.compatible.version}

      This creates problems in OSGi when some code uses classes from this packages.

      To fix this issues all packages should be exported. Manifest should look like this:

      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=${log4j.version}

      ,org.apache.log4j.helpers;version=$

      {log4j.version},org.apache.log4j.spi;version=${log4j.version}

      ,org.apache.log4j.xml;version=$

      {log4j.version}

      Import-Package: org.slf4j;version=$

      {slf4j.api.minimum.compatible.version}, org.slf4j.helpers;version=${slf4j.api.minimum.compatible.version}

      , org.slf4j.spi;version=$

      {slf4j.api.minimum.compatible.version}

      [1]: https://github.com/ceki/slf4j/blob/master/log4j-over-slf4j/src/main/resources/META-INF/MANIFEST.MF

        Attachments

          Activity

            People

            • Assignee:
              slf4j-dev SLF4J developers list
              Reporter:
              ash2k Mikhail Mazursky
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: