Hey Hema, I'm not too familiar with ZkClient, but I took a look at the code and it seems like there may still be a race condition around reconnects which could cause the NPE you're seeing. I left a comment on the github issue on the slim chance I'm not wrong: https://github.com/sgroschupf/zkclient/issues/25.
-Jason On Thu, Sep 24, 2015 at 10:09 AM, Hema Bhatia <hema.bha...@apollo.edu> wrote: > Can anyone help with the below issue... > Thanks. > > -----Original Message----- > From: Hema Bhatia [mailto:hema.bha...@apollo.edu] > Sent: Tuesday, September 22, 2015 12:57 PM > To: users@kafka.apache.org > Subject: ZkClient throwing NPEs > > Hi, > > I keep getting the below exception when Kafka tries to connect to > zookeeper and zookeeper is momentarily not able to connect. After that, > connection does not restore unless we restart the servers. > > This may be connected to this issue : > https://issues.apache.org/jira/browse/KAFKA-824 But I am already using > zkclient-0.5, and still seeing this issue. > > > java.lang.NullPointerException: null > > at > org.I0Itec.zkclient.ZkConnection.exists(ZkConnection.java:107) > ~[zkclient-0.5.jar:0.5] > > at org.I0Itec.zkclient.ZkClient$3.call(ZkClient.java:631) > ~[zkclient-0.5.jar:0.5] > > at org.I0Itec.zkclient.ZkClient$3.call(ZkClient.java:628) > ~[zkclient-0.5.jar:0.5] > > at > org.I0Itec.zkclient.ZkClient.retryUntilConnected(ZkClient.java:883) > ~[zkclient-0.5.jar:0.5] > > at org.I0Itec.zkclient.ZkClient.exists(ZkClient.java:628) > ~[zkclient-0.5.jar:0.5] > > at org.I0Itec.zkclient.ZkClient.exists(ZkClient.java:637) > ~[zkclient-0.5.jar:0.5] > > at > kafka.admin.AdminUtils$.topicExists(AdminUtils.scala:163) > ~[kafka_2.10-0.8.2.0.jar:na] > > at kafka.admin.AdminUtils.topicExists(AdminUtils.scala) > ~[kafka_2.10-0.8.2.0.jar:na] > > Any ideas of how to solve this issue? > > Thanks, > Hema > >