0

I am trying to run Wikipedia Bayes Example from https://cwiki.apache.org/confluence/display/MAHOUT/Wikipedia+Bayes+Example

When I ran the following command : $MAHOUT_HOME/bin/mahout wikipediaXMLSplitter -d $MAHOUT_HOME/examples/temp/enwiki-latest-pages-articles10.xml -o wikipedia/chunks -c 64

I am getting this error:

Exception in thread "main" java.lang.NoClassDefFoundError: classpath
Caused by: java.lang.ClassNotFoundException: classpath
        at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)
Running on hadoop, using /x/.../bin/hadoop and HADOOP_CONF_DIR=
MAHOUT-JOB: /x/.../mahout-distribution-0.7/mahout-examples-0.7-job.jar
12/07/25 11:22:06 WARN driver.MahoutDriver: Unable to add class: wikipediaXMLSplitter
12/07/25 11:22:06 WARN driver.MahoutDriver: No wikipediaXMLSplitter.props found on classpath, will use command-line arguments only
Unknown program 'wikipediaXMLSplitter' chosen.

3 Answers 3

0

I met the same problem, it was caused by the code in bin/mahout(only in version 0.7):

if [ -x "$HADOOP_BINARY" ] ; then
  HADOOP_BINARY_CLASSPATH=$("$HADOOP_BINARY" classpath)
fi

It will exec hadoop classpath and leads to an error. Maybe the version of hadoop is too old for mahout 0.7. Anyway, I commented these three lines and it worked fine.

0

maybe you should use:

mahout -core ... ...

this should work

0

I've run into the same problem. It is solved by specifying org.apache.mahout.text.wikipedia.WikipediaXmlSplitter [note also the different capitalization]

$MAHOUT_HOME/bin/mahout org.apache.mahout.text.wikipedia.WikipediaXmlSplitter -d $MAHOUT_HOME/examples/tmp/enwiki-latest-pages-articles.xml -o wikipedia/chunks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.