Hi guys, i have (another) problem: I'm developing a predictor node with 2 input ports (MyModel, BufferedDataTable) and 1 output port (BufferedDataTable). When i try to insert the node in a workflow i receive this message:
ERROR PredictorDc Configure failed (NullPointerException): null
I search it in the forum, but all the answers are too specific for each case.
I understand the problem could be that the node try to configure itself as I insert it into the workflow and it has no inputs. But why i do not receive this message by others node wich do the same? (e.g. decisiontree)
Can anyone help me? How can i fix it?
Here my code: (i follow the example on the site)
/** {@inheritDoc} */
@Override
protected PortObjectSpec[] configure(final PortObjectSpec[] inSpecs) throws InvalidSettingsException {
// produce the output table spec,
DataColumnSpec newColumnSpec = createOutputColumnSpec();
// and the DataTableSpec for the appended part
DataTableSpec appendedSpec = new DataTableSpec(newColumnSpec);
// since it is only appended the new output spec contains both:
// the original spec and the appended one
DataTableSpec outputSpec = new DataTableSpec((DataTableSpec) inSpecs[IN_PORT_DATATABLE], appendedSpec);
return new PortObjectSpec[]{outputSpec};
//return new PortObjectSpec[]{inSpecs[1]};
}
private DataColumnSpec createOutputColumnSpec() {
// we want to add a column with the infered result
DataColumnSpecCreator colSpecCreator = new DataColumnSpecCreator("Infered", StringCell.TYPE);
// now the column spec can be created
DataColumnSpec newColumnSpec = colSpecCreator.createSpec();
return newColumnSpec;
}
P.S. I wrote the post with the help of Google Translate, so I apologize for any errors