qq_35908963
2017-04-10 02:55
采纳率: 66.7%
浏览 3.4k
已采纳

kafka和storm集成是报错,找不到jar包

我使用java对kafka和storm集成开发时报错,找不到jar包,可是在网上找了好久也没有找到报错所需要的jar包,请问这是怎么回事?我用的是最土的方法,把jar包全部引入项目里的。
kafka版本是2.9.2-0.8.2.1,storm版本是0.9.7,jdk版本是1.7。
错误日志如下:
9391 [refresh-active-timer] INFO backtype.storm.daemon.worker - All connections are ready for worker 5e95c764-cf8b-4ac9-9c89-911e34720c23:1024 with id b788e814-1915-4116-87ad-1514bc9a201b
9417 [Thread-15-__system] INFO backtype.storm.daemon.executor - Preparing bolt system:(-1)
9428 [Thread-15-
system] INFO backtype.storm.daemon.executor - Prepared bolt system:(-1)
9437 [Thread-17-
acker] INFO backtype.storm.daemon.executor - Preparing bolt acker:(1)
9440 [Thread-17-
acker] INFO backtype.storm.daemon.executor - Prepared bolt acker:(1)
9457 [Thread-11-kafkabolt] INFO backtype.storm.daemon.executor - Preparing bolt kafkabolt:(3)
9465 [Thread-9-bolt] INFO backtype.storm.daemon.executor - Preparing bolt bolt:(2)
9465 [Thread-9-bolt] INFO backtype.storm.daemon.executor - Prepared bolt bolt:(2)
9480 [Thread-13-spout] INFO backtype.storm.daemon.executor - Opening spout spout:(4)
9484 [Thread-13-spout] ERROR backtype.storm.util - Async loop died!
java.lang.NoClassDefFoundError: com/netflix/curator/RetryPolicy
at storm.kafka.KafkaSpout.open(KafkaSpout.java:68) ~[storm-kafka.jar:na]
at backtype.storm.daemon.executor$fn
3371$fn__3386.invoke(executor.clj:529) ~[storm-core-0.9.7.jar:0.9.7]
at backtype.storm.util$async_loop$fn__460.invoke(util.clj:461) ~[storm-core-0.9.7.jar:0.9.7]
at clojure.lang.AFn.run(AFn.java:24) [clojure-1.5.1.jar:na]
at java.lang.Thread.run(Unknown Source) [na:1.7.0_17]
Caused by: java.lang.ClassNotFoundException: com.netflix.curator.RetryPolicy
at java.net.URLClassLoader$1.run(Unknown Source) ~[na:1.7.0_17]
at java.net.URLClassLoader$1.run(Unknown Source) ~[na:1.7.0_17]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.7.0_17]
at java.net.URLClassLoader.findClass(Unknown Source) ~[na:1.7.0_17]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[na:1.7.0_17]
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) ~[na:1.7.0_17]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[na:1.7.0_17]
... 5 common frames omitted
9485 [Thread-13-spout] ERROR backtype.storm.daemon.executor -
java.lang.NoClassDefFoundError: com/netflix/curator/RetryPolicy
at storm.kafka.KafkaSpout.open(KafkaSpout.java:68) ~[storm-kafka.jar:na]
at backtype.storm.daemon.executor$fn__3371$fn__3386.invoke(executor.clj:529) ~[storm-core-0.9.7.jar:0.9.7]
at backtype.storm.util$async_loop$fn__460.invoke(util.clj:461) ~[storm-core-0.9.7.jar:0.9.7]
at clojure.lang.AFn.run(AFn.java:24) [clojure-1.5.1.jar:na]
at java.lang.Thread.run(Unknown Source) [na:1.7.0_17]
Caused by: java.lang.ClassNotFoundException: com.netflix.curator.RetryPolicy
at java.net.URLClassLoader$1.run(Unknown Source) ~[na:1.7.0_17]
at java.net.URLClassLoader$1.run(Unknown Source) ~[na:1.7.0_17]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.7.0_17]
at java.net.URLClassLoader.findClass(Unknown Source) ~[na:1.7.0_17]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[na:1.7.0_17]
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) ~[na:1.7.0_17]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[na:1.7.0_17]
... 5 common frames omitted
9725 [Thread-11-kafkabolt] INFO backtype.storm.daemon.executor - Prepared bolt kafkabolt:(3)
9885 [Thread-13-spout] ERROR backtype.storm.util - Halting process: ("Worker died")
java.lang.RuntimeException: ("Worker died")
at backtype.storm.util$exit_process_BANG_.doInvoke(util.clj:325) [storm-core-0.9.7.jar:0.9.7]
at clojure.lang.RestFn.invoke(RestFn.java:423) [clojure-1.5.1.jar:na]
at backtype.storm.daemon.worker$fn__4694$fn__4695.invoke(worker.clj:495) [storm-core-0.9.7.jar:0.9.7]
at backtype.storm.daemon.executor$mk_executor_data$fn__3272$fn__3273.invoke(executor.clj:241) [storm-core-0.9.7.jar:0.9.7]
at backtype.storm.util$async_loop$fn__460.invoke(util.clj:473) [storm-core-0.9.7.jar:0.9.7]
at clojure.lang.AFn.run(AFn.java:24) [clojure-1.5.1.jar:na]
at java.lang.Thread.run(Unknown Source) [na:1.7.0_17]

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

2条回答 默认 最新

  • qq_35908963 2017-04-11 02:51
    最佳回答

    我自己解决了,是jar包版本引用错误的问题,必须引用curator-framework-1和curator-client-1的版本的jar包,
    2版本以后jar包中的包名是org.org.apache.curator所以无法找到。

    已采纳该答案
    评论
    解决 无用
    打赏 举报
查看更多回答(1条)

相关推荐 更多相似问题