DataTypeRegistry

Hi All, I am in the process of resurrecting a KNIME extension that I haven’t used in a while and am seeing some strange behavior. Maybe someone has a hint?

When my extension loads in KNIME it causes org.knime.jsnippets to fail to load because of an exception:

Caused by: java.lang.ExceptionInInitializerError
	at org.knime.base.node.jsnippet.JavaSnippet.cacheCustomTypeClasspaths(JavaSnippet.java:1262)
	at org.knime.base.node.jsnippet.JavaSnippetActivator.start(JavaSnippetActivator.java:68)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:779)

This is somehow triggered by my code not implementing the correct interface:

Caused by: java.lang.ClassCastException: inflor.knime.data.type.cell.fcs.FCSFrameCellFactory cannot be cast to org.knime.core.data.DataCellFactory
	at org.knime.core.data.DataTypeRegistry.availableDataTypes(DataTypeRegistry.java:187)
	at org.knime.core.data.convert.java.DataCellToJavaConverterRegistry.parseAnnotations(DataCellToJavaConverterRegistry.java:484)

I guess from reading this that I need to adjust my CellFactory class? It is currently setup to implement AbstractCellFactory but I wrote this code a while ago and don’t remember object model in this part of the KNIMEverse very well at all. Is there somewhere I can look to ready more details about this or an example implementation preferably using a filestore cell that I can have a look at?

Best,

Aaron

Hi @Aaron_Hart,
I think this is caused by the conversion framework being confused by your type somehow.
You should try annotating the method that can create a cell from a java type with the DataCellFactoryMethod annotation. Like this:

Also, you should double-check the datatype registration at the extension point in your plugin.xml file.

best,
Gabriel

1 Like

You can take a look at the implementation of the blob cell as an example for a filestore cell:

1 Like

Awesome, thanks a lot for the speedy reply. I’ll have a look.

1 Like

Hi, I would like to import flow cytometry data and found a reference to Aaron’s nodes (. However, they are not available in the add extension function of knime and I was wondering whether by ‘resurrecting a knime extension’ you were referring to these nodes. It would be great if you could let me know how to implement these nodes. --Thanks & Best, Attila

Hi GreenGripper,

Missed your message, the nodes aren’t actively maintained as I built them mostly for myself, but I can provide you with access if you’re still interested.