Issue with loading old R-nodes from the community extension

Hi there,

I put my question here (though it would belong to the R community extension forum), as I do not know how to troubleshoot the issue.

since KNIME 4.2 we cannot load a workflow anymore which contains R-nodes (Community extension) from 2015.
KNIME asks to search for the nodes which seems to be successful. Installation works but after restarting KNIME the nodes are still not available. Though the software now claims to have the extension installed.
I will attach the log-file as well as the workflow.

knime.log (3.2 KB)
03_visualizeData2.knwf (48.5 KB)

I would be very happy if anybody can explain to me what is going wrong there and why it did not happen before KNIME 4.2 and how this can be fixed (if at all) It’s one of our course workflows which is given regularly, so I am sure, that it worked at least until end of 2019.

Hi @niederle,

I just took a look at this issue and it seems this is caused by the deactivation of the buddy classloading. See the following section of the release notes (https://www.knime.com/whats-new-in-knime-42):

KNIME Analytics Platform 4.2 no longer uses “Buddy Classloading” to find nodes and types in third party extensions. Nodes and types need to be properly registered through the respective extension point. For an exemplary fix of this issue, see this code change. Failing to do so will likely cause (old) workflows containing those nodes to load these nodes using a “missing node placeholder”.

All you need to do is to register all deprecated nodes in the plugin.xml file (don’t forget to set them to deprecated = true).

Also it is probably a good idea to migrate that workflow to the newer version of your node.

best,
Gabriel

2 Likes

Thanks a lot for your explanation. It seems to be likely that this causes the issue. I’ll give it a try.
(Indeed, it is a good idea to update the workflows :slight_smile:)

Best,
Antje

@gab1one
I’ve digged into my git history and it looks like a relocation of node classes causes the problem. So the missing nodes are no deprecated nodes but their package location changed.
Do you know of any way to register previous location? (like a lookup table)

Best,
Antje

Hi Antje,

Yes there is a way to do this, you need to use the NodeFactoryClassMapper extension point:

  1. Define the extension point:
   <extension
         point="org.knime.core.NodeFactoryClassMapper">
      <NodeFactoryClassMapper
            classMapper="org.knime.example.ExampleNodeFactoryClassMapper">
      </NodeFactoryClassMapper>
   </extension>
  1. Implement the mapping:
import org.knime.example.current.package.ExampleNodeFactory;

public class ExampleNodeFactoryClassMapper extends MapNodeFactoryClassMapper {

    @Override
    protected Map<String, Class<? extends NodeFactory<? extends NodeModel>>> getMapInternal() {
        final Map<String, Class<? extends NodeFactory<? extends NodeModel>>> map = new HashMap<>();
        // set the mappings 
        map.put("org.knime.example.old.package.NodeFactory", ExampleNodeFactory.class);
        return map;
    }
}

best,
Gabriel

Thanks a lot!
The instructions are very useful and I could solve the problem :slight_smile:
Best,
Antje

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.