Can't load new UI after installing an internal feature

Hi

I’m trying to finally allow internal users to properly use the new UI when our internal nodes are installed.

In KNIME 5.2 and 5.3 we just get a blank screen when switching to the new UI. I’ve done some debugging and found that we’re getting an exception thrown when it tries to load one of our internal nodes, instead of just breaking the node tree like it used to the entire frontend doesn’t load now :D.

I’m trying to fix the node but I’m having trouble identifying how I’ve caused the issue.

I’ve check out the knime-workbench git repo and added some extra error handling to try get some more information, but all I’ve got is a longer stack trace :smiley:

java.lang.ClassCastException: class org.lhasalimited.xxx.xxxReaderNodeFactory cannot be cast to class org.knime.core.node.ConfigurableNodeFactory ( org.lhasalimited.xxx.xxxReaderNodeFactory is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @f105010; org.knime.core.node.ConfigurableNodeFactory is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @2e90ffea)
	at org.knime.workbench.repository.util.ConfigurableNodeFactoryMapper.<clinit>(ConfigurableNodeFactoryMapper.java:92)
	at org.knime.workbench.explorer.view.AbstractContentProvider.getWorkspaceImage(AbstractContentProvider.java:1322)
	at org.knime.workbench.explorer.localworkspace.LocalWorkspaceContentProvider.getImage(LocalWorkspaceContentProvider.java:249)
	at org.knime.workbench.explorer.view.ContentDelegator.getImage(ContentDelegator.java:467)
	at org.eclipse.jface.viewers.WrappedViewerLabelProvider.getImage(WrappedViewerLabelProvider.java:101)
	at org.eclipse.jface.viewers.WrappedViewerLabelProvider.update(WrappedViewerLabelProvider.java:146)
	at org.eclipse.jface.viewers.ViewerColumn.refresh(ViewerColumn.java:149)
	at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:973)
	at org.eclipse.jface.viewers.AbstractTreeViewer$UpdateItemSafeRunnable.run(AbstractTreeViewer.java:131)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)

The error starts from ConfigurableNodeFactoryMapper

This exception type isn’t caught by the catch

} catch (InvalidRegistryObjectException | CoreException e) {
                LOGGER.error("File extension handler from contributor \"" + element.getContributor().getName()
                    + "\" doesn't properly load -- ignoring it.", e);
            } 

Extending the catch to also catch this means the front end does load (though presumably with some missing functionality).

I’m going to keep debugging but thought I’d raise a post now in case there’s any tips on what to be checking :).

Cheers

Sam

1 Like

For the node relating to this error I’ve updated the node factory to extend ConfigurableNodeFactory which is the class it’s trying to cast to. I should have tried that first but it wasn’t obvious to me that this was actually needed given all my other nodes just extend NodeFactory and work fine.

I’m assuming this is needed because the node is associated with a org.knime.workbench.repository.registeredFileExtensions extension point.

Maybe it is worth updating the catch to include ClassCastException as it would be better for the single node to not be usable rather than the entire application becomes unusable. When hitting this in a production instance initially I had to go and find the setting file to change the value of to set it back to the old UI.

Cheers

Sam

Hi @swebb

Thank you for reporting this issue, I made our developers aware of this problem.
Your suggestion for a fix sounds quite easy to implement, so we will likely ship it soon.

best,
Gabriel

1 Like

Thank you :slight_smile:

It seems it was a result of a mistake I made years ago not using the right NodeFactory when linking the file association but if we can protect my users from my mistakes that would be appreciated :smiley:

2 Likes