Mol2Cell Troubles

Greetings Everyone!

Ive little question.
I am going to write a new Node and thats why I am trying a few things befor I begin to start the Node development.
The first thing Ive tried is to read a Mol2(1) (from Code) - do something with it(2) - and return it back to another Node(3).

(1) This step Ive simply tried with reading a Mol2 File and saving all its content into a Variable.

(2) Now I am going to do something with it.

(3) And here comes the Problem. I want to "bypass" the (internal) Mol2 File now.
I think I have to convert it first to a Mol2Cell and then simply return it.
But I get an Error if I do so.
Here is my Code:

    protected BufferedDataTable[] execute(final BufferedDataTable[] inData,
            final ExecutionContext exec) throws Exception {
     * Defining our Result Table...
    String[] Header = new String[2];	//Creating the Header of the Table.
    Header[0] = "Test";
    Header[1] = "Molecule";
    DataType[] types = new DataType[2]; //Defining the Types of the Header.
    types [0] = StringCell.TYPE;
    types [1] = Mol2Cell.TYPE;
    DataTableSpec dataSpec = new DataTableSpec(Header,types);
     * Filling our Result Table...
    BufferedDataContainer table = exec.createDataContainer(dataSpec, false);
    String Molecule  = readFile("/home/imax/test.mol2"); // (1)
    /* (2)
     * Do Something with Molecule...
     * Also if I don't touch the Molecule the error occurs.
    DataRow row = new DefaultRow(new RowKey("Test_" + Integer.toString(0)), new DataCell[]{
    		new StringCell ("Atom"),
    		new Mol2Cell   (Molecule)});
    return new BufferedDataTable[]{table.getTable()}; //(3)

Now if i start my Node there comes a red cross (Error-Icon) below my Node with the Tooltip: "Execute failed: org/knime/chem/types/Mol2Cell".

Somebody know what I am doing wrong?
Thanks for your help!

PS: I wanted to check the code from Mol2-Reader but I dont found the Source. Maybe because its not opensource ;) NVM.

It sounds as if it doesn't resolve the dependency to the chem.types plugin correctly.

Did you add the dependency in the 'plugin.xml' (which is the way to go) or by using eclipse' properties page (right clicking the project -> properties -> java build path)? Don't do the latter! The list in the "Java Build Path", tab "Libraries", should only contain two entries, which are "JRE System Library" and "Plug-in Dependencies".

What you should do instead is to open the plugin.xml file of your plugin and then add the 'org.knime.chem.types' plugin to the list on the left in tab 'Dependencies'.

I hope this fixes your problem. This procedure is currently not well documented (at least not on our web page). Sorry for that.

Best regards

PS: The sources to all our plugins are available in separate plugins. You should find those plugins when you browse our update site.

Hi wiswedel,

Ive added the dependency using the properties page from Eclipse because Eclipse was unable to resolve the "import org.knime.chem..." and "Mol2Cell" and so on.
But I will try now to add the depedency using the "plugin.xml".

I will report whether this was the solution or not.

Thank you very much for your help.
I appreciate your support.


Hi again,

Thank you wiswedel!
Your advice was the solution for my problem :)
Works very nice now w\o changing one line of code.