ymilky / travel-zoo

Embedded Zookeeper servers and clusters for testing and development, with full Clojure API featuring validation, components, helpers, and more.
Eclipse Public License 1.0
20 stars 2 forks source link

Can't start embedded server, unsure why #3

Open bsima opened 8 years ago

bsima commented 8 years ago
user> (require '[travel-zoo.embedded.server :as server]
            '[travel-zoo.embedded.protocols :refer [start-zk stop-zk restart-zk
                                                   zk-server-info zk-connection-string
                                                   zk-ports zk-temp-directory]])
nil
user> (def zk (server/make-embedded-zookeeper {:port 2181 }))
#'user/zk
user> (start-zk zk)
16-06-01 00:23:43 neb INFO [travel-zoo.embedded.server:20] - Starting Embedded Zookeeper server - 127.0.0.1:2181
IllegalStateException Timed out waiting for watch removal  org.apache.curator.test.TestingZooKeeperMain.blockUntilStarted (TestingZooKeeperMain.java:153)
user> 

This same code works from a REPL in travel-zoo, so it's almost surely something with my project, but I can't figure out what. Is there some additional hard version dependency or configuration that I should be aware of? I've been trying to fix this for way too long now..

raymcdermott commented 8 years ago
(def zk (make-zk-server))
=> #'kafka-proxy.core-test/zk
(start-embedded-zk zk)
16-09-01 18:07:07 Mac.local INFO [travel-zoo.embedded.server:20] - Starting Embedded Zookeeper server - 127.0.0.1:2181
Exception in thread "Thread-8" java.lang.NoSuchFieldError: configFileStr
    at org.apache.curator.test.QuorumConfigBuilder$1.<init>(QuorumConfigBuilder.java:135)
    at org.apache.curator.test.QuorumConfigBuilder.buildConfig(QuorumConfigBuilder.java:130)
    at org.apache.curator.test.TestingZooKeeperServer$1.run(TestingZooKeeperServer.java:149)
    at java.lang.Thread.run(Thread.java:745)
(list-open-ports zk)
IllegalStateException Timed out waiting for watch removal  org.apache.curator.test.TestingZooKeeperMain.blockUntilStarted (TestingZooKeeperMain.java:153)
=> 2181

Running the default functions you suggest using Clojure 1.8 in the REPL - any ideas what I'm doing wrong?

lkonstantinov commented 7 years ago

This is probably coming late for you, but could be useful if someone else is wondering what is going on. The problem is with the transitive dependencies:

[ymilky/travel-zoo "0.0.2"] -> [org.apache.curator/curator-test "3.1.0"] -> [org.apache.zookeeper/zookeeper "3.5.1-alpha" :exclusions [com.sun.jmx/jmxri com.sun.jdmk/jmxtools javax.jms/jms junit org.slf4j/slf4j-log4j12]]

Zookeeper 3.5.1-alpha is the culprit. You'll need to manually downgrade to the correct curator-test, which will bring the proper Zookeeper, like this:

{:dependencies [[ymilky/franzy-embedded "0.0.1"] [ymilky/travel-zoo "0.0.2"] [org.apache.curator/curator-test "3.0.0"]]}