You do need a .job file and it's produced the same way, with mvn package.

On Wed, Jan 18, 2012 at 12:40 PM, Martin Wignall <
martin.wign...@autotrader.co.uk> wrote:

> Hi,
> I am new to mahout, and am working my way through the Mahout In Action
> book. Now, I'm trying to execute a RecommenderJob, and see the following
> error:
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/apache/commons/cli2/Option
>       at java.lang.Class.forName0(Native Method)
>       at java.lang.Class.forName(Class.java:264)
>       at org.apache.hadoop.util.RunJar.main(RunJar.java:149)
> Caused by: java.lang.ClassNotFoundException: org.apache.commons.cli2.Option
>       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 java.lang.ClassLoader.loadClass(ClassLoader.java:266)
>       ... 3 more
>
> The command I'm executing is as follows:
>
> hadoop jar target/mahout-core-0.6-SNAPSHOT.jar
> org.apache.mahout.cf.taste.hadoop.item.RecommenderJob
> -Dmapred.input.dir=input/input.txt
> -Dmapred.output.dir=output --usersFile input/users.txt --booleanData
>
> This differs slightly from the command prescribed in the Mahout In Action
> book:
>
>
>
> bin/hadoop jar target/mahout-core-0.4-SNAPSHOT.job
>
> org.apache.mahout.cf.taste.hadoop.item.RecommenderJob
>
> -Dmapred.input.dir=input/input.txt
> -Dmapred.output.dir=output --usersFile input/users.txt --booleanData
>
> Obvious differences are (i) I'm on Mahout 0.6, and (ii) I don't have a
> .job file to reference, only a .jar (target/mahout-core-0.6-SNAPSHOT.jar).
> I don't know if I should be referencing the .jar file in this way.
>
>
> Now, I have built the jar myself, by executing:
>
> mvn -DskipTests clean package
> from the core directory of Mahout.
>
> This appears to have worked fine, and I see the following in the
> core/target directory
>
> drwxrwxr-x 6 martin martin    4096 2012-01-18 12:24 ./
> drwxrwxr-x 8 martin martin    4096 2012-01-18 12:24 ../
> drwxrwxr-x 3 martin martin    4096 2012-01-18 12:24 classes/
> drwxrwxr-x 4 martin martin    4096 2012-01-18 12:24 generated-sources/
> -rw-rw-r-- 1 martin martin 1641278 2012-01-18 12:24
> mahout-core-0.6-SNAPSHOT.jar
> drwxrwxr-x 2 martin martin    4096 2012-01-18 12:24 maven-archiver/
> drwxrwxr-x 3 martin martin    4096 2012-01-18 12:24 test-classes/
>
> Notice that there is no .job file, only a .jar.
>
> I'm not sure if the problem I'm seeing is due to the lack of a .job file,
> or if it's something else that I've got wrong.
>
> Please can you help explain why I can't run the RecommenderJob?
>
> Many thanks,
>
> Martin
>
>
>
> ________________________________________
>
>
> This e-mail is sent on behalf of Trader Media Group Limited, Registered
> Office: Auto Trader House, Cutbush Park Industrial Estate, Danehill, Lower
> Earley, Reading, Berkshire, RG6 4UT(Registered in England No. 4768833).
> This email and any files transmitted with it are confidential and may be
> legally privileged, and intended solely for the use of the individual or
> entity to whom they are addressed. If you have received this email in error
> please notify the sender. This email message has been swept for the
> presence of computer viruses.
>
>

Reply via email to