Peter
Thank you for your response. However, after making your changes, it still
does not work for me.
In fact I tried another way which is:
1. create a lib folder within my Job Jar-file and put the
"org.apache.mahout.math.Vector" and other dependent jars.
2. Launch the command via "hadoop jar ./mahout-examples-with-libs.jar
org.apache.mahout.clustering.syntheticcontrol.kmeans.Job"
However, I still get the error:
"Error: java.lang.ClassNotFoundException: org.apache.mahout.math.Vector
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)"
Another thing I tried is modify the $HADOOP_HOME/conf/hadoop-env.sh and edit
the HADOOP_CLASSPATH to include the dependent libraries. Even that does not
work.
Regards
Gokul
On Mon, Jun 28, 2010 at 3:43 PM, Peter M. Goldstein <
[email protected]> wrote:
> Hi Gokul,
>
> You may want to see the following bug reports:
>
> https://issues.apache.org/jira/browse/MAHOUT-426
>
> https://issues.apache.org/jira/browse/MAHOUT-427
>
> https://issues.apache.org/jira/browse/MAHOUT-428
>
> I ran into similar issues as you and had to some minor patching to get
> everything to work.
>
> Also, make sure you run an explicit "mvn install" from within the examples
> directory. I had to do this to get the JOB files to build correctly.
> Getting the JOB files to build correctly solves (sort of) issues 426 and
> 427, so you only need to apply the patch described in 428.
>
> Hope that helps.
>
> Regards,
>
> Peter
>
> -----Original Message-----
> From: Gokul Pillai [mailto:[email protected]]
> Sent: Monday, June 28, 2010 3:27 PM
> To: [email protected]
> Subject: No class definition found for org.apache.mahout.math.Vector when
> invoking K-means example
>
> I made a new installation of Hadoop 0.20 from Cloudera.
> I then installed Mahout 0.4-SNAPSHOT by doing a SVN checkout this morning
> and ran mvn install on core, utils and examples.
> I tried running the KMeans Clustering example by doing the following as
> mentioned in the tutorial:
> hadoop jar ~/mahout/trunk/examples/target/mahout-examples-0.4-SNAPSHOT.jar
> org.apache.mahout.clustering.syntheticcontrol.kmeans.Job
>
> And I keep getting this error although I have explicitly set my Classpath
> to
>
> "/usr/lib/hadoop/lib/mahout-collections-1.0.jar:/usr/lib/hadoop/lib/mahout-m
>
> ath-0.4-SNAPSHOT.jar:/usr/lib/hadoop/lib/mahout-utils-0.4-SNAPSHOT.jar:/usr/
> lib/hadoop/lib/mahout-core-0.4-SNAPSHOT.jar":
>
> 10/06/28 15:19:21 INFO mapred.JobClient: Task Id :
> attempt_201006280959_0027_r_000000_1, Status : FAILED
> java.lang.RuntimeException: java.lang.ClassNotFoundException:
> org.apache.mahout.clustering.kmeans.KMeansCombiner
> at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:868)
> at
>
> org.apache.hadoop.mapreduce.JobContext.getCombinerClass(JobContext.java:169)
> at org.apache.hadoop.mapred.Task$CombinerRunner.create(Task.java:1107)
> at
>
> org.apache.hadoop.mapred.ReduceTask$ReduceCopier.<init>(ReduceTask.java:1780
> )
> at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:375)
> at org.apache.hadoop.mapred.Child.main(Child.java:170)
> Caused by: java.lang.ClassNotFoundException:
> org.apache.mahout.clustering.kmeans.KMeansCombiner
> 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 sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
> 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.conf.Configuration.getClassByName(Configuration.java:815)
> at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:866)
> ... 5 more
>
>
> Any help would be appreciated.
>
> Regards
> Gokul
>
>
>