You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Claus Ibsen (Created) (JIRA)" <ji...@apache.org> on 2011/12/20 17:32:30 UTC

[jira] [Created] (ZOOKEEPER-1334) Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed

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

                 Key: ZOOKEEPER-1334
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1334
             Project: ZooKeeper
          Issue Type: Bug
    Affects Versions: 3.4.0
            Reporter: Claus Ibsen


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

eg from 3.3.4
{code}
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>1.2.15</version>
      <scope>compile</scope>
    </dependency>
{code}

Now in 3.4.0 or better you changed to use slf4j also/instead. The maven pom.xml now includes:
{code}
  <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>
{code}

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

The 3.3.4 MANIFEST.MF, import packages
{code}
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)"
{code}

And the 3.4.1 MANIFEST.MF, import packages:
{code}
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)"
{code}

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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Re: [jira] [Commented] (ZOOKEEPER-1334) Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed

Posted by Ted Dunning <te...@gmail.com>.
Won't this go away when we move to a maven build?

On Tue, Dec 20, 2011 at 8:52 AM, Claus Ibsen (Commented) (JIRA) <
jira@apache.org> wrote:

>
>    [
> https://issues.apache.org/jira/browse/ZOOKEEPER-1334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13173301#comment-13173301]
>
> Claus Ibsen commented on ZOOKEEPER-1334:
> ----------------------------------------
>
> The OSGI manifest is hardcoded in your build.xml
> https://svn.apache.org/repos/asf/zookeeper/trunk/build.xml
>
> You would need to add
> {code}
> org.slf4j;version="[1.6,2.0)"
> {code}
>
> To include the slf4j dependency
>
> > Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed
> > -------------------------------------------------------------
> >
> >                 Key: ZOOKEEPER-1334
> >                 URL:
> https://issues.apache.org/jira/browse/ZOOKEEPER-1334
> >             Project: ZooKeeper
> >          Issue Type: Bug
> >    Affects Versions: 3.4.0
> >            Reporter: Claus Ibsen
> >
> > In Zookeeper 3.3.x you use log4j for logging, and the maven dep is
> > eg from 3.3.4
> > {code}
> >     <dependency>
> >       <groupId>log4j</groupId>
> >       <artifactId>log4j</artifactId>
> >       <version>1.2.15</version>
> >       <scope>compile</scope>
> >     </dependency>
> > {code}
> > Now in 3.4.0 or better you changed to use slf4j also/instead. The maven
> pom.xml now includes:
> > {code}
> >   <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>
> > {code}
> > But the META-INF/MANIFEST.MF file in the distribution did not change to
> reflect this.
> > The 3.3.4 MANIFEST.MF, import packages
> > {code}
> > 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)"
> > {code}
> > And the 3.4.1 MANIFEST.MF, import packages:
> > {code}
> > 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)"
> > {code}
> > This makes using zookeeper 3.4.x in OSGi environments not possible, as
> we get NoClassDefFoundException for slf4j classes.
>
> --
> This message is automatically generated by JIRA.
> If you think it was sent incorrectly, please contact your JIRA
> administrators:
> https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>
>
>

[jira] [Commented] (ZOOKEEPER-1334) Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed

Posted by "Mark LoSacco (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-1334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13263619#comment-13263619 ] 

Mark LoSacco commented on ZOOKEEPER-1334:
-----------------------------------------

Another issue I am seeing with the Manifest is that package org.apache.zookeeper.server.persistence is not exported.

{code:xml}
Export-Package: org.apache.zookeeper;version="3.4.3",org.apache.zookee
 per.data;version="3.4.3",org.apache.zookeeper.version;version="3.4.3"
 ,org.apache.zookeeper.server;version="3.4.3",org.apache.zookeeper.ser
 ver.quorum;version="3.4.3"
{code}
                
> Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed
> -------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1334
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1334
>             Project: ZooKeeper
>          Issue Type: Bug
>    Affects Versions: 3.4.0
>            Reporter: Claus Ibsen
>            Assignee: Jean-Baptiste Onofré
>
> In Zookeeper 3.3.x you use log4j for logging, and the maven dep is
> eg from 3.3.4
> {code}
>     <dependency>
>       <groupId>log4j</groupId>
>       <artifactId>log4j</artifactId>
>       <version>1.2.15</version>
>       <scope>compile</scope>
>     </dependency>
> {code}
> Now in 3.4.0 or better you changed to use slf4j also/instead. The maven pom.xml now includes:
> {code}
>   <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>
> {code}
> But the META-INF/MANIFEST.MF file in the distribution did not change to reflect this.
> The 3.3.4 MANIFEST.MF, import packages
> {code}
> 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)"
> {code}
> And the 3.4.1 MANIFEST.MF, import packages:
> {code}
> 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)"
> {code}
> This makes using zookeeper 3.4.x in OSGi environments not possible, as we get NoClassDefFoundException for slf4j classes.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Updated] (ZOOKEEPER-1334) Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed

Posted by "Jean-Baptiste Onofré (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-1334?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jean-Baptiste Onofré updated ZOOKEEPER-1334:
--------------------------------------------

    Attachment: ZOOKEEPER-1334.patch
    
> Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed
> -------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1334
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1334
>             Project: ZooKeeper
>          Issue Type: Bug
>    Affects Versions: 3.4.0
>            Reporter: Claus Ibsen
>            Assignee: Jean-Baptiste Onofré
>         Attachments: ZOOKEEPER-1334.patch
>
>
> In Zookeeper 3.3.x you use log4j for logging, and the maven dep is
> eg from 3.3.4
> {code}
>     <dependency>
>       <groupId>log4j</groupId>
>       <artifactId>log4j</artifactId>
>       <version>1.2.15</version>
>       <scope>compile</scope>
>     </dependency>
> {code}
> Now in 3.4.0 or better you changed to use slf4j also/instead. The maven pom.xml now includes:
> {code}
>   <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>
> {code}
> But the META-INF/MANIFEST.MF file in the distribution did not change to reflect this.
> The 3.3.4 MANIFEST.MF, import packages
> {code}
> 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)"
> {code}
> And the 3.4.1 MANIFEST.MF, import packages:
> {code}
> 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)"
> {code}
> This makes using zookeeper 3.4.x in OSGi environments not possible, as we get NoClassDefFoundException for slf4j classes.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (ZOOKEEPER-1334) Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed

Posted by "Jean-Baptiste Onofré (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-1334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13407951#comment-13407951 ] 

Jean-Baptiste Onofré commented on ZOOKEEPER-1334:
-------------------------------------------------

Just testing ZooKeeper 3.5.0 and it works in Karaf. In Karaf, I have:

Bundle-Vendor = The Apache Software Foundation
Bundle-Name = ZooKeeper Bundle
Bundle-DocURL = http://hadoop.apache.org/zookeeper
Bundle-SymbolicName = org.apache.hadoop.zookeeper
Bundle-Version = 3.5.0
Bundle-License = http://www.apache.org/licenses/LICENSE-2.0.txt
Bundle-ManifestVersion = 2

Import-Package =
        javax.management,
        org.apache.log4j,
        org.osgi.framework;version="[1.4,2.0)",
        org.osgi.util.tracker;version="[1.1,2.0)"
Export-Package =
        org.apache.zookeeper;version=3.5.0,
        org.apache.zookeeper.data;version=3.5.0,
        org.apache.zookeeper.version;version=3.5.0,
        org.apache.zookeeper.server;version=3.5.0,
        org.apache.zookeeper.server.quorum;version=3.5.0

                
> Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed
> -------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1334
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1334
>             Project: ZooKeeper
>          Issue Type: Bug
>    Affects Versions: 3.4.0
>            Reporter: Claus Ibsen
>            Assignee: Jean-Baptiste Onofré
>
> In Zookeeper 3.3.x you use log4j for logging, and the maven dep is
> eg from 3.3.4
> {code}
>     <dependency>
>       <groupId>log4j</groupId>
>       <artifactId>log4j</artifactId>
>       <version>1.2.15</version>
>       <scope>compile</scope>
>     </dependency>
> {code}
> Now in 3.4.0 or better you changed to use slf4j also/instead. The maven pom.xml now includes:
> {code}
>   <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>
> {code}
> But the META-INF/MANIFEST.MF file in the distribution did not change to reflect this.
> The 3.3.4 MANIFEST.MF, import packages
> {code}
> 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)"
> {code}
> And the 3.4.1 MANIFEST.MF, import packages:
> {code}
> 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)"
> {code}
> This makes using zookeeper 3.4.x in OSGi environments not possible, as we get NoClassDefFoundException for slf4j classes.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (ZOOKEEPER-1334) Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed

Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-1334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13504853#comment-13504853 ] 

Patrick Hunt commented on ZOOKEEPER-1334:
-----------------------------------------

To be clear, we are keen on seeing this fixed, however we don't have sufficient experience with osgi to drive this. If you want to see it fixed, something that is known to work in your environment, providing a patch that we can review and commit is the best way to get this addressed.
                
> Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed
> -------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1334
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1334
>             Project: ZooKeeper
>          Issue Type: Bug
>    Affects Versions: 3.4.0
>            Reporter: Claus Ibsen
>            Assignee: Jean-Baptiste Onofré
>         Attachments: ZOOKEEPER-1334.patch
>
>
> In Zookeeper 3.3.x you use log4j for logging, and the maven dep is
> eg from 3.3.4
> {code}
>     <dependency>
>       <groupId>log4j</groupId>
>       <artifactId>log4j</artifactId>
>       <version>1.2.15</version>
>       <scope>compile</scope>
>     </dependency>
> {code}
> Now in 3.4.0 or better you changed to use slf4j also/instead. The maven pom.xml now includes:
> {code}
>   <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>
> {code}
> But the META-INF/MANIFEST.MF file in the distribution did not change to reflect this.
> The 3.3.4 MANIFEST.MF, import packages
> {code}
> 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)"
> {code}
> And the 3.4.1 MANIFEST.MF, import packages:
> {code}
> 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)"
> {code}
> This makes using zookeeper 3.4.x in OSGi environments not possible, as we get NoClassDefFoundException for slf4j classes.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (ZOOKEEPER-1334) Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-1334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13287902#comment-13287902 ] 

Claus Ibsen commented on ZOOKEEPER-1334:
----------------------------------------

Any update on this?
                
> Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed
> -------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1334
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1334
>             Project: ZooKeeper
>          Issue Type: Bug
>    Affects Versions: 3.4.0
>            Reporter: Claus Ibsen
>            Assignee: Jean-Baptiste Onofré
>
> In Zookeeper 3.3.x you use log4j for logging, and the maven dep is
> eg from 3.3.4
> {code}
>     <dependency>
>       <groupId>log4j</groupId>
>       <artifactId>log4j</artifactId>
>       <version>1.2.15</version>
>       <scope>compile</scope>
>     </dependency>
> {code}
> Now in 3.4.0 or better you changed to use slf4j also/instead. The maven pom.xml now includes:
> {code}
>   <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>
> {code}
> But the META-INF/MANIFEST.MF file in the distribution did not change to reflect this.
> The 3.3.4 MANIFEST.MF, import packages
> {code}
> 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)"
> {code}
> And the 3.4.1 MANIFEST.MF, import packages:
> {code}
> 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)"
> {code}
> This makes using zookeeper 3.4.x in OSGi environments not possible, as we get NoClassDefFoundException for slf4j classes.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (ZOOKEEPER-1334) Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-1334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13407854#comment-13407854 ] 

Claus Ibsen commented on ZOOKEEPER-1334:
----------------------------------------

Any update. Dont the Apache Zookeeper project want to be OSGi compliant? Seems like a fairly easy fix in your ANT build script. 
                
> Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed
> -------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1334
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1334
>             Project: ZooKeeper
>          Issue Type: Bug
>    Affects Versions: 3.4.0
>            Reporter: Claus Ibsen
>            Assignee: Jean-Baptiste Onofré
>
> In Zookeeper 3.3.x you use log4j for logging, and the maven dep is
> eg from 3.3.4
> {code}
>     <dependency>
>       <groupId>log4j</groupId>
>       <artifactId>log4j</artifactId>
>       <version>1.2.15</version>
>       <scope>compile</scope>
>     </dependency>
> {code}
> Now in 3.4.0 or better you changed to use slf4j also/instead. The maven pom.xml now includes:
> {code}
>   <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>
> {code}
> But the META-INF/MANIFEST.MF file in the distribution did not change to reflect this.
> The 3.3.4 MANIFEST.MF, import packages
> {code}
> 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)"
> {code}
> And the 3.4.1 MANIFEST.MF, import packages:
> {code}
> 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)"
> {code}
> This makes using zookeeper 3.4.x in OSGi environments not possible, as we get NoClassDefFoundException for slf4j classes.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Assigned] (ZOOKEEPER-1334) Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed

Posted by "Patrick Hunt (Assigned) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-1334?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Hunt reassigned ZOOKEEPER-1334:
---------------------------------------

    Assignee: Jean-Baptiste Onofré

Jean-Baptiste I'll assign to you then. Thanks. Also take a look at ZOOKEEPER-1078 where we're working on Maven support, I suspect that will impact any changes you make to the current ant based codebase?
                
> Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed
> -------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1334
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1334
>             Project: ZooKeeper
>          Issue Type: Bug
>    Affects Versions: 3.4.0
>            Reporter: Claus Ibsen
>            Assignee: Jean-Baptiste Onofré
>
> In Zookeeper 3.3.x you use log4j for logging, and the maven dep is
> eg from 3.3.4
> {code}
>     <dependency>
>       <groupId>log4j</groupId>
>       <artifactId>log4j</artifactId>
>       <version>1.2.15</version>
>       <scope>compile</scope>
>     </dependency>
> {code}
> Now in 3.4.0 or better you changed to use slf4j also/instead. The maven pom.xml now includes:
> {code}
>   <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>
> {code}
> But the META-INF/MANIFEST.MF file in the distribution did not change to reflect this.
> The 3.3.4 MANIFEST.MF, import packages
> {code}
> 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)"
> {code}
> And the 3.4.1 MANIFEST.MF, import packages:
> {code}
> 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)"
> {code}
> This makes using zookeeper 3.4.x in OSGi environments not possible, as we get NoClassDefFoundException for slf4j classes.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (ZOOKEEPER-1334) Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed

Posted by "Claus Ibsen (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-1334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13173307#comment-13173307 ] 

Claus Ibsen commented on ZOOKEEPER-1334:
----------------------------------------

Benjamin,

Testing OSGi is not super easy, but there is a OSS project called Pax-Exam that has an OSGi based test kit.
We use this for other Apache project such as: Camel, ActiveMQ, etc.

There is a pax exam 2.x release which is even better. We have not yet upgrade from 1.x to 2.x in Camel, as its a bit work to do.
The 2.x should be much faster and allows to do in-jvm debugging etc. The 1.x is slow and it fork a jvm for testing. And it downloads a lot of JARs etc.
http://team.ops4j.org/wiki/display/paxexam/Pax+Exam

That was the reason we discovered this as we upgraded camel-zookeeper from 3.3.4 to 3.4.1 and our osgi based test failed.
The regular junit test passed of course.

At Apache Camel we have 2 kind of osgi tests
- karaf feature test [1]
- osgi unit tests [2]

The former is just a test that the camel components can be installed in an osgi runtime such as Apache Karaf. This test will frankly bootup Apache Karaf and then do an osgi install of the bundles. That way we can often spot 3rd party JARs which is not OSGi compliant.

The latter is real full blown osgi unit tests, where we use the components and do something.

For a quick test, you may in Zookeeper, have the first kind of test, where you will install zookeeper as a bundle in an osgi runtime, such as apache karaf (it can test with using felix, equinox as osgi framework). 



1) - https://svn.apache.org/repos/asf/camel/trunk/tests/camel-itest-karaf/
2) - https://svn.apache.org/repos/asf/camel/trunk/tests/camel-itest-osgi/
                
> Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed
> -------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1334
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1334
>             Project: ZooKeeper
>          Issue Type: Bug
>    Affects Versions: 3.4.0
>            Reporter: Claus Ibsen
>
> In Zookeeper 3.3.x you use log4j for logging, and the maven dep is
> eg from 3.3.4
> {code}
>     <dependency>
>       <groupId>log4j</groupId>
>       <artifactId>log4j</artifactId>
>       <version>1.2.15</version>
>       <scope>compile</scope>
>     </dependency>
> {code}
> Now in 3.4.0 or better you changed to use slf4j also/instead. The maven pom.xml now includes:
> {code}
>   <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>
> {code}
> But the META-INF/MANIFEST.MF file in the distribution did not change to reflect this.
> The 3.3.4 MANIFEST.MF, import packages
> {code}
> 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)"
> {code}
> And the 3.4.1 MANIFEST.MF, import packages:
> {code}
> 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)"
> {code}
> This makes using zookeeper 3.4.x in OSGi environments not possible, as we get NoClassDefFoundException for slf4j classes.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (ZOOKEEPER-1334) Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed

Posted by "Mark LoSacco (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-1334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13263625#comment-13263625 ] 

Mark LoSacco commented on ZOOKEEPER-1334:
-----------------------------------------

Ah - my bad - I see that package org.apache.zookeeper.server.persistence should not be exported.  One of our libs is trying to import this package unnecessarily. 

Please disregard previous comment.
                
> Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed
> -------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1334
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1334
>             Project: ZooKeeper
>          Issue Type: Bug
>    Affects Versions: 3.4.0
>            Reporter: Claus Ibsen
>            Assignee: Jean-Baptiste Onofré
>
> In Zookeeper 3.3.x you use log4j for logging, and the maven dep is
> eg from 3.3.4
> {code}
>     <dependency>
>       <groupId>log4j</groupId>
>       <artifactId>log4j</artifactId>
>       <version>1.2.15</version>
>       <scope>compile</scope>
>     </dependency>
> {code}
> Now in 3.4.0 or better you changed to use slf4j also/instead. The maven pom.xml now includes:
> {code}
>   <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>
> {code}
> But the META-INF/MANIFEST.MF file in the distribution did not change to reflect this.
> The 3.3.4 MANIFEST.MF, import packages
> {code}
> 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)"
> {code}
> And the 3.4.1 MANIFEST.MF, import packages:
> {code}
> 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)"
> {code}
> This makes using zookeeper 3.4.x in OSGi environments not possible, as we get NoClassDefFoundException for slf4j classes.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (ZOOKEEPER-1334) Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed

Posted by "Christian Schneider (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-1334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13486822#comment-13486822 ] 

Christian Schneider commented on ZOOKEEPER-1334:
------------------------------------------------

I found another problem with the Manifest. org.apache.zookeeper.server.ZooKeeperServer depends on org.apache.zookeeper.server.persistence.FileTxnSnapLog but the package is not exported.

So I propose to also export the package:
org.apache.zookeeper.server.persistence


                
> Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed
> -------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1334
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1334
>             Project: ZooKeeper
>          Issue Type: Bug
>    Affects Versions: 3.4.0
>            Reporter: Claus Ibsen
>            Assignee: Jean-Baptiste Onofré
>         Attachments: ZOOKEEPER-1334.patch
>
>
> In Zookeeper 3.3.x you use log4j for logging, and the maven dep is
> eg from 3.3.4
> {code}
>     <dependency>
>       <groupId>log4j</groupId>
>       <artifactId>log4j</artifactId>
>       <version>1.2.15</version>
>       <scope>compile</scope>
>     </dependency>
> {code}
> Now in 3.4.0 or better you changed to use slf4j also/instead. The maven pom.xml now includes:
> {code}
>   <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>
> {code}
> But the META-INF/MANIFEST.MF file in the distribution did not change to reflect this.
> The 3.3.4 MANIFEST.MF, import packages
> {code}
> 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)"
> {code}
> And the 3.4.1 MANIFEST.MF, import packages:
> {code}
> 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)"
> {code}
> This makes using zookeeper 3.4.x in OSGi environments not possible, as we get NoClassDefFoundException for slf4j classes.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (ZOOKEEPER-1334) Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-1334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13504455#comment-13504455 ] 

Claus Ibsen commented on ZOOKEEPER-1334:
----------------------------------------

Any update of this. Christian or Jean it seems the Zookeeper team is not keen on helping with this.
Maybe if we provide a .patch file that they can just apply.

It prevent us from using Zookepper 3.4.x or newer releases in OSGi.
In fact if the Zookeeper team is *NOT* listening to the community, it would be better to remove all the OSGi bits from their MANIFEST.MF file.
Then at least the release is NOT attempting to be OSGi bundles. 

But of course its a fairly easy fix, and we can help test it works fine in OSGi, ... just that the Zookeeper team need to listen to the community.
                
> Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed
> -------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1334
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1334
>             Project: ZooKeeper
>          Issue Type: Bug
>    Affects Versions: 3.4.0
>            Reporter: Claus Ibsen
>            Assignee: Jean-Baptiste Onofré
>         Attachments: ZOOKEEPER-1334.patch
>
>
> In Zookeeper 3.3.x you use log4j for logging, and the maven dep is
> eg from 3.3.4
> {code}
>     <dependency>
>       <groupId>log4j</groupId>
>       <artifactId>log4j</artifactId>
>       <version>1.2.15</version>
>       <scope>compile</scope>
>     </dependency>
> {code}
> Now in 3.4.0 or better you changed to use slf4j also/instead. The maven pom.xml now includes:
> {code}
>   <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>
> {code}
> But the META-INF/MANIFEST.MF file in the distribution did not change to reflect this.
> The 3.3.4 MANIFEST.MF, import packages
> {code}
> 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)"
> {code}
> And the 3.4.1 MANIFEST.MF, import packages:
> {code}
> 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)"
> {code}
> This makes using zookeeper 3.4.x in OSGi environments not possible, as we get NoClassDefFoundException for slf4j classes.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (ZOOKEEPER-1334) Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed

Posted by "Benjamin Reed (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-1334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13173298#comment-13173298 ] 

Benjamin Reed commented on ZOOKEEPER-1334:
------------------------------------------

thanx for reporting this. what would be a good way of testing this bug so that it doesn't happen in the future?
                
> Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed
> -------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1334
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1334
>             Project: ZooKeeper
>          Issue Type: Bug
>    Affects Versions: 3.4.0
>            Reporter: Claus Ibsen
>
> In Zookeeper 3.3.x you use log4j for logging, and the maven dep is
> eg from 3.3.4
> {code}
>     <dependency>
>       <groupId>log4j</groupId>
>       <artifactId>log4j</artifactId>
>       <version>1.2.15</version>
>       <scope>compile</scope>
>     </dependency>
> {code}
> Now in 3.4.0 or better you changed to use slf4j also/instead. The maven pom.xml now includes:
> {code}
>   <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>
> {code}
> But the META-INF/MANIFEST.MF file in the distribution did not change to reflect this.
> The 3.3.4 MANIFEST.MF, import packages
> {code}
> 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)"
> {code}
> And the 3.4.1 MANIFEST.MF, import packages:
> {code}
> 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)"
> {code}
> This makes using zookeeper 3.4.x in OSGi environments not possible, as we get NoClassDefFoundException for slf4j classes.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (ZOOKEEPER-1334) Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed

Posted by "Christian Schneider (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-1334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13486780#comment-13486780 ] 

Christian Schneider commented on ZOOKEEPER-1334:
------------------------------------------------

If you completely switched the code to use the slf4j-api. Then you should not have compile time deps to slf4j-log4j12 and log4j. These should be scope test. For compile scope you should only depend on slf4j-api. In the Manifest you should also only import the slf4j api packages not log4j. Then it will work great in apache karaf.
                
> Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed
> -------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1334
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1334
>             Project: ZooKeeper
>          Issue Type: Bug
>    Affects Versions: 3.4.0
>            Reporter: Claus Ibsen
>            Assignee: Jean-Baptiste Onofré
>         Attachments: ZOOKEEPER-1334.patch
>
>
> In Zookeeper 3.3.x you use log4j for logging, and the maven dep is
> eg from 3.3.4
> {code}
>     <dependency>
>       <groupId>log4j</groupId>
>       <artifactId>log4j</artifactId>
>       <version>1.2.15</version>
>       <scope>compile</scope>
>     </dependency>
> {code}
> Now in 3.4.0 or better you changed to use slf4j also/instead. The maven pom.xml now includes:
> {code}
>   <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>
> {code}
> But the META-INF/MANIFEST.MF file in the distribution did not change to reflect this.
> The 3.3.4 MANIFEST.MF, import packages
> {code}
> 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)"
> {code}
> And the 3.4.1 MANIFEST.MF, import packages:
> {code}
> 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)"
> {code}
> This makes using zookeeper 3.4.x in OSGi environments not possible, as we get NoClassDefFoundException for slf4j classes.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (ZOOKEEPER-1334) Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed

Posted by "Claus Ibsen (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-1334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13173301#comment-13173301 ] 

Claus Ibsen commented on ZOOKEEPER-1334:
----------------------------------------

The OSGI manifest is hardcoded in your build.xml
https://svn.apache.org/repos/asf/zookeeper/trunk/build.xml

You would need to add
{code}
org.slf4j;version="[1.6,2.0)"
{code}

To include the slf4j dependency
                
> Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed
> -------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1334
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1334
>             Project: ZooKeeper
>          Issue Type: Bug
>    Affects Versions: 3.4.0
>            Reporter: Claus Ibsen
>
> In Zookeeper 3.3.x you use log4j for logging, and the maven dep is
> eg from 3.3.4
> {code}
>     <dependency>
>       <groupId>log4j</groupId>
>       <artifactId>log4j</artifactId>
>       <version>1.2.15</version>
>       <scope>compile</scope>
>     </dependency>
> {code}
> Now in 3.4.0 or better you changed to use slf4j also/instead. The maven pom.xml now includes:
> {code}
>   <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>
> {code}
> But the META-INF/MANIFEST.MF file in the distribution did not change to reflect this.
> The 3.3.4 MANIFEST.MF, import packages
> {code}
> 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)"
> {code}
> And the 3.4.1 MANIFEST.MF, import packages:
> {code}
> 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)"
> {code}
> This makes using zookeeper 3.4.x in OSGi environments not possible, as we get NoClassDefFoundException for slf4j classes.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (ZOOKEEPER-1334) Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed

Posted by "Jean-Baptiste Onofré (Commented JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-1334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13223100#comment-13223100 ] 

Jean-Baptiste Onofré commented on ZOOKEEPER-1334:
-------------------------------------------------

Hi guys, I'm gonna work on this issue to "fix" ZooKeeper in an OSGi way.
                
> Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed
> -------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1334
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1334
>             Project: ZooKeeper
>          Issue Type: Bug
>    Affects Versions: 3.4.0
>            Reporter: Claus Ibsen
>
> In Zookeeper 3.3.x you use log4j for logging, and the maven dep is
> eg from 3.3.4
> {code}
>     <dependency>
>       <groupId>log4j</groupId>
>       <artifactId>log4j</artifactId>
>       <version>1.2.15</version>
>       <scope>compile</scope>
>     </dependency>
> {code}
> Now in 3.4.0 or better you changed to use slf4j also/instead. The maven pom.xml now includes:
> {code}
>   <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>
> {code}
> But the META-INF/MANIFEST.MF file in the distribution did not change to reflect this.
> The 3.3.4 MANIFEST.MF, import packages
> {code}
> 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)"
> {code}
> And the 3.4.1 MANIFEST.MF, import packages:
> {code}
> 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)"
> {code}
> This makes using zookeeper 3.4.x in OSGi environments not possible, as we get NoClassDefFoundException for slf4j classes.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (ZOOKEEPER-1334) Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed

Posted by "Jean-Baptiste Onofré (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-1334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13407860#comment-13407860 ] 

Jean-Baptiste Onofré commented on ZOOKEEPER-1334:
-------------------------------------------------

I gonna review and submit a patch if required. Thanks for the reminder Claus.
                
> Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed
> -------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1334
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1334
>             Project: ZooKeeper
>          Issue Type: Bug
>    Affects Versions: 3.4.0
>            Reporter: Claus Ibsen
>            Assignee: Jean-Baptiste Onofré
>
> In Zookeeper 3.3.x you use log4j for logging, and the maven dep is
> eg from 3.3.4
> {code}
>     <dependency>
>       <groupId>log4j</groupId>
>       <artifactId>log4j</artifactId>
>       <version>1.2.15</version>
>       <scope>compile</scope>
>     </dependency>
> {code}
> Now in 3.4.0 or better you changed to use slf4j also/instead. The maven pom.xml now includes:
> {code}
>   <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>
> {code}
> But the META-INF/MANIFEST.MF file in the distribution did not change to reflect this.
> The 3.3.4 MANIFEST.MF, import packages
> {code}
> 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)"
> {code}
> And the 3.4.1 MANIFEST.MF, import packages:
> {code}
> 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)"
> {code}
> This makes using zookeeper 3.4.x in OSGi environments not possible, as we get NoClassDefFoundException for slf4j classes.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (ZOOKEEPER-1334) Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed

Posted by "Jean-Baptiste Onofré (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-1334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13407962#comment-13407962 ] 

Jean-Baptiste Onofré commented on ZOOKEEPER-1334:
-------------------------------------------------

However:
- slf4j import should be present (and optional)
- log4j import should be optional
                
> Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed
> -------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1334
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1334
>             Project: ZooKeeper
>          Issue Type: Bug
>    Affects Versions: 3.4.0
>            Reporter: Claus Ibsen
>            Assignee: Jean-Baptiste Onofré
>
> In Zookeeper 3.3.x you use log4j for logging, and the maven dep is
> eg from 3.3.4
> {code}
>     <dependency>
>       <groupId>log4j</groupId>
>       <artifactId>log4j</artifactId>
>       <version>1.2.15</version>
>       <scope>compile</scope>
>     </dependency>
> {code}
> Now in 3.4.0 or better you changed to use slf4j also/instead. The maven pom.xml now includes:
> {code}
>   <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>
> {code}
> But the META-INF/MANIFEST.MF file in the distribution did not change to reflect this.
> The 3.3.4 MANIFEST.MF, import packages
> {code}
> 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)"
> {code}
> And the 3.4.1 MANIFEST.MF, import packages:
> {code}
> 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)"
> {code}
> This makes using zookeeper 3.4.x in OSGi environments not possible, as we get NoClassDefFoundException for slf4j classes.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (ZOOKEEPER-1334) Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed

Posted by "Claus Ibsen (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-1334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13174138#comment-13174138 ] 

Claus Ibsen commented on ZOOKEEPER-1334:
----------------------------------------

And if you no longer uses log4j directly in zookeeper, then i suggest to mark its maven dependency as <scope>test</scope>. Then end users of zookeeper who uses maven do not depend on log4j. They may use another logger such as logback or java util logging etc.

Also if so then the import of org.apache.log4j should be removed from the MANIFEST.MF for OSGi end users.
                
> Zookeeper 3.4.x is not OSGi compliant - MANIFEST.MF is flawed
> -------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1334
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1334
>             Project: ZooKeeper
>          Issue Type: Bug
>    Affects Versions: 3.4.0
>            Reporter: Claus Ibsen
>
> In Zookeeper 3.3.x you use log4j for logging, and the maven dep is
> eg from 3.3.4
> {code}
>     <dependency>
>       <groupId>log4j</groupId>
>       <artifactId>log4j</artifactId>
>       <version>1.2.15</version>
>       <scope>compile</scope>
>     </dependency>
> {code}
> Now in 3.4.0 or better you changed to use slf4j also/instead. The maven pom.xml now includes:
> {code}
>   <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>
> {code}
> But the META-INF/MANIFEST.MF file in the distribution did not change to reflect this.
> The 3.3.4 MANIFEST.MF, import packages
> {code}
> 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)"
> {code}
> And the 3.4.1 MANIFEST.MF, import packages:
> {code}
> 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)"
> {code}
> This makes using zookeeper 3.4.x in OSGi environments not possible, as we get NoClassDefFoundException for slf4j classes.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira