You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@mahout.apache.org by Neil Ghosh <ne...@gmail.com> on 2010/09/21 18:15:12 UTC

Build Error in Twenty Newsgroups Classification Example

Hi ,

I am trying to run the example using Mahout 0.3 at
https://cwiki.apache.org/confluence/display/MAHOUT/Twenty+Newsgroups

I have carried out all the steps but getting build error during this command

mvn -e exec:java \
      -Dexec.mainClass=org.apache.mahout.classifier.bayes.PrepareTwentyNewsgroups
\
      -Dexec.args="-p 20news-18828 \
                   -o 20news-input \
                   -a org.apache.lucene.analysis.standard.StandardAnalyzer \
                   -c UTF-8"


Please help, getting the following error.

neil@neil-laptop:~/workspace/mahout-0.3/examples$ mvn -e exec:java \
>
-Dexec.mainClass=org.apache.mahout.classifier.bayes.PrepareTwentyNewsgroups
\
>       -Dexec.args="-p 20news-18828 \
>                    -o 20news-input \
>                    -a org.apache.lucene.analysis.standard.StandardAnalyzer
\
>                    -c UTF-8"
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'exec'.
[INFO]
------------------------------------------------------------------------
[INFO] Building Mahout Examples
[INFO]    task-segment: [exec:java]
[INFO]
------------------------------------------------------------------------
[INFO] Preparing exec:java
[INFO] No goals needed for project - skipping
[INFO] [exec:java {execution: default-cli}]
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] An exception occured while executing the Java class. null

Unresolved compilation problems:
    DefaultOptionCreator cannot be resolved
    CommandLineUtil cannot be resolved
    BayesFileFormatter cannot be resolved
    CommandLineUtil cannot be resolved

[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: An exception occured
while executing the Java class. null
    at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
    at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
    at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
    at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
    at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
    at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
    at
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
    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:616)
    at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
    at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: An exception
occured while executing the Java class. null
    at org.codehaus.mojo.exec.ExecJavaMojo.execute(ExecJavaMojo.java:346)
    at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
    at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
    ... 17 more
Caused by: java.lang.reflect.InvocationTargetException
    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:616)
    at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:291)
    at java.lang.Thread.run(Thread.java:636)
Caused by: java.lang.Error: Unresolved compilation problems:
    DefaultOptionCreator cannot be resolved
    CommandLineUtil cannot be resolved
    BayesFileFormatter cannot be resolved
    CommandLineUtil cannot be resolved

    at
org.apache.mahout.classifier.bayes.PrepareTwentyNewsgroups.main(PrepareTwentyNewsgroups.java:52)
    ... 6 more
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Tue Sep 21 21:41:25 IST 2010
[INFO] Final Memory: 14M/34M
[INFO]
------------------------------------------------------------------------



-- 
Thanks and Regards
Neil
http://neilghosh.com

Re: Build Error in Twenty Newsgroups Classification Example

Posted by Bhaskar Ghosh <bj...@yahoo.co.in>.
 I am also getting errors while generating the input dataset as per the 
following command from here 
( https://cwiki.apache.org/MAHOUT/twenty-newsgroups.html ):
$ mkdir 20news-input $ mvn -e exec:java \       
-Dexec.mainClass=org.apache.mahout.classifier.bayes.PrepareTwentyNewsgroups \       
-Dexec.args="-p 20news-18828 \                    -o 20news-input \                    
-a org.apache.lucene.analysis.standard.StandardAnalyzer \                    -c 
UTF-8"

The error I am getting is pated below:

>
>[INFO] [exec:java]
>[INFO] ------------------------------------------------------------------------
>[ERROR] BUILD ERROR
>[INFO] ------------------------------------------------------------------------
>[INFO] An exception occured while executing the Java class. 
>org.apache.mahout.classifier.bayes.PrepareTwentyNewsgroups
>
>
>[INFO] ------------------------------------------------------------------------
>[INFO] Trace
>org.apache.maven.lifecycle.LifecycleExecutionException: An exception occured 
>while executing the Java class. 
>org.apache.mahout.classifier.bayes.PrepareTwentyNewsgroups
>at 
>org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:583)
>
>at 
>org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
>
>at 
>org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482)
>
>at 
>org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
>
>at 
>org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
>
>at 
>org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
>
>at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
>at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
>at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>at 
>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
>at java.lang.reflect.Method.invoke(Method.java:597)
>at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
>Caused by: org.apache.maven.plugin.MojoExecutionException: An exception occured 
>while executing the Java class. 
>org.apache.mahout.classifier.bayes.PrepareTwentyNewsgroups
>at org.codehaus.mojo.exec.ExecJavaMojo.execute(ExecJavaMojo.java:346)
>at 
>org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
>
>at 
>org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
>
>... 16 more
>Caused by: java.lang.ClassNotFoundException: 
>org.apache.mahout.classifier.bayes.PrepareTwentyNewsgroups
>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 org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:284)
>at java.lang.Thread.run(Thread.java:619)
>
>
Any idea why this is happening? Appreciate any help.
Thanks
Bhaskar Ghosh
Hyderabad, India

http://www.google.com/profiles/bjgindia

"Ignorance is Bliss... Knowledge never brings Peace!!!"




________________________________
From: Neil Ghosh <ne...@gmail.com>
To: Ted Dunning <te...@gmail.com>
Cc: user@mahout.apache.org
Sent: Tue, 21 September, 2010 11:58:41 PM
Subject: Re: Build Error in Twenty Newsgroups Classification Example

Thanks Ted.

I just found that my  [mvn install] on the root directory had completed with
error before trying this .
Then I did "cd" to "core" and "examples" and compiled and installed.Both
were  successful.

After that this command ran fine and I could run the example.


On Tue, Sep 21, 2010 at 11:51 PM, Ted Dunning <te...@gmail.com> wrote:

> Did you do [mvn -DskipTests install] at the top level before trying this?
>
>
> On Tue, Sep 21, 2010 at 9:15 AM, Neil Ghosh <ne...@gmail.com> wrote:
>
>> Hi ,
>>
>> I am trying to run the example using Mahout 0.3 at
>> https://cwiki.apache.org/confluence/display/MAHOUT/Twenty+Newsgroups
>>
>> I have carried out all the steps but getting build error during this
>> command
>>
>> mvn -e exec:java \
>>
>>  -Dexec.mainClass=org.apache.mahout.classifier.bayes.PrepareTwentyNewsgroups
>> \
>>      -Dexec.args="-p 20news-18828 \
>>                   -o 20news-input \
>>                   -a org.apache.lucene.analysis.standard.StandardAnalyzer
>> \
>>                   -c UTF-8"
>>
>>
>> Please help, getting the following error.
>>
>> neil@neil-laptop:~/workspace/mahout-0.3/examples$ mvn -e exec:java \
>> >
>>
>> -Dexec.mainClass=org.apache.mahout.classifier.bayes.PrepareTwentyNewsgroups
>> \
>> >       -Dexec.args="-p 20news-18828 \
>> >                    -o 20news-input \
>> >                    -a
>> org.apache.lucene.analysis.standard.StandardAnalyzer
>> \
>> >                    -c UTF-8"
>> + Error stacktraces are turned on.
>> [INFO] Scanning for projects...
>> [INFO] Searching repository for plugin with prefix: 'exec'.
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Building Mahout Examples
>> [INFO]    task-segment: [exec:java]
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Preparing exec:java
>> [INFO] No goals needed for project - skipping
>> [INFO] [exec:java {execution: default-cli}]
>> [INFO]
>> ------------------------------------------------------------------------
>> [ERROR] BUILD ERROR
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] An exception occured while executing the Java class. null
>>
>> Unresolved compilation problems:
>>    DefaultOptionCreator cannot be resolved
>>    CommandLineUtil cannot be resolved
>>    BayesFileFormatter cannot be resolved
>>    CommandLineUtil cannot be resolved
>>
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Trace
>> org.apache.maven.lifecycle.LifecycleExecutionException: An exception
>> occured
>> while executing the Java class. null
>>    at
>>
>>org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
>>)
>>    at
>>
>>org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
>>)
>>    at
>>
>>org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
>>)
>>    at
>>
>>org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
>>)
>>    at
>>
>>org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
>>)
>>    at
>>
>>org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
>>)
>>    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
>>    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
>>    at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
>>    at
>> org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
>>    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:616)
>>    at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>>    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>>    at
>> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>>    at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
>> Caused by: org.apache.maven.plugin.MojoExecutionException: An exception
>> occured while executing the Java class. null
>>    at org.codehaus.mojo.exec.ExecJavaMojo.execute(ExecJavaMojo.java:346)
>>    at
>>
>>org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
>>)
>>    at
>>
>>org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
>>)
>>    ... 17 more
>> Caused by: java.lang.reflect.InvocationTargetException
>>    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:616)
>>    at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:291)
>>    at java.lang.Thread.run(Thread.java:636)
>> Caused by: java.lang.Error: Unresolved compilation problems:
>>    DefaultOptionCreator cannot be resolved
>>    CommandLineUtil cannot be resolved
>>    BayesFileFormatter cannot be resolved
>>    CommandLineUtil cannot be resolved
>>
>>    at
>>
>>org.apache.mahout.classifier.bayes.PrepareTwentyNewsgroups.main(PrepareTwentyNewsgroups.java:52)
>>)
>>    ... 6 more
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Total time: 3 seconds
>> [INFO] Finished at: Tue Sep 21 21:41:25 IST 2010
>> [INFO] Final Memory: 14M/34M
>> [INFO]
>> ------------------------------------------------------------------------
>>
>>
>>
>> --
>> Thanks and Regards
>> Neil
>> http://neilghosh.com
>>
>
>


-- 
Thanks and Regards
Neil
http://neilghosh.com

Hello All,


Re: Build Error in Twenty Newsgroups Classification Example

Posted by Neil Ghosh <ne...@gmail.com>.
Thanks Ted.

I just found that my  [mvn install] on the root directory had completed with
error before trying this .
Then I did "cd" to "core" and "examples" and compiled and installed.Both
were  successful.

After that this command ran fine and I could run the example.


On Tue, Sep 21, 2010 at 11:51 PM, Ted Dunning <te...@gmail.com> wrote:

> Did you do [mvn -DskipTests install] at the top level before trying this?
>
>
> On Tue, Sep 21, 2010 at 9:15 AM, Neil Ghosh <ne...@gmail.com> wrote:
>
>> Hi ,
>>
>> I am trying to run the example using Mahout 0.3 at
>> https://cwiki.apache.org/confluence/display/MAHOUT/Twenty+Newsgroups
>>
>> I have carried out all the steps but getting build error during this
>> command
>>
>> mvn -e exec:java \
>>
>>  -Dexec.mainClass=org.apache.mahout.classifier.bayes.PrepareTwentyNewsgroups
>> \
>>      -Dexec.args="-p 20news-18828 \
>>                   -o 20news-input \
>>                   -a org.apache.lucene.analysis.standard.StandardAnalyzer
>> \
>>                   -c UTF-8"
>>
>>
>> Please help, getting the following error.
>>
>> neil@neil-laptop:~/workspace/mahout-0.3/examples$ mvn -e exec:java \
>> >
>>
>> -Dexec.mainClass=org.apache.mahout.classifier.bayes.PrepareTwentyNewsgroups
>> \
>> >       -Dexec.args="-p 20news-18828 \
>> >                    -o 20news-input \
>> >                    -a
>> org.apache.lucene.analysis.standard.StandardAnalyzer
>> \
>> >                    -c UTF-8"
>> + Error stacktraces are turned on.
>> [INFO] Scanning for projects...
>> [INFO] Searching repository for plugin with prefix: 'exec'.
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Building Mahout Examples
>> [INFO]    task-segment: [exec:java]
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Preparing exec:java
>> [INFO] No goals needed for project - skipping
>> [INFO] [exec:java {execution: default-cli}]
>> [INFO]
>> ------------------------------------------------------------------------
>> [ERROR] BUILD ERROR
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] An exception occured while executing the Java class. null
>>
>> Unresolved compilation problems:
>>    DefaultOptionCreator cannot be resolved
>>    CommandLineUtil cannot be resolved
>>    BayesFileFormatter cannot be resolved
>>    CommandLineUtil cannot be resolved
>>
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Trace
>> org.apache.maven.lifecycle.LifecycleExecutionException: An exception
>> occured
>> while executing the Java class. null
>>    at
>>
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
>>    at
>>
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
>>    at
>>
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
>>    at
>>
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
>>    at
>>
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
>>    at
>>
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
>>    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
>>    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
>>    at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
>>    at
>> org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
>>    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:616)
>>    at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>>    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>>    at
>> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>>    at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
>> Caused by: org.apache.maven.plugin.MojoExecutionException: An exception
>> occured while executing the Java class. null
>>    at org.codehaus.mojo.exec.ExecJavaMojo.execute(ExecJavaMojo.java:346)
>>    at
>>
>> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
>>    at
>>
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
>>    ... 17 more
>> Caused by: java.lang.reflect.InvocationTargetException
>>    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:616)
>>    at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:291)
>>    at java.lang.Thread.run(Thread.java:636)
>> Caused by: java.lang.Error: Unresolved compilation problems:
>>    DefaultOptionCreator cannot be resolved
>>    CommandLineUtil cannot be resolved
>>    BayesFileFormatter cannot be resolved
>>    CommandLineUtil cannot be resolved
>>
>>    at
>>
>> org.apache.mahout.classifier.bayes.PrepareTwentyNewsgroups.main(PrepareTwentyNewsgroups.java:52)
>>    ... 6 more
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Total time: 3 seconds
>> [INFO] Finished at: Tue Sep 21 21:41:25 IST 2010
>> [INFO] Final Memory: 14M/34M
>> [INFO]
>> ------------------------------------------------------------------------
>>
>>
>>
>> --
>> Thanks and Regards
>> Neil
>> http://neilghosh.com
>>
>
>


-- 
Thanks and Regards
Neil
http://neilghosh.com

Re: Build Error in Twenty Newsgroups Classification Example

Posted by Ted Dunning <te...@gmail.com>.
Did you do [mvn -DskipTests install] at the top level before trying this?

On Tue, Sep 21, 2010 at 9:15 AM, Neil Ghosh <ne...@gmail.com> wrote:

> Hi ,
>
> I am trying to run the example using Mahout 0.3 at
> https://cwiki.apache.org/confluence/display/MAHOUT/Twenty+Newsgroups
>
> I have carried out all the steps but getting build error during this
> command
>
> mvn -e exec:java \
>
>  -Dexec.mainClass=org.apache.mahout.classifier.bayes.PrepareTwentyNewsgroups
> \
>      -Dexec.args="-p 20news-18828 \
>                   -o 20news-input \
>                   -a org.apache.lucene.analysis.standard.StandardAnalyzer \
>                   -c UTF-8"
>
>
> Please help, getting the following error.
>
> neil@neil-laptop:~/workspace/mahout-0.3/examples$ mvn -e exec:java \
> >
> -Dexec.mainClass=org.apache.mahout.classifier.bayes.PrepareTwentyNewsgroups
> \
> >       -Dexec.args="-p 20news-18828 \
> >                    -o 20news-input \
> >                    -a
> org.apache.lucene.analysis.standard.StandardAnalyzer
> \
> >                    -c UTF-8"
> + Error stacktraces are turned on.
> [INFO] Scanning for projects...
> [INFO] Searching repository for plugin with prefix: 'exec'.
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building Mahout Examples
> [INFO]    task-segment: [exec:java]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Preparing exec:java
> [INFO] No goals needed for project - skipping
> [INFO] [exec:java {execution: default-cli}]
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] An exception occured while executing the Java class. null
>
> Unresolved compilation problems:
>    DefaultOptionCreator cannot be resolved
>    CommandLineUtil cannot be resolved
>    BayesFileFormatter cannot be resolved
>    CommandLineUtil cannot be resolved
>
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Trace
> org.apache.maven.lifecycle.LifecycleExecutionException: An exception
> occured
> while executing the Java class. null
>    at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
>    at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
>    at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
>    at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
>    at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
>    at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
>    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
>    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
>    at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
>    at
> org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
>    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:616)
>    at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>    at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>    at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: org.apache.maven.plugin.MojoExecutionException: An exception
> occured while executing the Java class. null
>    at org.codehaus.mojo.exec.ExecJavaMojo.execute(ExecJavaMojo.java:346)
>    at
>
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
>    at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
>    ... 17 more
> Caused by: java.lang.reflect.InvocationTargetException
>    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:616)
>    at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:291)
>    at java.lang.Thread.run(Thread.java:636)
> Caused by: java.lang.Error: Unresolved compilation problems:
>    DefaultOptionCreator cannot be resolved
>    CommandLineUtil cannot be resolved
>    BayesFileFormatter cannot be resolved
>    CommandLineUtil cannot be resolved
>
>    at
>
> org.apache.mahout.classifier.bayes.PrepareTwentyNewsgroups.main(PrepareTwentyNewsgroups.java:52)
>    ... 6 more
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 3 seconds
> [INFO] Finished at: Tue Sep 21 21:41:25 IST 2010
> [INFO] Final Memory: 14M/34M
> [INFO]
> ------------------------------------------------------------------------
>
>
>
> --
> Thanks and Regards
> Neil
> http://neilghosh.com
>