You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@storm.apache.org by Adrian Mocanu <am...@verticalscope.com> on 2013/11/27 18:58:36 UTC
running ExclamationTopology
Hi,
I'm trying to run ExclamationTopology from the sample code on github.
I packaged the code into a jar and added to manifest (by hand) the following
Main-Class: storm.starter.ExclamationTopology
I cd to directory where the jar is and use the following command to run topology:
/localsys/storm-0.8.2/bin/storm jar starter.project.jar storm.starter.ExclamationTopology myTopology1
It throws an exception:
Exception in thread "main" java.lang.NoClassDefFoundError:
ExclamationTopology
Caused by: java.lang.ClassNotFoundException: ExclamationTopology
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
Could not find the main class: ExclamationTopology. Program will exit.
How do I run this sample topology?
Thanks
-Adrian
RE: running ExclamationTopology
Posted by Adrian Mocanu <am...@verticalscope.com>.
Hi
Thanks for getting back to me!
I built the jar manually from windows cmd line like this "jar starter.project.jar src" then added "Main-Class: storm.starter.ExclamationTopology" to manifest file. I code in Scala so I'm not sure how I will package that into a jar.
I tried to use entire path, but I still get the same error:
/localsys/storm-0.8.2/bin/storm jar /localsys/storm.starter.project/starter.project.jar storm.starter.ExclamationTopology myTopology1
I think I figured it out, when I jarred the files, only the .java files were put in the jar so no .class files.
-A
From: Svend Vanderveken [mailto:svend.vanderveken@gmail.com]
Sent: November-27-13 1:23 PM
To: user@storm.incubator.apache.org
Subject: Re: running ExclamationTopology
Hi Adrian,
An annoying thing about "storm jar" is that if he does not find the jar you tell him, he happily ignores it and moves on to the next step
=> check the spelling and folder location (maybe it's in "target/" if you built with maven?).
Also, the jar should be built with the command "mvn assembly:assembly", in order to have all dependencies bundled in it, and in that case maven typically gives it a name like "bla bla-with-dependencies.jar", which is not visible in the line you mention.
Good luck
S
On Wed, Nov 27, 2013 at 12:58 PM, Adrian Mocanu <am...@verticalscope.com>> wrote:
Hi,
I'm trying to run ExclamationTopology from the sample code on github.
I packaged the code into a jar and added to manifest (by hand) the following
Main-Class: storm.starter.ExclamationTopology
I cd to directory where the jar is and use the following command to run topology:
/localsys/storm-0.8.2/bin/storm jar starter.project.jar storm.starter.ExclamationTopology myTopology1
It throws an exception:
Exception in thread "main" java.lang.NoClassDefFoundError:
ExclamationTopology
Caused by: java.lang.ClassNotFoundException: ExclamationTopology
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
Could not find the main class: ExclamationTopology. Program will exit.
How do I run this sample topology?
Thanks
-Adrian
Re: running ExclamationTopology
Posted by Svend Vanderveken <sv...@gmail.com>.
Hi Adrian,
An annoying thing about "storm jar" is that if he does not find the jar you
tell him, he happily ignores it and moves on to the next step
=> check the spelling and folder location (maybe it's in "target/" if you
built with maven?).
Also, the jar should be built with the command "mvn assembly:assembly", in
order to have all dependencies bundled in it, and in that case maven
typically gives it a name like "bla bla-with-dependencies.jar", which is
not visible in the line you mention.
Good luck
S
On Wed, Nov 27, 2013 at 12:58 PM, Adrian Mocanu
<am...@verticalscope.com>wrote:
> Hi,
>
> I’m trying to run ExclamationTopology from the sample code on github.
>
> I packaged the code into a jar and added to manifest (by hand) the
> following
>
> Main-Class: storm.starter.ExclamationTopology
>
>
>
> I cd to directory where the jar is and use the following command to run
> topology:
>
> /localsys/storm-0.8.2/bin/storm jar starter.project.jar
> storm.starter.ExclamationTopology myTopology1
>
>
>
> It throws an exception:
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
>
> ExclamationTopology
>
> Caused by: java.lang.ClassNotFoundException: ExclamationTopology
>
> at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
>
> at java.security.AccessController.doPrivileged(Native Method)
>
> at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
>
> at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
>
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
>
> at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
>
> Could not find the main class: ExclamationTopology. Program will exit.
>
>
>
> How do I run this sample topology?
>
>
>
> Thanks
>
> -Adrian
>
>
>
>
>