2
votes

I have a problem with executing the Bayesian algorithm in Mahout. I built it with Maven and the job file is in the target directory. When run from the 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)

2

2 Answers

0
votes

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)

0
votes

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