NullPointerException with selfmade Plugin

cherokee
cherokee New Altair Community Member
edited November 5 in Community Q&A
Hi!

I've found another small bug.  In a plugin manifest you can name an PluginInit-class (see whitepaper). If you don't do this rapidminer hangs with an NullPointerException. The reason is in [tt]Plugin.showAboutBox[/tt] (as of 5.0.006):
public boolean showAboutBox() {
try {
Class<?> pluginInitator = Class.forName(pluginInitClassName, false, getOriginalClassLoader());
Method initGuiMethod = pluginInitator.getMethod("showAboutBox", new Class[] {});
Boolean showAboutBox = (Boolean) initGuiMethod.invoke(null, new Object[] {});
return showAboutBox.booleanValue();
} catch (ClassNotFoundException e) {
} catch (SecurityException e) {
} catch (NoSuchMethodException e) {
} catch (IllegalArgumentException e) {
} catch (IllegalAccessException e) {
} catch (InvocationTargetException e) {
}
return true;
}
The problem is pluginInitClassName. If you don't supply a name for the plugin init class this variable is [tt]null[/tt] and [tt]Class.forName[/tt] issues a NullPointerException. Though you catch many exception types you forgot this one  ;)

As workaround till the next update just use an initialisation class with empty methods.

Best regards,
chero

Answers

  • fischer
    fischer New Altair Community Member
    Hi,

    thanks for reporting this. It is fixed.

    Cheers,
    Simon