1

I am running a storm topology from command prompt using the command :
bin/storm jar /home/stormrabbitmqtest.jar RabbitmqTopology rabbittest

The topology consists of a spout which is reading from a rabbitmq queue. But i am getting the exception below:

Exception in thread "main" java.lang.NoClassDefFoundError: com/rabbitmq/client/Consumer at RabbitmqTopology.main(RabbitmqTopology.java:17) Caused by: java.lang.ClassNotFoundException: com.rabbitmq.client.Consumer at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ... 1 more I am not able to understand the issue. Looking forward for any help.

user3497266
  • 107
  • 1
  • 1
  • 4

1 Answers1

0

Go to https://www.rabbitmq.com/download.html

Download the java client and add rabbitmq-client.jar in your class-path

Gabriele Santomaggio
  • 21,656
  • 4
  • 52
  • 52
  • I have already included the dependent jar file in stormrabbitmqtest.jar and still getting the exception. – user3497266 Apr 08 '14 at 09:36
  • 1
    did you create a single jar ? Could you try to leave the dependent outside the jar a use the class path? .. this is a typical call-path error. – Gabriele Santomaggio Apr 08 '14 at 09:45
  • I have a created a single jar 'stormrabbitmqtest.jar' that also includes the dependent jar files. I am not specifying classpath while running the topology from the console. – user3497266 Apr 08 '14 at 11:02
  • 1
    I don't know exactly how you have created your single jar, but it's if you create a jar it is not autamatically load the dependency. For example: http://docs.oracle.com/javase/tutorial/deployment/jar/downman.html or http://stackoverflow.com/questions/183292/classpath-including-jar-within-a-jar – Gabriele Santomaggio Apr 08 '14 at 12:04