"Not found class moa.DoTask" problem while using weka classifiers

321 views
Skip to first unread message

Zara Rezaie

unread,
Jul 31, 2016, 3:09:26 AM7/31/16
to MOA users
Hi all,

I tried to use weka classifiers in moa through the command line, but got this error.


java -Xmx1G -cp moa.jar:weka.jar -javaagent:sizeofag.jar moa.DoTask "LearnModel \ -l (WekaClassifier -l weka.classifiers.trees.J48) \ -s generators.WaveformGenerator -m 1000000 -O model1.moa"


Error: Could not find or load main class moa.DoTask


So what's wrong in the command. I copied it from the moa manual.PDF.  
Using moa-2014.11 and weka-3-8-0-x64

Thanks in advance
Zara Rezaie

Albert Bifet

unread,
Aug 5, 2016, 7:09:48 AM8/5/16
to MOA users
Do you have moa.jar and weka.jar in the directory where you're running
the command?

Cheers, Albert
> --
> You received this message because you are subscribed to the Google Groups
> "MOA users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to moa-users+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Zahra Rezaie

unread,
Aug 5, 2016, 9:32:00 AM8/5/16
to moa-...@googlegroups.com

Yes. I copied weka in the folder where moa was there. I have no problem while using moa on its own, but when I wanna run weka classifiers through moa commands I got that error.



> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "MOA users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/moa-users/YrUfNmZHups/unsubscribe.
To unsubscribe from this group and all its topics, send an email to moa-users+unsubscribe@googlegroups.com.

Albert Bifet

unread,
Aug 5, 2016, 10:39:05 AM8/5/16
to MOA users
Do you have moa.jar in the folder?

Cheers, Albert
>> > email to moa-users+...@googlegroups.com.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "MOA users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/moa-users/YrUfNmZHups/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> moa-users+...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "MOA users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to moa-users+...@googlegroups.com.

Zara Rezaie

unread,
Aug 6, 2016, 3:09:19 AM8/6/16
to MOA users, abi...@cs.waikato.ac.nz
Oh, I just checked it and turns out I had weka.exe in the folder.  I replaced it with weka.jar (found it in moa2016.04/lib), but I got the same error. this weka version is weka-dev-3.7.12.jar (needless to say but I renamed it to just weka.jar.  

Albert Bifet

unread,
Aug 6, 2016, 3:47:41 AM8/6/16
to Zara Rezaie, MOA users
And do you have moa.jar in the folder?

Cheers, Albert

Zara Rezaie

unread,
Aug 6, 2016, 3:50:44 AM8/6/16
to MOA users, z.rez...@gmail.com, abi...@cs.waikato.ac.nz

Yes, I have these three jar files all in one folder:
moa.jar
sizeofag.jar
weka.jar

Zara Rezaie

unread,
Aug 6, 2016, 4:01:43 AM8/6/16
to MOA users, z.rez...@gmail.com, abi...@cs.waikato.ac.nz
I' like to add that now I'm using: moa-2014.11 and  weka-dev-3.7.12.jar. Isn't there something about incompatibility?

Albert Bifet

unread,
Aug 6, 2016, 1:53:01 PM8/6/16
to Zara Rezaie, MOA users
Are you using Windows? If you're using Windows you need to use -cp moa.jar;weka.jar instead of -cp moa.jar:weka.jar.

Cheers, Albert

Zara Rezaie

unread,
Aug 8, 2016, 1:37:05 AM8/8/16
to MOA users, z.rez...@gmail.com, abi...@cs.waikato.ac.nz
I used -cp moa.jar;weka.jar but I got this error: 

java.lang.Exception: Problem with options to 'LearnModel'.

Thanks

Albert Bifet

unread,
Aug 8, 2016, 4:21:33 AM8/8/16
to MOA users, Zahra Rezaie
Use java -Xmx1G -cp moa.jar;weka.jar -javaagent:sizeofag.jar moa.DoTask "LearnModel  -l (WekaClassifier -l weka.classifiers.trees.J48) -s generators.WaveformGenerator -m 1000000 -O model1.moa"

Cheers, Albert


To unsubscribe from this group and stop receiving emails from it, send an email to moa-users+unsubscribe@googlegroups.com.

Zara Rezaie

unread,
Aug 8, 2016, 5:06:01 AM8/8/16
to MOA users, z.rez...@gmail.com, abi...@cs.waikato.ac.nz
That's exactly what I used before and got that  error. I tested copied and ran your command again but the same error occurred.

java.lang.Exception: Problem with options to 'LearnModel'.


        at moa.options.ClassOption.cliStringToObject(ClassOption.java:156)
        at moa.DoTask.main(DoTask.java:130)
Caused by: java.lang.IllegalArgumentException: Problems with option: learner
        at moa.options.ClassOption.setValueViaCLIString(ClassOption.java:69)
        at moa.options.Options.setViaCLIString(Options.java:145)
        at moa.options.ClassOption.cliStringToObject(ClassOption.java:154)
        ... 1 more
Caused by: java.lang.Exception: Class not found: WekaClassifier
        at moa.options.ClassOption.cliStringToObject(ClassOption.java:128)
        at moa.options.ClassOption.setValueViaCLIString(ClassOption.java:67)
        ... 3 more

Albert Bifet

unread,
Aug 10, 2016, 8:31:33 AM8/10/16
to MOA users, Zahra Rezaie
Caused by: java.lang.Exception: Class not found: WekaClassifier

It seems that now the problem is in using WekaClassifier. Try with meta.WEKAClassifer.

Cheers, Albert

To unsubscribe from this group and stop receiving emails from it, send an email to moa-users+unsubscribe@googlegroups.com.

Zara Rezaie

unread,
Aug 11, 2016, 2:04:24 AM8/11/16
to MOA users, z.rez...@gmail.com, abi...@cs.waikato.ac.nz
Due to your suggestion I used this command, but got the same error with the options to 'LearnModel'

java -Xmx1G -cp moa.jar;weka.jar -javaagent:sizeofag.jar moa.DoTask "LearnModel -l (meta.WEKAClassifer -l weka.classifiers.trees.J48) -s generators.WaveformGenerator -m 100000 -O model1.moa"


errors: 

Problems with option: learner
Class not found: meta.WEKAClassifer

muthu veerappan alagappan

unread,
Oct 12, 2016, 8:28:54 AM10/12/16
to MOA users, z.rez...@gmail.com, abi...@cs.waikato.ac.nz
I have the same issue with WEKA 3.8.0 and MOA 2016.04, Please update us how to use

muthu veerappan alagappan

unread,
Oct 12, 2016, 9:50:57 AM10/12/16
to MOA users, z.rez...@gmail.com, abi...@cs.waikato.ac.nz
I am sorry, I found the error now, "meta.WEKAClassifer" instead of "meta.WEKAClassifier"

It works fine, though there was another jar bounce.jar required in the classpath after adding it worked

Thanks

Zara Rezaie

unread,
Oct 12, 2016, 10:28:22 AM10/12/16
to MOA users, z.rez...@gmail.com, abi...@cs.waikato.ac.nz
You're right! Thanks.
Now I got another problem which I copied it below. What is bounce.jar? From where can I download it and in which directory should I put it then?

Task failed. Reason:
java.lang.NoClassDefFoundError: org/pentaho/packageManagement/PackageManager
        at weka.core.WekaPackageManager.<clinit>(WekaPackageManager.java:80)
        at weka.core.Utils.readProperties(Utils.java:141)
        at weka.core.Capabilities.<init>(Capabilities.java:261)
        at weka.classifiers.trees.j48.ClassifierTree.getCapabilities(ClassifierT
ree.java:113)
        at weka.classifiers.trees.j48.C45PruneableClassifierTree.getCapabilities
(C45PruneableClassifierTree.java:92)
        at weka.classifiers.trees.j48.C45PruneableClassifierTree.buildClassifier
(C45PruneableClassifierTree.java:120)
        at weka.classifiers.trees.J48.buildClassifier(J48.java:293)
        at moa.classifiers.meta.WEKAClassifier.buildClassifier(WEKAClassifier.ja
va:152)
        at moa.classifiers.meta.WEKAClassifier.trainOnInstanceImpl(WEKAClassifie
r.java:109)
        at moa.classifiers.AbstractClassifier.trainOnInstance(AbstractClassifier
.java:147)
        at moa.tasks.LearnModel.doMainTask(LearnModel.java:96)
        at moa.tasks.MainTask.doTaskImpl(MainTask.java:50)
        at moa.tasks.AbstractTask.doTask(AbstractTask.java:57)
        at moa.tasks.TaskThread.run(TaskThread.java:76)
Caused by: java.lang.ClassNotFoundException: org.pentaho.packageManagement.Packa
geManager
        at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 14 more
Reply all
Reply to author
Forward
0 new messages