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

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

100

我使用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 qq_35908963 2017-04-11 02:51

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

    点赞 评论 复制链接分享
  • qq_35908963 qq_35908963 2017-04-11 02:54

    但是又出现了一个新的问题,集成后作为消费者可以正常发送数据到Bolt中,但是处理结束后会出现一个方法不匹配的错误。
    日志如下:
    16445 [Thread-11-spout] INFO storm.kafka.PartitionManager - Fetched 1 messages from: Partition{host=BAB1501426:9092, partition=0}
    16445 [Thread-11-spout] INFO storm.kafka.PartitionManager - Added 1 messages from: Partition{host=BAB1501426:9092, partition=0} to internal buffers
    hello
    17877 [Thread-11-spout] INFO storm.kafka.PartitionManager - Writing last completed offset (945) to ZK for Partition{host=BAB1501426:9092, partition=0} for topology: f4829af2-2307-4a3d-8db0-8ba3c1df05fb
    17901 [Thread-11-spout] INFO storm.kafka.ZkState - Writing /lingroup/partition_0 the data {topology={id=f4829af2-2307-4a3d-8db0-8ba3c1df05fb, name=Topotest1121}, offset=945, partition=0, broker={host=BAB1501426, port=9092}, topic=linlin}
    17907 [Thread-11-spout] ERROR backtype.storm.util - Async loop died!
    java.lang.RuntimeException: java.lang.ClassCastException: com.netflix.curator.framework.imps.CreateBuilderImpl$4 cannot be cast to com.netflix.curator.framework.api.ACLBackgroundPathAndBytesable
    at storm.kafka.ZkState.writeBytes(ZkState.java:67) ~[storm-kafka.jar:na]
    at storm.kafka.ZkState.writeJSON(ZkState.java:53) ~[storm-kafka.jar:na]
    at storm.kafka.PartitionManager.commit(PartitionManager.java:188) ~[storm-kafka.jar:na]
    at storm.kafka.KafkaSpout.commit(KafkaSpout.java:169) ~[storm-kafka.jar:na]
    at storm.kafka.KafkaSpout.nextTuple(KafkaSpout.java:134) ~[storm-kafka.jar:na]
    at backtype.storm.daemon.executor$fn__3371$fn__3386$fn__3415.invoke(executor.clj:572) ~[storm-core-0.9.7.jar:0.9.7]
    at backtype.storm.util$async_loop$fn__460.invoke(util.clj:463) ~[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.ClassCastException: com.netflix.curator.framework.imps.CreateBuilderImpl$4 cannot be cast to com.netflix.curator.framework.api.ACLBackgroundPathAndBytesable
    at storm.kafka.ZkState.writeBytes(ZkState.java:61) ~[storm-kafka.jar:na]
    ... 8 common frames omitted
    17908 [Thread-11-spout] ERROR backtype.storm.daemon.executor -
    java.lang.RuntimeException: java.lang.ClassCastException: com.netflix.curator.framework.imps.CreateBuilderImpl$4 cannot be cast to com.netflix.curator.framework.api.ACLBackgroundPathAndBytesable
    at storm.kafka.ZkState.writeBytes(ZkState.java:67) ~[storm-kafka.jar:na]
    at storm.kafka.ZkState.writeJSON(ZkState.java:53) ~[storm-kafka.jar:na]
    at storm.kafka.PartitionManager.commit(PartitionManager.java:188) ~[storm-kafka.jar:na]
    at storm.kafka.KafkaSpout.commit(KafkaSpout.java:169) ~[storm-kafka.jar:na]
    at storm.kafka.KafkaSpout.nextTuple(KafkaSpout.java:134) ~[storm-kafka.jar:na]
    at backtype.storm.daemon.executor$fn__3371$fn__3386$fn__3415.invoke(executor.clj:572) ~[storm-core-0.9.7.jar:0.9.7]
    at backtype.storm.util$async_loop$fn__460.invoke(util.clj:463) ~[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.ClassCastException: com.netflix.curator.framework.imps.CreateBuilderImpl$4 cannot be cast to com.netflix.curator.framework.api.ACLBackgroundPathAndBytesable
    at storm.kafka.ZkState.writeBytes(ZkState.java:61) ~[storm-kafka.jar:na]
    ... 8 common frames omitted
    18096 [Thread-11-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]

    点赞 评论 复制链接分享

相关推荐