Search code examples
javajarapache-storm

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


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


Solution

  • 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