使用第三方ZKClient 读取Zk数据报错:
Exception in thread "main" org.I0Itec.zkclient.exception.ZkMarshallingError: java.io.EOFException
at org.I0Itec.zkclient.serialize.SerializableSerializer.deserialize(SerializableSerializer.java:37)
at org.I0Itec.zkclient.ZkClient.derializable(ZkClient.java:740)
at org.I0Itec.zkclient.ZkClient.readData(ZkClient.java:773)
at org.I0Itec.zkclient.ZkClient.readData(ZkClient.java:761)
at com.xbq.demo.ZkClientDemo.readData(ZkClientDemo.java:43)
at com.xbq.demo.ZkClientDemo.main(ZkClientDemo.java:30)
Caused by: java.io.EOFException
at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2353)
at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2822)
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:805)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:301)
at org.I0Itec.zkclient.serialize.SerializableSerializer.deserialize(SerializableSerializer.java:31)
... 5 more
主要是序列化问题