我是新来的Zookeeper编程。我正在尝试使用zookeeper实现生成使用者队列。初始化队列时出现异常。在我的zookeeper中,只有根条目是[zookeeper]。
我正在尝试执行给定的代码。http://zookeeper.apache.org/doc/r3.3.3/zookeepertutorial.html#sc_producerconsumerqueues (不在此处粘贴代码以保持帖子整洁)
例外情况:
org.apache.zookeeper.KeeperException$NoNodeException: KeeperErrorCode = NoNode for /app1
at org.apache.zookeeper.KeeperException.create(KeeperException.java:111)
at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
at org.apache.zookeeper.ZooKeeper.create(ZooKeeper.java:783)
at Queue.<init>(Queue.java:27)
at Queue.main(Queue.java:90)
Can any one advice me on this?
Thanks
1条答案
按热度按时间3lxsmp7m1#
当父节点(“/root”)不存在而未创建时,您尝试创建子节点(例如“/root/child”)。检查是否已创建父节点。