I also have gotten the Mahout in Action book recently and am stuck on the first example. I downloaded the 0.6 distribution and downloaded and built the MiA code. When I attempt to run the class from the command line, I get this error:

java mia.recommender.ch02.RecommenderIntro
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/mahout/cf/taste/model/DataModel Caused by: java.lang.ClassNotFoundException: org.apache.mahout.cf.taste.model.DataModel
    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:321)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: mia.recommender.ch02.RecommenderIntro. Program will exit.


Am I missing a jar somewhere, or am I running with the wrong Mahout version?

When I change into the MiA directed and attempt to run it with Maven, I get this error:

mvn pom.xml
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Mahout in Action Examples 0.1
[INFO] ------------------------------------------------------------------------ [INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.642s
[INFO] Finished at: Sun Jun 17 06:22:08 EDT 2012
[INFO] Final Memory: 2M/15M
[INFO] ------------------------------------------------------------------------ [ERROR] Unknown lifecycle phase "pom.xml". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/LifecyclePhaseNotFoundException


I am new to Maven to it may be that I don't know how to run Maven correctly. Also, when I downloaded the trunk version from svn I was not able to get it to build (it seemed to be missing a few jar files but I forget which ones), but that's a different issue. Right now I am trying to figure out how to run the first examples in some version of Mahout. If anybody knows how to run the examples I would greatly appreciate the assistance.

thanks,

Paul

On 06/13/2012 12:20 PM, Sean Owen wrote:
(Since you also asked in the publisher's forum, and it pertains to the
book, I will answer there rather than on the general Mahout mailing list.)

On Wed, Jun 13, 2012 at 2:25 PM, Yaprak Ayazoglu
<[email protected]>wrote:

Hi,

I'm following "Mahout in Action" book to learn Mahout. I'm trying to run
the example codes in this book. I downloaded the codes and run
"RecommenderIntro.java" (a code at chapter 2 - ch2).

After running this code I get the following error:

Exception in thread "main" java.io.FileNotFoundException: intro.csv
at

org.apache.mahout.cf.taste.impl.model.file.FileDataModel.<init>(FileDataModel.java:160)
at

org.apache.mahout.cf.taste.impl.model.file.FileDataModel.<init>(FileDataModel.java:146)
at mia.recommender.ch02.RecommenderIntro.main(RecommenderIntro.java:26)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)

Can you help me to solve this problem?

Thanks.

--
Yaprak


Reply via email to