I’m implementing a node following the NumberFormatter example and I’m getting this exception
ERROR ModalContext Node Loading model settings failed: Int for key "trials" not found.
org.knime.core.node.InvalidSettingsException: Int for key "trials" not found.
in the method
protected void validateSettings(final NodeSettingsRO settings) throws InvalidSettingsException
This happens when launching KNIME from Eclipse for node testing, the platform launches and the node runs, but it always uses the default options for each SettingsModel, no matter which value was set in the NodeDialog components.
This is the format that I’m using in my Node Model for the “trials” component, the remaining are the same.
//In MyNodeModel
private static final String KEY_TRIALS = "trials";
private static final int DEFAULT_TRIALS = 50000;
/*
* Rest of the KEY/DEFAULT pairs for parameters
*/
SettingsModelIntegerBounded trialsSettings = createTrialsSettingsModel();
/*
* Rest of SettingsModel instatiations
*/
public static SettingsModelIntegerBounded createTrialsSettingsModel() {
return new SettingsModelIntegerBounded(KEY_TRIALS, DEFAULT_TRIALS, 0, 1000000);
}
/*
* Rest of SettingsModel creation methods
*/
This is the format of the NodeDialog
//In MyNodeDialog
SettingsModelIntegerBounded trialsSettings = MyNodeModel.createTrialsSettingsModel();
/*
* Rest of SettingsModel instatiations
*/
addDialogComponent(new DialogComponentNumber(trialsSettings, "Number of Trials", 500));
/*
* Rest of DialogComponent creation
*/