views:

197

answers:

3

Hi, I have a problem in executing the Bayesian algorithm in Mahout. I built it with Maven and the job file is in target directory. When run from terminal using hadoop, I'm getting the ClassNotFoundException error. What should be done?

$HADOOP_HOME/bin/hadoop jar mahout-core-0.3-SNAPSHOT.job org.apache.mahout.classifier.bayes.mapreduce.bayes.bayesdriver -i test -o output

Exception in thread "main" java.lang.ClassNotFoundException: org.apache.mahout.classifier.bayes.mapreduce.bayes.bayesdriver at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:247) at org.apache.hadoop.util.RunJar.main(RunJar.java:149)

A: 

I think you should be calling:

$HADOOP_HOME/bin/hadoop jar mahout-core-0.3-SNAPSHOT.job org.apache.mahout.classifier.bayes.mapreduce.bayes.BayesDriver -i test -o output

Note BayesDriver, not bayesdriver.

(referred to this documentation)

Brabster
Well, guess it should be in lowercase only. It has worked with other programs using MapReduce without Mahout. In any case I tried that which is not making any difference.
Shweta
Did my suggestion work or was there still a problem?
Brabster
This is the error which I get when I give BayesDriver.Exception in thread "main" java.lang.NoSuchMethodException: org.apache.mahout.classifier.bayes.mapreduce.bayes.BayesDriver.main([Ljava.lang.String;) at java.lang.Class.getMethod(Class.java:1605) at org.apache.hadoop.util.RunJar.main(RunJar.java:150)
Shweta
A: 

Is the fact that your file ends with a .job instead of a .jar relevant? The documentation si unclear.

akintayo