Custom port issue

Hi,

I'm getting following errors when I'm trying to register my custom port as an extension.

ERROR     ModalContext PortTypeRegistry     Could not create port object serializer for 'some.package.SomePortObject' from plug-in 'some.plugin': Plug-in "some.plugin" was unable to instantiate class "some.package.SomePortObject$SomeSerializer".
ERROR     ModalContext PortTypeRegistry     CODING PROBLEM    Port object implementation 'some.package.SomePortObject' is not registered at extension point 'org.knime.core.PortType' via it's serializer, using buddy classloading as fallback. Please change your implementation and use the extension point.

The class for serializer exists.

Any ideas what could be a problem?

 

 

 

Have you added this to the relevent extension point?

Yes I did as follows:

      <extension
         point="org.knime.core.PortType">
      <portType
            hidden="false"
            name="some.plugin.portType2"
            objectClass="some.package.SomePortObject"
            objectSerializer="some.package.SomePortObject$SomeSerializer"
            specClass="some.package.SomePortObjec"
            specSerializer="some.package.SomePortObject$SomeSerializer">
      </portType>
   </extension>

 

Did you declare the inner class SomeSerializer public static?

Thanks qqilihq. It helped. I had it defined with default access modifier.

Then I had problems with generics. I resolved it too.

But now I have another problem. When I'm loading the workflow I got following errors:

 

Unable to load node with ID suffix 674 into workflow, skipping it: null

Unable to load node with ID suffix 675 into workflow, skipping it: null

 

When I open the workflow the node is missing. When I try to add it I get follwoing error:

 

Node cannot be created.

The selected node could not be created due to the following reason:

Could not initialize class some.package.SomeNodeModel.

 

Any idea what could cause this issue?

 

I enabled debug logs. I found this, but I'm still hopeless.

 

Caused by: java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.TypeVariableImpl cannot be cast to java.lang.Class
    at org.knime.core.node.port.PortObject$PortObjectSerializer.getObjectClass(PortObject.java:170)
    at org.knime.core.node.port.PortTypeRegistry.createObjectSerializer(PortTypeRegistry.java:467)
    at org.knime.core.node.port.PortTypeRegistry.scanExtensionPointForObjectSerializer(PortTypeRegistry.java:436)
    at org.knime.core.node.port.PortTypeRegistry.getObjectClass(PortTypeRegistry.java:228)
    at org.knime.core.node.port.PortTypeRegistry.createPortTypes(PortTypeRegistry.java:161)
    at org.knime.core.node.port.PortTypeRegistry.getPortType(PortTypeRegistry.java:198)
    at org.knime.core.node.port.PortTypeRegistry.getPortType(PortTypeRegistry.java:177)

 

Any idea what could be a problem?