Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-345

logging.log4j-1.2-api doesn't export the log4j API 1.2. Dependent bundles can not be resolved.

    Details

      Description

      Hi all Log4j/OSGi experts!

      Yesterday I started to migrate from log4j to log4j2. I replaced all Log4j 1.x bundles with log4j-1.2-api as described here: http://logging.apache.org/log4j/2.x/log4j-1.2-api/index.html

      But I got following error:

      Unresolved constraint in bundle MyBundle [21]: Unable to resolve 21.0: missing requirement [21.0] osgi.wiring.package; (&(osgi.wiring.package=org.apache.log4j)(version>=1.2.0)(!(version>=2.0.0)))

      so...I checked the capabilities of the log4j-1.2-api bundle:

      g! inspect cap * 11
      org.apache.logging.log4j-1.2-api [11] provides:
      -----------------------------------------------
      osgi.wiring.bundle; org.apache.logging.log4j-1.2-api 2.0.0.beta8 [UNUSED]
      osgi.wiring.host; org.apache.logging.log4j-1.2-api 2.0.0.beta8 [UNUSED]

      As you can see logging.log4j-1.2-api doesn't export the log4j API 1.2. It still requires log4j 1.2. All dependent bundles can not be resolved until I add the old log4j.jar.

      The maven-bundle-plugin does not export the packages.

      Roland

        Attachments

        1. 0001-Add-log4j-1.x-OSGi-bundle.patch
          5 kB
          Matt Sicker
        2. log4j2-345-patch-issue.png
          94 kB
          Remko Popma
        3. log4j2 1.2api.patch
          2 kB
          Roland Weiglhofer

          Activity

            People

            • Assignee:
              jvz Matt Sicker
              Reporter:
              rol Roland Weiglhofer
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: