Apache storm : Could not load main class org.apache.storm.starter.ExclamationTopology

天涯浪子 提交于 2019-12-12 05:14:58

问题


firstly I already referred quite a few similar questions but still haven't been able to fix it. I have installed nimbus and supervisor properly and there were no errors while "make install" even maven clean install and compile had no errors at all, even my 0qm is set up properly with jzmq, and also started my nimbus by ./storm nimbus and started my supervisor by ./storm supervisor but when I do

./storm jar ~/ccbd-work/storm2/examples/target/storm-starter-topologies-0.10.0.jar org.apache.storm.starter.ExclamationTopology

I get the following error

Running: /usr/lib/jvm/java-7-openjdk-amd64/bin/java -client -Ddaemon.name= -Dstorm.options= -Dstorm.home=/home/hubatrix/ccbd-work/storm2/apache-storm-0.10.0 -Dstorm.log.dir=/home/hubatrix/ccbd-work/storm2/apache-storm-0.10.0/logs -Djava.library.path=/usr/local -Dstorm.conf.file= -cp /home/hubatrix/ccbd-work/storm2/apache-storm-0.10.0/lib/log4j-core-2.1.jar:/home/hubatrix/ccbd-work/storm2/apache-storm-0.10.0/lib/slf4j-api-1.7.7.jar:/home/hubatrix/ccbd-work/storm2/apache-storm-0.10.0/lib/log4j-over-slf4j-1.6.6.jar:/home/hubatrix/ccbd-work/storm2/apache-storm-0.10.0/lib/asm-4.0.jar:/home/hubatrix/ccbd-work/storm2/apache-storm-0.10.0/lib/reflectasm-1.07-shaded.jar:/home/hubatrix/ccbd-work/storm2/apache-storm-0.10.0/lib/minlog-1.2.jar:/home/hubatrix/ccbd-work/storm2/apache-storm-0.10.0/lib/kryo-2.21.jar:/home/hubatrix/ccbd-work/storm2/apache-storm-0.10.0/lib/disruptor-2.10.4.jar:/home/hubatrix/ccbd-work/storm2/apache-storm-0.10.0/lib/servlet-api-2.5.jar:/home/hubatrix/ccbd-work/storm2/apache-storm-0.10.0/lib/hadoop-auth-2.4.0.jar:/home/hubatrix/ccbd-work/storm2/apache-storm-0.10.0/lib/log4j-api-2.1.jar:/home/hubatrix/ccbd-work/storm2/apache-storm-0.10.0/lib/log4j-slf4j-impl-2.1.jar:/home/hubatrix/ccbd-work/storm2/apache-storm-0.10.0/lib/clojure-1.6.0.jar:/home/hubatrix/ccbd-work/storm2/apache-storm-0.10.0/lib/storm-core-0.10.0.jar:/home/hubatrix/ccbd-work/storm2/examples/target/storm-starter-topologies-0.10.0.jar:/home/hubatrix/ccbd-work/storm2/apache-storm-0.10.0/conf:/home/hubatrix/ccbd-work/storm2/apache-storm-0.10.0/bin -Dstorm.jar=/home/hubatrix/ccbd-work/storm2/examples/target/storm-starter-topologies-0.10.0.jar org.apache.storm.starter.ExclamationTopology Error: Could not find or load main class org.apache.storm.starter.ExclamationTopology

what am I doing wrong here? Please help me fix this and also I am running this is on a local machine and my storm.yaml is configured properly.

here is my file structure of storm2 http://paste.linux.chat/view/e4424189 if at all I am doing anything wrong in defining correct me from it.

My every setup was right till the end as Matthias J. Sax mentioned I had issues with my jar file, but dont really know if the issue was jar file(topology) itself or the path I just download a new jar file from https://dl.dropboxusercontent.com/s/kc933u6vz2crqkb/storm-starter-0.0.1-SNAPSHOT-jar-with-dependencies.jar and ran

./storm jar ~/ccbd-work/storm2/storm-starter-0.0.1-SNAPSHOT-jar-with-dependencies.jar storm.starter.WordCountTopology WordCount -c nimbus.host=localhost

and it worked like walk in a cake, thanks again for the response


回答1:


It is not in the correct folder: the error messages says "org.apache.storm.starter.ExclamationTopology" but the class file is in folder "storm/starter". (In Java, package names must align with directory structure.)

ExclamationTopology was moved from package storm.starter to org.apache.storm.starter recently. In version 0.10.0 it is still in storm.starter. Thus, you need to submit your topology via

./storm jar ~/ccbd-work/storm2/examples/target/storm-starter-topologies-0.10.0.jar storm.starter.ExclamationTopology



回答2:


I also meet this issue and confuse for two days. Then I found it is the wrong folder problem. The solution actually is quite easy. You don't need to add "org.apache.storm.starter" at the front. Which means all you need to do is to cd to the starter folder then run "storm jar ~/ccbd-work/storm2/examples/target/storm-starter-topologies-0.10.0.jar ExclamationTopology". That's all. Then you could check the topology at the localhost:8080. Good luck!



来源:https://stackoverflow.com/questions/35525965/apache-storm-could-not-load-main-class-org-apache-storm-starter-exclamationtop

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!