我正在尝试使用maven在本地模式下使用storm-0.8.1和zookeeper-3.3.3执行wordcount示例。但是,每次运行此命令时,我都会收到以下错误:
mvn exec:java -Dexec.mainClass="com.test.newpackage.TopologyMain" Dexec.args="resource/words.txt
“
我搜索并发现之前我使用的是zookeeper 3.4.5。所以,然后我将我的zookeeper改为3.3.3。但仍然无法执行。如果有人想在我的代码中引用link
INFO com.netflix.curator.framework.imps.CuratorFrameworkImpl - Starting
3706 [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2001] WARN org.apache.zookeeper.server.NIOServerCnxn - EndOfStreamException: Unable to read additional data from client sessionid 0x1401598b305000a, likely client has closed socket
3857 [Thread-6] ERROR backtype.storm.daemon.worker - Error on initialization of server mk-worker
java.lang.IllegalArgumentException: Could not find component common for null
at backtype.storm.utils.ThriftTopologyUtils.getComponentCommon(ThriftTopologyUtils.java:39)
at backtype.storm.task.GeneralTopologyContext.getComponentCommon(GeneralTopologyContext.java:163)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:92)
at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:30)
at backtype.storm.daemon.executor$normalized_component_conf.invoke(executor.clj:136)
at backtype.storm.daemon.executor$executor_data.invoke(executor.clj:159)
at backtype.storm.daemon.executor$mk_executor.invoke(executor.clj:233)
at backtype.storm.daemon.worker$fn__4324$exec_fn__1207__auto____4325$iter__4330__4334$fn__4335.invoke(worker.clj:353)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:60)
at clojure.lang.RT.seq(RT.java:466)
at clojure.core$seq.invoke(core.clj:133)
at clojure.core$dorun.invoke(core.clj:2723)
at clojure.core$doall.invoke(core.clj:2739)
at backtype.storm.daemon.worker$fn__4324$exec_fn__1207__auto____4325.invoke(worker.clj:353)
at clojure.lang.AFn.applyToHelper(AFn.java:185)
at clojure.lang.AFn.applyTo(AFn.java:151)
at clojure.core$apply.invoke(core.clj:600)
at backtype.storm.daemon.worker$fn__4324$mk_worker__4380.doInvoke(worker.clj:322)
at clojure.lang.RestFn.invoke(RestFn.java:512)
at backtype.storm.daemon.supervisor$fn__4783.invoke(supervisor.clj:457)
at clojure.lang.MultiFn.invoke(MultiFn.java:177)
at backtype.storm.daemon.supervisor$sync_processes$iter__4660__4664$fn__4665.invoke(supervisor.clj:247)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:60)
at clojure.lang.RT.seq(RT.java:466)
at clojure.core$seq.invoke(core.clj:133)
at clojure.core$dorun.invoke(core.clj:2723)
at clojure.core$doall.invoke(core.clj:2739)
at backtype.storm.daemon.supervisor$sync_processes.invoke(supervisor.clj:235)
at clojure.lang.AFn.applyToHelper(AFn.java:161)
at clojure.lang.AFn.applyTo(AFn.java:151)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$partial$fn__3794.doInvoke(core.clj:2341)
at clojure.lang.RestFn.invoke(RestFn.java:397)
at backtype.storm.event$event_manager$fn__2484.invoke(event.clj:24)
at clojure.lang.AFn.run(AFn.java:24)
at java.lang.Thread.run(Thread.java:724)
3864 [Thread-6] INFO backtype.storm.util - Halting process: ("Error on initialization")
答案 0 :(得分:0)
根据this discussion,通过重新排序依赖项解决了类似的问题。所以我建议你在依赖列表中移动zookeeper依赖元素。
修改强>
我怀疑您的问题来自类路径订单问题。即多个工件中存在的同一个类,当前加载的违规类的版本是错误的。
要解决此问题,您需要重新排序类路径(您可能知道在类路径中多次出现相同的类时:第一个获胜)。要重新排序类路径,您需要更改pom.xml中声明的顺序(至少从maven 2.0.9开始)
引自maven site:
因为Maven 2.0.9这是声明中的顺序:第一个声明获胜。