[jira] [Commented] (ZOOKEEPER-2165) OSGi requires package server.quorom.flexible be exported

2015-04-23 Thread Hendrik Spohr (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14508678#comment-14508678
 ] 

Hendrik Spohr commented on ZOOKEEPER-2165:
--

Hi [~michim],

Here is a patch (You need to apply the one I have posted for ZOOKEEPER-1942 
before):
{code}
diff --git a/build.xml b/build.xml
index 559e115..d819eed 100644
--- a/build.xml
+++ b/build.xml
@@ -564,7 +564,7 @@ xmlns:maven=antlib:org.apache.maven.artifact.ant
 attribute name=Bundle-License 
value=http://www.apache.org/licenses/LICENSE-2.0.txt/
 attribute name=Bundle-DocURL 
value=http://hadoop.apache.org/zookeeper/
 attribute name=Import-Package 
value='javax.management;resolution:=optional,javax.security.auth.callback,javax.security.auth.login,javax.security.sasl,org.slf4j;version=[1.6,2),org.jboss.netty.buffer;resolution:=optional;version=[3.2,4),org.jboss.netty.c
-attribute name=Export-Package 
value='org.apache.zookeeper;version=${version},org.apache.zookeeper.client;version=${version},org.apache.zookeeper.data;version=${version},org.apache.zookeeper.version;version=${version},org.apache.zookeeper.server;vers
+attribute name=Export-Package 
value='org.apache.zookeeper;version=${version},org.apache.zookeeper.client;version=${version},org.apache.zookeeper.data;version=${version},org.apache.zookeeper.version;version=${version},org.apache.zookeeper.server;vers
 /manifest
 /jar
 /target
{code}

To test for a OSGi correct MANIFEST: That is not easy IMHO. You could create a 
test with pax-exam or similar an check the the bundles starts up at all (which 
would be not the case for ZOOKEEPER-1942). However a defect as this would not 
be detected. You would ne to write test code that uses the API classes in order 
to verify that client bundles can load them.

 OSGi requires package server.quorom.flexible be exported
 --

 Key: ZOOKEEPER-2165
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2165
 Project: ZooKeeper
  Issue Type: Bug
  Components: quorum
Reporter: Simon Kitching
Priority: Minor

 Class QuoromPeer has a constructor which takes a QuorumVerifier value as a 
 parameter. This class is defined in package 
 org.apache.zookeeper.server.quorum.flexible but that package is not 
 exported.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (ZOOKEEPER-2165) OSGi requires package server.quorom.flexible be exported

2015-04-15 Thread Michi Mutsuzaki (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14495717#comment-14495717
 ] 

Michi Mutsuzaki commented on ZOOKEEPER-2165:


Thank you for the report [~skitching]. Would you like to submit a patch? Also, 
is there a way to verify that we are OSGi compliant as a part of the build? I 
remember having similar issues before.

 OSGi requires package server.quorom.flexible be exported
 --

 Key: ZOOKEEPER-2165
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2165
 Project: ZooKeeper
  Issue Type: Bug
  Components: quorum
Reporter: Simon Kitching
Priority: Minor

 Class QuoromPeer has a constructor which takes a QuorumVerifier value as a 
 parameter. This class is defined in package 
 org.apache.zookeeper.server.quorum.flexible but that package is not 
 exported.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (ZOOKEEPER-2165) OSGi requires package server.quorom.flexible be exported

2015-04-14 Thread Simon Kitching (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14494001#comment-14494001
 ] 

Simon Kitching commented on ZOOKEEPER-2165:
---

The fix is trivial, and affects only top-level file build.xml. The 
MANIFEST.MF is specified in build.xml via a hand-written manifest tag with 
nested attribute entries. The one for ExportPackage needs to be extended to 
include org.apache.zookeeper.server.quorum.flexible.

With the current manifest, an OSGi bundle that tries to use class QuorumPeer 
will automatically try to import package quorum.flexible and fail to resolve. 
This can be worked around by forcing the quorom.flexible to not be imported, 
but that is not very elegant.

Workaround for apps using zookeeper and maven-bundle-plugin:
  Import-Package!org.apache.zookeeper.quorum.flexible, */Import-Package

 OSGi requires package server.quorom.flexible be exported
 --

 Key: ZOOKEEPER-2165
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2165
 Project: ZooKeeper
  Issue Type: Bug
  Components: quorum
Reporter: Simon Kitching
Priority: Minor

 Class QuoromPeer has a constructor which takes a QuorumVerifier value as a 
 parameter. This class is defined in package 
 org.apache.zookeeper.server.quorum.flexible but that package is not 
 exported.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)