Preview KNIME AP 4.4 -- Java 11 & Eclipse Upgrade

Hey developers:
We completed a major milestone for our upcoming 4.4 release: The current nightly build is based on Java 11 and Eclipse 2021-03. Your node extension probably needs some attention to ensure compatibility with the new version.

This change in the knime-rest repository is an example of how we changed the standard KNIME node extensions – it’s mostly just an update of the package dependencies and compiler settings. (There are more changes in the pull request – those are changes to the eclipse project settings, which are done automatically by the IDE when the compiler level is changed).

What to watch out for: Apart from compilation errors (we had very few exceptions and they were easy to fix) check the runtime behavior of your nodes and check the tests (community contributors: use the public Jenkins instance).

If you have any dependencies to SVG processing libraries, such as batik, birt, etc., an explicit import of w3c.dom.events, version 3, is required. The above PR contains an example. Also observe the start behavior: If the startup takes considerably longer when your extension is present (or fails) then a package import isn’t sufficiently restrictive (e.g. w3c.dom.events).

In our tests we’ve also detected a few changes to numerical precision for scientific computations (6+ decimal place), changes to the date time parsing, and issues with the UI for 4k displays (still working on that).

If you have any questions or feedback, please use this forum thread.

PS: Here are the preliminary release notes:

Time & Date handling

There are still some open issues related to the handling of Zoned Date & Time, as the underlying behavior in Java 11 has changed, The node most affected is: Extract Date&Time Fields.

If you do not select a locale with a country code, the underlying code will use US defaults (like weeks start on Sunday).

XML parsing library change

We no longer use the Xerces / Xalan libraries for XML handling. Please let us know if you see changes in XML handling performance or behavior

Use of XMLBeans and dynamic node factories

API users of any XMLBeans generated libraries, especially extensions of dynamic node factories (e.g. dynamic JS views) and PMML parsers, will need to re-compile their extensions. The binary format of such libraries has changed, hence 4.3.x build artifacts are incompatible with the new version and require a re-compilation.

Best,

Gabriel & Bernd

11 Likes

Thanks Gabriel,

I have 2 problems (so far!)

The package org.w3c.dom is accessible from more than one module: <unnamed>, java.xml
and
The package org.xml.sax is accessible from more than one module: <unnamed>, java.xml

I modified the MANIFEST.MF of the plugin, adding:

Import-Package: org.w3c.dom.events;version="3.0.0"

as in your example change, but that does not fix.

(The MANIFEST.MF in question is here - vernalis-knime-nodes/MANIFEST.MF at 4_4 · vernalis/vernalis-knime-nodes · GitHub if that helps)

The other question, I guess is any guidance on the Automatic-Module-Name: org.knime.rest line, which I think is a Java 9 feature - do you use the same name as the project name, or something else? (Or does it not actually matter!)

Steve

Hi Steve,

first the easy question:

I used the bundle id, which was what eclipse suggested in the quickfix for this issue. As the module name needs to be unique for each module, and so does the bundle id, it only makes sense for them to be the same.

best,
Gabriel

1 Like

Now to the the more complicated answer:

I suspect the dependency on org.rdkit.knime.types causes this problem, they seem to be using xalan which I have seen cause these kinds of problems.
There is not yet a rdkit build available for 4.4, but you could import the projects from GitHub - rdkit/knime-rdkit: The RDKit nodes for the KNIME Analytics Platform and see if you can get it to compile for you that way. I was planing on looking at the rdkit extension myself this week.

best,
Gabriel

I used the bundle id, which was what eclipse suggested in the quickfix for this issue.

Thanks @gab1one - that bit was easy enough :slight_smile: (Even easier if I wasnt doing something quite heavy-duty with KNIME on my PC at the same time taking up ~97% CPU)

I will look at the RDKit part once I have some more available resources on PC…

Steve

From where can I download the zipped update site for 4.4?

Also, after installing Schrodinger extensions (which were built using 4.3.2) in KNIME 4.4, though there are no error, our nodes are not visible in node repository.

Is that allowed to install older version of Schrodinger extensions in 4.4?

Thanks
Ravikiran

Hi @ravikiran,

We don’t have public links to zipped versions of the nightly build update site, as it is changing all the time. I’ll email you a link to a zip of a recent snapshot.
I already looked at the Schrödinger extension, the issue with it is that your extension needs to import the w3c.dom.events package to work with 4.4. If you add this, the same build of your extension should work with both 4.3 + 4.4.
All you need to do is to add the following line to the MANIFEST.MF file:

best,
Gabriel

2 Likes

Hi Gabriel,

Thanks for the quick response. I will try this and ping if I need more help.

Thanks
Ravikiran

Hi Gabriel,

Importing the w3c.dom.events package works with 4.4 and now I am able to see our nodes in node repository.
But we also have dynamic nodes plugin. And since I am using javax.xml.bind.*, which is not available in Java 11, its throwing class not found exception.

So, do we still have any way to use our extensions built with 4.3 in 4.4?

Thanks
Ravikiran

Hi @ravikiran,

In that case, you will need to create a separate build for 4.3 and 4.4.
To get access to the javax.xml.bind packages in 4.4 you need to add a dependency on the jakarta.xml.bind bundle, which is available in 4.4 but not in 4.3 (as it is not needed there).

best,
Gabriel

Hi Gabriel,
Ok. Thanks for the confirmation and pointers.

Thanks
Ravikiran

Hi Gabriel,

I see the java version bundled with KNIME 4.4 is 11.0.10+9, but I see the latest version for Java 11 is 11.0.11+9. Which version will be finally shipped with KNIME 4.4 release?

And could you please let me know from where you get the jdk from? Is that from https://adoptopenjdk.net ?

Thanks
Ravikiran

Hi Gabriel,

We also use the below imports. Could you please let me know the dependency to be included?

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;

Thanks
Ravikiran

Hi @ravikiran

We will be shipping with java 11.0.10+9. And yes, we are using adoptopenjdk as base.

To get those packages, you will need to add the javax.jws bundle from Orbit Build R20210223232630 or this jar: https://mvnrepository.com/artifact/javax.jws/javax.jws-api/1.1 to your build.

best,
Gabriel

Hi Gabriel,

Regarding the dynamic nodes plugin, even after adding the required plugin dependencies, I still see the below errors while starting KNIME 4.4 and our dynamic nodes are not visible in node repository.

javax.xml.bind.JAXBException: Implementation of JAXB-API has not been found on module path or classpath.
 - with linked exception:
[java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory]
	at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:232)
	at javax.xml.bind.ContextFinder.find(ContextFinder.java:375)
	at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:691)
	at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:632)
	at com.schrodinger.knime.dynamicnodes.DynamicNodeUtils.getNodeConfig(DynamicNodeUtils.java:45)
	at com.schrodinger.knime.dynamicnodes.AbstractSchrodNodeFactory.loadNodeConfig(AbstractSchrodNodeFactory.java:98)
	at com.schrodinger.knime.dynamicnodes.AbstractSchrodNodeFactory.loadAdditionalFactorySettings(AbstractSchrodNodeFactory.java:112)
	at org.knime.core.node.extension.NodeSetFactoryExtension.createNodeFactory(NodeSetFactoryExtension.java:181)
	at org.knime.workbench.repository.RepositoryFactory.createNodeSet(RepositoryFactory.java:335)
	at org.knime.workbench.repository.RepositoryManager.readNodeSets(RepositoryManager.java:447)
	at org.knime.workbench.repository.RepositoryManager.readRepository(RepositoryManager.java:172)
	at org.knime.workbench.repository.RepositoryManager.getRoot(RepositoryManager.java:574)
	at org.knime.workbench.repository.view.AbstractRepositoryView.readRepository(AbstractRepositoryView.java:413)
	at org.knime.workbench.repository.view.AbstractRepositoryView$4.run(AbstractRepositoryView.java:331)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	at org.eclipse.osgi.internal.framework.ContextFinder.loadClass(ContextFinder.java:147)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	at javax.xml.bind.ServiceLoaderUtil.nullSafeLoadClass(ServiceLoaderUtil.java:92)
	at javax.xml.bind.ServiceLoaderUtil.safeLoadClass(ServiceLoaderUtil.java:125)
	at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:230)
	... 14 more
ERROR	 Worker-0: Node Repository Loader NodeSetFactoryExtension	 Unable to instantiate class com.schrodinger.knime.dynamicnodes.PythonPanelNodeFactory for dynamic node set, contributed via "com.schrodinger.knime.dynamicnodes", id of factory is "com.schrodinger.knime.node.primemacrocyclesampling"

And my MANIFEST file is below:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Dynamicnodes
Bundle-SymbolicName: com.schrodinger.knime.dynamicnodes;singleton:=true
Bundle-Version: 21.3.82.qualifier
Bundle-Vendor: SCHRODINGER
Bundle-RequiredExecutionEnvironment: JavaSE-11
Require-Bundle: com.schrodinger.knime.base;bundle-version="4.0.0",
 org.knime.workbench.core;bundle-version="[3.0.0,5.0.0)",
 jakarta.xml.bind;bundle-version="2.3.3",
 com.sun.xml.bind;bundle-version="2.3.3",
 javax.xml.bind.jaxb-api;bundle-version="2.2.7"
Bundle-Activator: com.schrodinger.knime.dynamicnodes.DynamicNodePlugin
Bundle-ActivationPolicy: lazy
Import-Package: org.w3c.dom.events;version="3.0.0"
Automatic-Module-Name: com.schrodinger.knime.dynamicnodes

Hi @ravikiran,

You could try using our org.apache.cxf 2.7.12 bundle instead of com.sun.xml.bind it also exports the xmlbind classes (although in version 2.2.6). If that doesn’t work, we can hop on a call tomorrow and investigate further.

best,
Gabriel

Hi Gabriel,

I tried adding org.apache.cxf as a dependency but still the same error as shown above.

Shall we talk sometime in my afternoon? Anytime after 3pm IST would work for me.

Thanks
Ravikiran

Hi Gabriel,

Can I still use buckminster 4.5 to build my extensions for KNIME 4.4?

Thanks
Ravikiran

1 Like

Buckminster should work, we are using it to build most of the community extensions.

I’ve sent you an invitation.

best,
Gabriel