Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Classnotfound exception while running hadoop

Tags:

java

hadoop

I am new to hadoop.

I have a file Wordcount.java which refers hadoop.jar and stanford-parser.jar

I am running the following commnad

javac -classpath .:hadoop-0.20.1-core.jar:stanford-parser.jar -d ep WordCount.java 

jar cvf ep.jar -C ep .

bin/hadoop jar ep.jar WordCount gutenburg gutenburg1

After executing i am getting the following error:

lang.ClassNotFoundException: edu.stanford.nlp.parser.lexparser.LexicalizedParser

The class is in stanford-parser.jar ...

What can be the possible problem?

Thanks

like image 380
vana Avatar asked Sep 11 '26 22:09

vana


2 Answers

I think you need to add the standford-parser jar when invoking hadoop also, not just the compiler. (If you look in ep.jar, I imagine it will only have one file in it - WordCount.class)

E.g.

bin/hadoop jar ep.jar WordCount -libjars stanford-parser.jar gutenburg gutenburg1

See Map/Reduce Tutorial

like image 177
mdma Avatar answered Sep 13 '26 12:09

mdma


mdma is on the right track, but you'll also need your job driver to implement Tool.

like image 44
dehowell Avatar answered Sep 13 '26 14:09

dehowell