nosuchmethoderror:defaultkryofactory-在尝试运行storm starter项目拓扑时

p5cysglq  于 2021-06-21  发布在  Storm
关注(0)|答案(1)|浏览(301)

为了试用storm starter示例,我按照本页的说明进行操作-https://github.com/apache/incubator-storm/tree/master/examples/storm-starter
按照说明操作后,当我运行命令-
mvn编译exec:java -dstorm.topology=storm.starter.exclamationtopology
这就产生了一个错误-
java.lang.classnotfoundexception:org.apache.zookeeper.server.nioservercnxn$工厂
这是因为类在zookeeper 3.4.x版本中被重命名。我根据这个讨论主题更改了依赖项-http://mail-archives.apache.org/mod_mbox/storm-user/201403.mbox/%3c53162e6b01fe029000391290_0_83060@p057%3e
现在,当我运行上面的mvn命令时,我得到的错误跟踪如下:

4749 [Thread-9] INFO  com.netflix.curator.framework.imps.CuratorFrameworkImpl - Starting
4765 [Thread-9-EventThread] INFO  backtype.storm.zookeeper - Zookeeper state update: :connected:none
4774 [Thread-9] INFO  com.netflix.curator.framework.imps.CuratorFrameworkImpl - Starting
4969 [Thread-9] ERROR backtype.storm.daemon.worker - Error on initialization of server mk-worker
java.lang.NoSuchMethodError: backtype.storm.serialization.DefaultKryoFactory$KryoSerializableDefault.setReferences(Z)V
    at backtype.storm.serialization.DefaultKryoFactory.getKryo(DefaultKryoFactory.java:49) ~[storm-core-0.9.1-incubating.jar:0.9.1-incubating]
    at backtype.storm.serialization.SerializationFactory.getKryo(SerializationFactory.java:51) ~[storm-core-0.9.1-incubating.jar:0.9.1-incubating]
    at backtype.storm.serialization.KryoValuesDeserializer.<init>(KryoValuesDeserializer.java:33) ~[storm-core-0.9.1-incubating.jar:0.9.1-incubating]
    at backtype.storm.serialization.KryoTupleDeserializer.<init>(KryoTupleDeserializer.java:39) ~[storm-core-0.9.1-incubating.jar:0.9.1-incubating]
    at backtype.storm.daemon.executor$mk_executor_data$fn__2099.invoke(executor.clj:211) ~[classes/:na]
    at backtype.storm.util$assoc_apply_self.invoke(util.clj:792) ~[classes/:0.9.1-incubating]
    at backtype.storm.daemon.executor$mk_executor_data.invoke(executor.clj:211) ~[classes/:na]
    at backtype.storm.daemon.executor$mk_executor.invoke(executor.clj:316) ~[classes/:na]
    at backtype.storm.daemon.worker$fn__2575$exec_fn__1083__auto____2576$iter__2581__2585$fn__2586.invoke(worker.clj:375) ~[classes/:na]
    at clojure.lang.LazySeq.sval(LazySeq.java:42) ~[clojure-1.4.0.jar:na]
    at clojure.lang.LazySeq.seq(LazySeq.java:60) ~[clojure-1.4.0.jar:na]
    at clojure.lang.RT.seq(RT.java:473) ~[clojure-1.4.0.jar:na]
    at clojure.core$seq.invoke(core.clj:133) ~[clojure-1.4.0.jar:na]
    at clojure.core$dorun.invoke(core.clj:2725) ~[clojure-1.4.0.jar:na]
    at clojure.core$doall.invoke(core.clj:2741) ~[clojure-1.4.0.jar:na]
    at backtype.storm.daemon.worker$fn__2575$exec_fn__1083__auto____2576.invoke(worker.clj:375) ~[classes/:na]
    at clojure.lang.AFn.applyToHelper(AFn.java:185) ~[clojure-1.4.0.jar:na]
    at clojure.lang.AFn.applyTo(AFn.java:151) ~[clojure-1.4.0.jar:na]
    at clojure.core$apply.invoke(core.clj:601) ~[clojure-1.4.0.jar:na]
    at backtype.storm.daemon.worker$fn__2575$mk_worker__2631.doInvoke(worker.clj:344) ~[classes/:na]
    at clojure.lang.RestFn.invoke(RestFn.java:512) ~[clojure-1.4.0.jar:na]
    at backtype.storm.daemon.supervisor$fn__3060.invoke(supervisor.clj:504) ~[classes/:na]
    at clojure.lang.MultiFn.invoke(MultiFn.java:177) ~[clojure-1.4.0.jar:na]
    at backtype.storm.daemon.supervisor$sync_processes$iter__2918__2922$fn__2923.invoke(supervisor.clj:264) ~[classes/:na]
    at clojure.lang.LazySeq.sval(LazySeq.java:42) ~[clojure-1.4.0.jar:na]
    at clojure.lang.LazySeq.seq(LazySeq.java:60) ~[clojure-1.4.0.jar:na]
    at clojure.lang.RT.seq(RT.java:473) ~[clojure-1.4.0.jar:na]
    at clojure.core$seq.invoke(core.clj:133) ~[clojure-1.4.0.jar:na]
    at clojure.core$dorun.invoke(core.clj:2725) ~[clojure-1.4.0.jar:na]
    at clojure.core$doall.invoke(core.clj:2741) ~[clojure-1.4.0.jar:na]
    at backtype.storm.daemon.supervisor$sync_processes.invoke(supervisor.clj:252) ~[classes/:na]
    at clojure.lang.AFn.applyToHelper(AFn.java:161) ~[clojure-1.4.0.jar:na]
    at clojure.lang.AFn.applyTo(AFn.java:151) ~[clojure-1.4.0.jar:na]
    at clojure.core$apply.invoke(core.clj:603) ~[clojure-1.4.0.jar:na]
    at clojure.core$partial$fn__4070.doInvoke(core.clj:2343) ~[clojure-1.4.0.jar:na]
    at clojure.lang.RestFn.invoke(RestFn.java:397) ~[clojure-1.4.0.jar:na]
    at backtype.storm.event$event_manager$fn__747.invoke(event.clj:39) ~[classes/:0.9.1-incubating]
    at clojure.lang.AFn.run(AFn.java:24) ~[clojure-1.4.0.jar:na]
    at java.lang.Thread.run(Thread.java:701) ~[na:1.6.0_30]
4999 [Thread-9] INFO  backtype.storm.util - Halting process: ("Error on initialization")

下面是pom.xml属性当前的设置方式。

<properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <test.extra.args>-Djava.net.preferIPv4Stack=true</test.extra.args>

        <!-- dependency versions -->
        <clojure.version>1.4.0</clojure.version>
        <compojure.version>1.1.3</compojure.version>
        <hiccup.version>0.3.6</hiccup.version>
        <commons-io.verson>2.4</commons-io.verson>
        <commons-lang.version>2.5</commons-lang.version>
        <commons-exec.version>1.1</commons-exec.version>
        <clj-time.version>0.4.1</clj-time.version>
        <curator.version>1.0.1</curator.version>
        <json-simple.version>1.1</json-simple.version>
        <ring.version>0.3.11</ring.version>
        <clojure.tools.logging.version>0.2.3</clojure.tools.logging.version>
        <clojure.math.numeric-tower.version>0.0.1</clojure.math.numeric-tower.version>
        <carbonite.version>1.4.0</carbonite.version>
        <snakeyaml.version>1.11</snakeyaml.version>
        <httpclient.version>4.1.1</httpclient.version>
        <clojure.tools.cli.version>0.2.2</clojure.tools.cli.version>
        <disruptor.version>2.10.1</disruptor.version>
        <jgrapht.version>0.9.0</jgrapht.version>
        <guava.version>13.0</guava.version>
        <logback-classic.version>1.0.6</logback-classic.version>
        <log4j-over-slf4j.version>1.6.6</log4j-over-slf4j.version>
        <netty.version>3.6.3.Final</netty.version>
        <clojure.tools.nrepl.version>0.2.3</clojure.tools.nrepl.version>
        <clojure-complete.version>0.2.3</clojure-complete.version>
        <mockito.version>1.9.5</mockito.version>
        <reply.version>0.3.0</reply.version>
        <zookeeper.version>3.3.3</zookeeper.version>

    </properties>

我还没有找到任何线程建议解决这个defaultkryofactory错误。如有任何提示,我们将不胜感激。

qlvxas9a

qlvxas9a1#

添加以下依赖项

<dependency>
<groupId>storm</groupId>
<artifactId>storm</artifactId>
<version>0.9.1</version>
</dependency>

相关问题