Need help with plugin transition to Java11

Hi there,

KNIME 4.4 is already there for a while. In the past month, I had little time to take care about our plugins (HCS-Tools and Knime-Scripting) but now, I wanted to get the plugins up and running for KNIME 4.4.
I switched everything to Java11 but I cannot get rid of the following error message:

The package org.w3c.dom is accessible from more than one module: , java.xml

I tried several things but nothing seems to work. I hope someone can help me to troubleshoot and resolve this issue.

Best,
Antje

2 Likes

Hi Antje,

we ran into the same problem with the Palladian and Selenium Nodes.

The root issue is, that Java 11 seems pickier with duplicated classes on the class path (this is probably expressed rather naively, but I’m lacking the detailed backgrounds – more details here)

At the end, both of our node plugins (Palladian, Selenium) had a (transitive) dependency to xml-apis which duplicated standard classes org.w3c.*. After removing this (we use a Maven-Tycho build, so I just excluded them by adding an <exclusion>), the issue was fixed.

Hope this helps. Feel free to get back if you need any clarification!

Best,
Philipp

5 Likes

Hi Philipp,

I don’t use maven. Do you have any suggestion for me how to find out which dependency might cause such a duplication? I guess, in my case it has also to do with the org.w3c-classes.

Best,
Antje

I think I went through the “Open Type” window of Eclipse (cmd+shift+T) and entered one of the conflicting class names (e.g. org.w3c.Document). This would show then all occurrences of the class (and in your case there should be more than one, beside the JDK packages). The window should show you the name of the location/JAR files and you should be able to work from there and remove this.

Hope this helps!

– Philipp

1 Like

I found the Target Platform State view very helpful for this:
image
You can filter for a package and it then lists all plugins that import it and where they get it from:

What I also found, is that some libraries package all their dependencies into the same jar, which can also lead to this a problem, in that case I had to delete the org.w3c.dom classes from the jar itself.

1 Like

I tried the ‘Open Type’ window with one of the classes where the import shows up with this error message but all I get is the following window:

I also tried to look at the Target Platform State and I wish, I could copy/paste the content. The list is very long and I get several libraries which show up with supplied by [something else than 'the JRE']
for example:
nu.xom, org.apache.batik.*, org.apache.xalan,
I’m not sure how much that helps? Or would I just have to watch out for libraries I did define as dependency (like nu.xom).

You only need to look for the libraries that you have direct or transitive dependencies on,
your plugin is not exposed to any other ones.

Hi Antje,

Take a look at this PR: Update to java11 by gab1one · Pull Request #121 · knime-mpicbg/HCS-Tools · GitHub
That should fix your issues, I looked at the libraries contained in the HCS libs plugin and was able to identify the issue. The contained jchempaint and cdk binaries contain a UserDataHandler.class in the w3c.dom package which is a copy from the one contained in the JRE, I deleted the packages from the jars and now everything seems to work again

best,
Gabriel

@gab1one
Sorry for my very late reply and thank you very much for your help! I did not have time to work on it since weeks…
I checked the usage of these binaries and managed to get rid of them completely. Now I do not get any compilation errors anymore but running my testflows gives errors for all of my nodes. Something like this. Any hint where to look for a solution?


2021-12-20 13:37:23,758 : ERROR : KNIME-Worker-0-Expand Barcode 0:1 :  : Node : Expand Barcode : 0:1 : Execute failed: org.knime.core.data.container.Buffer (initialization failure)
java.lang.NoClassDefFoundError: org.knime.core.data.container.Buffer (initialization failure)
	at java.base/java.lang.J9VMInternals.initializationAlreadyFailed(J9VMInternals.java:134)
	at org.knime.core.data.container.BufferedDataContainerDelegate$NoKeyBufferCreator.createBuffer(BufferedDataContainerDelegate.java:908)
	at org.knime.core.data.container.BufferedDataContainerDelegate.close(BufferedDataContainerDelegate.java:432)
	at org.knime.core.data.container.DataContainer.close(DataContainer.java:347)
	at org.knime.core.data.container.RearrangeColumnsTable.create(RearrangeColumnsTable.java:417)
	at org.knime.core.data.container.BufferedTableBackend.rearrange(BufferedTableBackend.java:155)
	at org.knime.core.node.ExecutionContext.createColumnRearrangeTable(ExecutionContext.java:432)
	at de.mpicbg.knime.hcs.base.nodes.layout.expandbarcode2.ExpandPlateBarcodeModel2.execute(ExpandPlateBarcodeModel2.java:183)
	at org.knime.core.node.NodeModel.execute(NodeModel.java:758)
	at org.knime.core.node.NodeModel.executeModel(NodeModel.java:549)
	at org.knime.core.node.Node.invokeFullyNodeModelExecute(Node.java:1267)
	at org.knime.core.node.Node.execute(Node.java:1041)
	at org.knime.core.node.workflow.NativeNodeContainer.performExecuteNode(NativeNodeContainer.java:559)
	at org.knime.core.node.exec.LocalNodeExecutionJob.mainExecute(LocalNodeExecutionJob.java:95)
	at org.knime.core.node.workflow.NodeExecutionJob.internalRun(NodeExecutionJob.java:201)
	at org.knime.core.node.workflow.NodeExecutionJob.run(NodeExecutionJob.java:117)
	at org.knime.core.util.ThreadUtils$RunnableWithContextImpl.runWithContext(ThreadUtils.java:365)
	at org.knime.core.util.ThreadUtils$RunnableWithContext.run(ThreadUtils.java:219)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at org.knime.core.util.ThreadPool$MyFuture.run(ThreadPool.java:123)
	at org.knime.core.util.ThreadPool$Worker.run(ThreadPool.java:246)
Caused by: java.lang.AssertionError: Could not find tenured space
	at org.knime.core.data.util.memory.MemoryAlertSystem.findTenuredGenPool(MemoryAlertSystem.java:423)
	at org.knime.core.data.util.memory.MemoryAlertSystem.<clinit>(MemoryAlertSystem.java:118)
	at org.knime.core.data.container.BufferCache.<init>(BufferCache.java:156)
	at org.knime.core.data.container.Buffer.<clinit>(Buffer.java:401)
	at org.knime.core.data.container.BufferedDataContainerDelegate$BufferCreator.createBuffer(BufferedDataContainerDelegate.java:877)
	at org.knime.core.data.container.CopyOnAccessTask.createBuffer(CopyOnAccessTask.java:243)
	at org.knime.core.data.container.CopyOnAccessTask.createBuffer(CopyOnAccessTask.java:152)
	at org.knime.core.data.container.BufferedContainerTable.ensureBufferOpen(BufferedContainerTable.java:344)
	at org.knime.core.data.container.BufferedContainerTable.size(BufferedContainerTable.java:175)
	at org.knime.core.node.BufferedDataTable.size(BufferedDataTable.java:490)
	at org.knime.core.data.container.WrappedTable.size(WrappedTable.java:120)
	at org.knime.core.node.BufferedDataTable.size(BufferedDataTable.java:490)
	at org.knime.core.data.container.RearrangeColumnsTable.calcNewColsSynchronously(RearrangeColumnsTable.java:487)
	at org.knime.core.data.container.RearrangeColumnsTable.create(RearrangeColumnsTable.java:412)
	... 17 more
2021-12-20 13:37:23,759 : DEBUG : KNIME-Worker-0-Expand Barcode 0:1 :  : WorkflowManager : Expand Barcode : 0:1 : Expand Barcode 0:1 doBeforePostExecution
2021-12-20 13:37:23,759 : DEBUG : KNIME-Worker-0-Expand Barcode 0:1 :  : NodeContainer : Expand Barcode : 0:1 : Expand Barcode 0:1 has new state: POSTEXECUTE
2021-12-20 13:37:23,760 : DEBUG : KNIME-Worker-0-Expand Barcode 0:1 :  : WorkflowManager : Expand Barcode : 0:1 : Expand Barcode 0:1 doAfterExecute - failure
2021-12-20 13:37:23,760 : DEBUG : KNIME-Worker-0-Expand Barcode 0:1 :  : Node : Expand Barcode : 0:1 : reset
2021-12-20 13:37:23,760 : DEBUG : KNIME-Worker-0-Expand Barcode 0:1 :  : Node : Expand Barcode : 0:1 : clean output ports.
2021-12-20 13:37:23,760 : DEBUG : KNIME-Worker-0-Expand Barcode 0:1 :  : WorkflowDataRepository : Expand Barcode : 0:1 : Removing handler 05048254-559c-4814-ab8c-e719043558bc (Expand Barcode 0:1: <no directory>) - 0 remaining
2021-12-20 13:37:23,761 : DEBUG : KNIME-Worker-0-Expand Barcode 0:1 :  : NodeContainer : Expand Barcode : 0:1 : Expand Barcode 0:1 has new state: IDLE
2021-12-20 13:37:23,762 : DEBUG : KNIME-Worker-0-Expand Barcode 0:1 :  : Node : Expand Barcode : 0:1 : Configure succeeded. (Expand Barcode)
2021-12-20 13:37:23,763 : DEBUG : KNIME-Worker-0-Expand Barcode 0:1 :  : NodeContainer : Expand Barcode : 0:1 : Expand Barcode 0:1 has new state: CONFIGURED
2021-12-20 13:37:23,764 : DEBUG : KNIME-Worker-0-Expand Barcode 0:1 :  : NodeContainer : Expand Barcode : 0:1 : disturber test 0 has new state: CONFIGURED

Hi @niederle,
are you using an OpenJ9 jvm ? KNIME AP does not really work with that JVM. Make sure you start the AP with Openjdk 11 from here: Adoptium - Open source, prebuilt OpenJDK binaries

best,
Gabriel

@gab1one
You are right. I used AdoptOpenJDK.
Didn’t KNIME work with that JDK in the past (before Java11)? Anyhow, I missed that instruction to use the Adoptium JDK. Now it works. Thanks a lot!

Hi @niederle,

Good question, I haven’t tried OpenJ9 on 4.3 so I can’t tell if that worked. I do know that there are extensions (e.g. knime-h2o) that did not work with OpenJ9 before the switch to java 11.

best,
Gabriel