ZooKeeper
  1. ZooKeeper
  2. ZOOKEEPER-1334

Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.4.0
    • Fix Version/s: 3.4.6, 3.5.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      In Zookeeper 3.3.x you use log4j for logging, and the maven dep is

      eg from 3.3.4

          <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.15</version>
            <scope>compile</scope>
          </dependency>
      

      Now in 3.4.0 or better you changed to use slf4j also/instead. The maven pom.xml now includes:

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.6.1</version>
            <scope>compile</scope>
          </dependency>
          <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.6.1</version>
            <scope>compile</scope>
          </dependency>
          <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.15</version>
            <scope>compile</scope>
          </dependency>
      

      But the META-INF/MANIFEST.MF file in the distribution did not change to reflect this.

      The 3.3.4 MANIFEST.MF, import packages

      Import-Package: javax.management,org.apache.log4j,org.osgi.framework;v
       ersion="[1.4,2.0)",org.osgi.util.tracker;version="[1.1,2.0)"
      

      And the 3.4.1 MANIFEST.MF, import packages:

      Import-Package: javax.management,org.apache.log4j,org.osgi.framework;v
       ersion="[1.4,2.0)",org.osgi.util.tracker;version="[1.1,2.0)"
      

      This makes using zookeeper 3.4.x in OSGi environments not possible, as we get NoClassDefFoundException for slf4j classes.

      1. ZOOKEEPER-1334.patch
        1 kB
        Jean-Baptiste Onofré
      2. zookeeper-1334-osgi.patch
        2 kB
        Claus Ibsen
      3. zookeeper-1334-osgi.patch
        2 kB
        Patrick Hunt

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              Claus Ibsen
              Reporter:
              Claus Ibsen
            • Votes:
              3 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development