Usually, this exception means that the server closed the socket. Are you seeing anything strange in the server log?
The null pointer exception is coming from the code that parses the hostPort list. Since you are running in standalone mode your hostPort should be a string of the form host:port. The relevant code is the following: String hostsList[] = hosts.split(","); for (String host : hostsList) { int port = 2181; String parts[] = host.split(":"); // LINE 218 It would seem that host is null, but I'm at a complete loss for how that could be... ben On Friday 23 May 2008 07:27:11 Juan Ramirez wrote: > I see this sometimes as well: > > java.lang.RuntimeException: Unreasonable length = -183042030 > at > com.yahoo.jute.BinaryInputArchive.readBuffer(BinaryInputArchive.java:101) > at > com.yahoo.zookeeper.proto.ConnectResponse.deserialize(ConnectResponse.java: >59) at > com.yahoo.zookeeper.ClientCnxn$SendThread.readConnectResult(ClientCnxn.java >:400) at > com.yahoo.zookeeper.ClientCnxn$SendThread.doIO(ClientCnxn.java:492) > at > com.yahoo.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:705) > > Juan Ramirez wrote: > > Forgot to mention, I am using the zookeeper-2.2.0.jar distribution. > > > > Juan Ramirez wrote: > >> Hi, I am trying to become familiar with the zookeeper API and am seeing > >> the following exceptions when attempting to create a node; any pointers > >> as to where to look for their cause would be greatly appreciated. > >> > >> AFAIK, I am not doing anything special. I am running ZK standalone > >> using JDK 1.6 and attempting to connect to it and create some nodes. > >> Other than dataDir, I am using the configuration values in > >> zoo_sample.cfg. My attempt to create the nodes succeed sometimes, but > >> more often than not, I get some fashion of "Session Expired" errors. I > >> am following com.yahoo.zookeeper.ZooKeeper.main() example and using > >> 5000ms for the client-side sessionTimeout. Thanks in advance. > >> > >> These happen in sequence: > >> > >> java.io.IOException: TIMED OUT > >> at > >> com.yahoo.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:666) > >> com.yahoo.zookeeper.KeeperException: KeeperErrorCode = ConnectionLoss > >> for /locks/ > >> at com.yahoo.zookeeper.ZooKeeper.create(ZooKeeper.java:244) > >> at zookeeperclient.Main$Process.tryCreate(Main.java:142) > >> at zookeeperclient.Main$Process.<init>(Main.java:87) > >> at zookeeperclient.Main.main(Main.java:43) > >> > >> java.io.IOException: Read error rc = -1 java.nio.DirectByteBuffer[pos=0 > >> lim=4 cap=4] > >> at > >> com.yahoo.zookeeper.ClientCnxn$SendThread.doIO(ClientCnxn.java:484) > >> at > >> com.yahoo.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:705) > >> > >> java.lang.NullPointerException > >> at com.yahoo.zookeeper.ClientCnxn.<init>(ClientCnxn.java:218) > >> at com.yahoo.zookeeper.ClientCnxn.<init>(ClientCnxn.java:194) > >> at com.yahoo.zookeeper.ZooKeeper.<init>(ZooKeeper.java:123) > >> at zookeeperclient.Main$Process.tryCreate(Main.java:151) > >> at zookeeperclient.Main$Process.<init>(Main.java:87) > >> at zookeeperclient.Main.main(Main.java:43) > >> com.yahoo.zookeeper.KeeperException: KeeperErrorCode = SessionExpired > >> for /locks/ > >> at com.yahoo.zookeeper.ZooKeeper.create(ZooKeeper.java:244) > >> at zookeeperclient.Main$Process.tryCreate(Main.java:142) > >> at zookeeperclient.Main$Process.<init>(Main.java:87) > >> at zookeeperclient.Main.main(Main.java:43) > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by: Microsoft > > Defy all challenges. Microsoft(R) Visual Studio 2008. > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > _______________________________________________ > > Zookeeper-user mailing list > > Zookeeper-user@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/zookeeper-user > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Zookeeper-user mailing list > Zookeeper-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/zookeeper-user ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Zookeeper-user mailing list Zookeeper-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/zookeeper-user