sgroschupf/zkclient

make zkclient compile on ZK 3.3.x

Closed this issue · 2 comments

Now, there is the following compilation error.
[javac] /Users/jrao/workspace/zkclient-0.1/src/main/java/org/I0Itec/zkclient/ZkServer.java:127: cannot find symbol
[javac] symbol : constructor Factory(int)
[javac] location: class org.apache.zookeeper.server.NIOServerCnxn.Factory
[javac] _nioFactory = new NIOServerCnxn.Factory(port);
[javac] ^

will provide a patch.

Here is a patch. Need to put in the new ZK jar.

diff --git a/lib/zookeeper-3.2.2.jar b/lib/zookeeper-3.2.2.jar
deleted file mode 100644
index de99db4..0000000
Binary files a/lib/zookeeper-3.2.2.jar and /dev/null differ
diff --git a/src/main/java/org/I0Itec/zkclient/ZkServer.java b/src/main/java/org/I0Itec/zkclient/ZkServer.java
index 2800bda..5b08ba1 100644
--- a/src/main/java/org/I0Itec/zkclient/ZkServer.java
+++ b/src/main/java/org/I0Itec/zkclient/ZkServer.java
@@ -17,6 +17,7 @@ package org.I0Itec.zkclient;

import java.io.File;
import java.io.IOException;
+import java.net.InetSocketAddress;
import java.util.Arrays;

import javax.annotation.PostConstruct;
@@ -124,7 +125,7 @@ public class ZkServer {
private void startSingleZkServer(final int tickTime, final File dataDir, final File dataLogDir, final int port) {
try {
_zk = new ZooKeeperServer(dataDir, dataLogDir, tickTime);

  •        _nioFactory = new NIOServerCnxn.Factory(port);
    
  •        _nioFactory = new NIOServerCnxn.Factory(new InetSocketAddress(port));
         _nioFactory.startup(_zk);
     } catch (IOException e) {
         throw new ZkException("Unable to start single ZooKeeper server.", e);