0

I am trying to run apache storm in a local mode in my machine.

I successfully managed to install and run storm as follwoing:

1- Install Apachee ZooKeeper

2- Install Storm

3- Configure Storm (config.yaml)

4- Start Storm Master and Worker nodes (Nimbus and Supervisor)

5- Start Storm UI

Now my issue is to run a helloWorld example

I have using the tutorial in the link below

http://wpcertification.blogspot.com/2014/02/helloworld-apache-storm-word-counter.html

it has 4 java files

1- Main: HelloStorm.java

2- LineReaderSpout

3- WordSpitterBolt

4- WordCounterBolt

Now when I try to run the main file in command line (linux-based system), I get the following error:

error: package com.spnotes.storm.bolts does not exist
at import com.spnotes.storm.bolts.WordCounterBolt;

My guess is that I didn't specify the classpath correctly to include the location of storm, which I did as following

javac -classpath ~/Public/apache-storm-0.9.4/lib/ HelloStorm.java 

However I am still facting the same problem. Any suggestions ?

Abdelrahman Shoman
  • 2,882
  • 7
  • 36
  • 61

1 Answers1

0

Packages correspond to directories so if you have

import com.spnotes.storm.bolts.WordCounterBolt

in the code, you need to have a com/spnotes/storm/bolts/WordCounterBolt.java file during compilation.

At runtime, java will expect a com/spnotes/storm/bolts/WordCounterBolt.class file.

  • but what if I do have the jars. How to include them in the classpath .. cuz I tried to include the jars the same way and I got the same problem – Abdelrahman Shoman Apr 26 '15 at 09:11
  • see this question: http://stackoverflow.com/questions/219585/setting-multiple-jars-in-java-classpath –  Apr 26 '15 at 09:17