[repost ]org.apache.zookeeper.KeeperException$NoNodeException: KeeperErrorCode = NoNode for /hive_zookeeper_namespace/default

original:https://issues.apache.org/jira/browse/HIVE-3461

Following exception is seen from test cases when lock is attempted -

2012-08-26 10:33:33,597 ERROR ZooKeeperHiveLockManager (ZooKeeperHiveLockManager.java:lock(317)) - Serious Zookeeper exception:
org.apache.zookeeper.KeeperException$NoNodeException: KeeperErrorCode = NoNode for /hive_zookeeper_namespace/default
        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:778)
        at org.apache.hadoop.hive.ql.lockmgr.zookeeper.ZooKeeperHiveLockManager.createChild(ZooKeeperHiveLockManager.java:285)
        at org.apache.hadoop.hive.ql.lockmgr.zookeeper.ZooKeeperHiveLockManager.lockPrimitive(ZooKeeperHiveLockManager.java:353)
        at org.apache.hadoop.hive.ql.lockmgr.zookeeper.ZooKeeperHiveLockManager.lock(ZooKeeperHiveLockManager.java:303)
        at org.apache.hadoop.hive.ql.lockmgr.zookeeper.ZooKeeperHiveLockManager.lock(ZooKeeperHiveLockManager.java:220)
        at org.apache.hadoop.hive.ql.Driver.acquireReadWriteLocks(Driver.java:828)
        at org.apache.hadoop.hive.ql.Driver.run(Driver.java:944)
        at org.apache.hadoop.hive.ql.QTestUtil.runLoadCmd(QTestUtil.java:458)
        at org.apache.hadoop.hive.ql.QTestUtil.createSources(QTestUtil.java:505)
        at org.apache.hadoop.hive.cli.TestCliDriver.<clinit>(TestCliDriver.java:55)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:169)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:374)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1060)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:911)

---> Solution:
The root cause of the problem is that zookeeper has issues when ipv6 is used on windows. (fix available in JDK 1.7 http://bugs.sun.com/view_bug.do?bug_id=6230761)
 To work around this issue, set -Djava.net.preferIPv4Stack=true .