We’re using ZooKeeper and on macs, tests always fail with a ConnectionLossException. The cause of this problem seems to be the implementation of the IO layer in the Oracle JVM. So, in order to fix it, we had to use OpenJDK – which, in turn, seems to have other issues.
Another way to get it running is to let the test sleep for a while after start up of the server
even though after a while the timeouts in the NIO-API cause NullPointerExceptions:
2012-05-09 10:09:45,684 [WARN ][NIOServerCxn.Factory:/127.0.0.1:2181][org.apache.zookeeper.server.NIOServerCnxnFactory] Ignoring unexpected runtime exception java.lang.NullPointerException