Could not find main class while working with Storm topology

I use the class storm jarto send the Topology to `nimbus'. It works fine locally, but on the remote cluster, it says it cannot load the main class. Below is the error

stderr: SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/storm-0.9.0.1/lib/logback-classic-1.0.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/tmp/storm-starter.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
Error: Could not find or load main class ExclamationTopology

I run the following command in the CLI:

usr/local/storm/bin/storm jar /tmp/storm-starter.jar ExclamationTopology
+3
source share
4 answers

For me it was a classpath issue. As soon as I went to the directory in which the bank was and executed the command, everything was fine.

Run from the storm home folder

./bin/storm jar examples/storm-starter/storm-starter-topologies-0.9.3.jar storm.starter.WordCountTopology TOne

Failed with error: Error: Could not find or load main class storm.starter.WordCountTopology

Running from directory examples/storm-starter

/root/storm/apache-storm-0.10.0/bin/storm jar storm-starter-topologies-0.10.0.jar storm.starter.WordCountTopology TOne

It worked fine.

+3
source

, storm-starter.jar: sl4j. (https://github.com/nathanmarz/storm-starter), ( m2-pom.xml ):

mvn -f m2-pom.xml package

:

storm-starter-0.0.1-SNAPSHOT-jar-with-dependencies.jar

, (, Nimbus), storm jar , main(), , (, "-with-dependencies" ):

usr/local/storm/bin/storm jar storm-starter-0.0.1-SNAPSHOT-jar-with-dependencies.jar storm.starter.ExclamationTopology
+2

, ​​, pom.xml. u , maven libs .

0

try the following:

java -jar /tmp/storm-starter.jar ExclamationTopology

got the answer here: Run Jar in console

-3
source

All Articles