1
votes

I was following the https://github.com/apache/storm/tree/master/examples/storm-starter . I'm using Ubuntu 14.04 LTS on my VMWare.

I can run mvn exec:java -D storm.topology=storm.starter.RollingTopWords in /home/user/storm/examples/storm-starter directory smoothly without problem. However I can't run it in Apache Storm.

I had storm-starter-topologies-0.9.3.jar in my /home/user/storm/examples/storm-starter directory. I also had storm-starter-0.9.3.jar & storm-starter-0.9.3-jar-with-dependencies.jar in my /home/user/storm/examples/storm-starter/target directory.

Below are the commands I tried before in /home/user/storm/bin directory:

./storm jar storm-starter-*.jar storm.starter.RollingTopWords

./storm jar storm-starter-0.9.3-jar-with-dependencies.jar storm.starter.RollingTopWords

./storm jar storm-starter-jar-with-dependencies.jar storm.starter.RollingTopWords

./storm jar storm-starter-topologies-0.9.3.jar storm.starter.RollingTopWords

with topology name:

./storm jar storm-starter-0.9.3-jar-with-dependencies.jar storm.starter.RollingTopWords slidingWindowCounts

./storm jar storm-starter-jar-with-dependencies.jar storm.starter.RollingTopWords slidingWindowCounts

./storm jar storm-starter-topologies-0.9.3.jar storm.starter.RollingTopWords slidingWindowCounts 

./storm jar storm-starter-0.9.3-jar storm.starter.RollingTopWords slidingWindowCounts 

All end up with the same error: Error: Could not find or load main class storm.starter.RollingTopWords .

All my class is in /home/user/storm/examples/storm-starter/target/classes/storm/starter directory The RollingTopWords.class is present in that directory.

How should I solve this problem? A detail solution will be helpful.

2
Problem solved. The problem arise because the storm jar is run at incorrect directory. It should be run at /home/user/storm/examples/storm-starter/target directory since my storm-starter-0.9.3-jar-with-dependencies.jar is in that directory.Toshihiko

2 Answers

2
votes

Problem solved. The problem arise because the storm jar is run at incorrect directory. It should be run at /home/user/storm/examples/storm-starter/target directory since my storm-starter-0.9.3-jar-with-dependencies.jar is in that directory.

0
votes

Try this, assuming you are inside storm root folder i.e in your case ( /home/user/storm/bin)

 storm jar /path/to/storm-starter-*.jar storm.starter.RollingTopWords <topology-name> remote

/path/to/storm-starter-*.jar should be replaced with the actual path in your system. Here basically the <topology-name> & remote params are the two arguments (which are optional) provided to storm.

If you just run (without arguments)

    storm jar /path/to/storm-starter-*.jar storm.starter.RollingTopWords

It will assume the name of topology as slidingWindowCounts you can change this by any name of your choice by replacing the <topology-name> with any valid string.
the last argument remote tells storm to run this in cluster, if your don't provide this arguments it will run it in local mode.

Remember the arguments are specific to this particular topology and will not be valid for others. Looking at the RollingTopWords topology you will see it totally depends on the developer to configure your code to accept external parameters or by hard coding it.