I am new to zookeeper. I have written simple program to create Persistent Node. Its working but giving exception once execution is completed.I tried to search on google but there is no satisfactory answer. Can any one advice me anything.
public class ZkProg {
public static void main(String[] args) throws IOException, KeeperException, InterruptedException
{
ZooKeeper zk=new ZooKeeper("localhost",1281, null);
zk.create("/zookeeper/Names",new byte[0], Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
//zk.delete("/zookeeper/Names",-1);
zk.close();
}
}
I also had this error being logged. It is because the Zookeeper watcher is null. In the call to the constructor, the third parameter is a watcher:
It seems that the Zookeeper ClientCnxn tries to call process on the watcher, even if it is null. However, it catches the exception and just logs the error and moves on.