"Can't find a permissible class" error

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

"Can't find a permissible class" error

talberi
I'm working on integrating Weka into a Java plug-in I'm developing for
another application. To do this, I added weka.jar to the plug-in's build
path. So far, most things are working correctly. I can train classifiers and
evaluate data with them. The one thing I can't get working properly is the
GenericObjectEditor when setting classifier options.  For instance, when I
try to use it on an AdaBoostM1 classifier, I get an error message that
includes the following:

WARNING: failed to copy option handler weka.classifiers.meta.AdaBoostM1 with
options -P 100 -S 1 -I 10 -W weka.classifiers.trees.DecisionStump --- trying
deep copy instead
java.lang.Exception: Can't find a permissible class called:
weka.classifiers.meta.AdaBoostM1
        weka.core.ResourceUtils.forName(ResourceUtils.java:84)
        weka.core.Utils.forName(Utils.java:1080)
        weka.core.OptionHandler.makeCopy(OptionHandler.java:80)
        weka.gui.GenericObjectEditor.makeCopy(GenericObjectEditor.java:1959)

weka.gui.GenericObjectEditor$GOEPanel.copyObject(GenericObjectEditor.java:961)
        weka.gui.GenericObjectEditor$GOEPanel.<init>(GenericObjectEditor.java:749)
        weka.gui.GenericObjectEditor.getCustomEditor(GenericObjectEditor.java:1612)
        weka.gui.PropertyDialog.initialize(PropertyDialog.java:150)
        weka.gui.PropertyDialog.<init>(PropertyDialog.java:120)

Looking at the Weka source code, I think this error traces back to the
WekaPackageClassLoaderManager class, which can't find the AdaBoostM1 class.
Is there any reason that I won't be able to find it? Do I need to do
something else with my build path for the loader manager to be able to find
the class?

Thanks.





--
Sent from: https://weka.8497.n7.nabble.com/
_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to [hidden email]
To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: "Can't find a permissible class" error

Eibe Frank-2
Administrator
This seems a bit strange because AdaBoostM1 is part of the WEKA core distribution and is included in weka.jar.

Can you create AdaBoostM1 objects elsewhere in your plug-in?

If you want to be able to access code from installed WEKA packages via your plug-in, you will need to get the WekaClassLoader to load all packages using

weka.core.WekaPackageManager.loadPackages(true)

Cheers,
Eibe

> On 14/05/2020, at 11:47 PM, talberi <[hidden email]> wrote:
>
> I'm working on integrating Weka into a Java plug-in I'm developing for
> another application. To do this, I added weka.jar to the plug-in's build
> path. So far, most things are working correctly. I can train classifiers and
> evaluate data with them. The one thing I can't get working properly is the
> GenericObjectEditor when setting classifier options.  For instance, when I
> try to use it on an AdaBoostM1 classifier, I get an error message that
> includes the following:
>
> WARNING: failed to copy option handler weka.classifiers.meta.AdaBoostM1 with
> options -P 100 -S 1 -I 10 -W weka.classifiers.trees.DecisionStump --- trying
> deep copy instead
> java.lang.Exception: Can't find a permissible class called:
> weka.classifiers.meta.AdaBoostM1
> weka.core.ResourceUtils.forName(ResourceUtils.java:84)
> weka.core.Utils.forName(Utils.java:1080)
> weka.core.OptionHandler.makeCopy(OptionHandler.java:80)
> weka.gui.GenericObjectEditor.makeCopy(GenericObjectEditor.java:1959)
>
> weka.gui.GenericObjectEditor$GOEPanel.copyObject(GenericObjectEditor.java:961)
> weka.gui.GenericObjectEditor$GOEPanel.<init>(GenericObjectEditor.java:749)
> weka.gui.GenericObjectEditor.getCustomEditor(GenericObjectEditor.java:1612)
> weka.gui.PropertyDialog.initialize(PropertyDialog.java:150)
> weka.gui.PropertyDialog.<init>(PropertyDialog.java:120)
>
> Looking at the Weka source code, I think this error traces back to the
> WekaPackageClassLoaderManager class, which can't find the AdaBoostM1 class.
> Is there any reason that I won't be able to find it? Do I need to do
> something else with my build path for the loader manager to be able to find
> the class?
>
> Thanks.
>
>
>
>
>
> --
> Sent from: https://weka.8497.n7.nabble.com/
> _______________________________________________
> Wekalist mailing list -- [hidden email]
> Send posts to [hidden email]
> To unsubscribe send an email to [hidden email]
> To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
> List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to [hidden email]
To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html