ClassCastException javax/ws/rs/client/ClientBuilder.class in TIBCO Spotfire File Writer Node

We ran into an issue that appears when using in KNIME 3.3 both, KNIME Labs REST Nodes and TIBCO Spotfire File Writer Nodes. When executing the Spotfire node after a REST node has been running, the Spotfire nodes will fail with the following error message:

ERROR TIBCO Spotfire File Writer 0:156      Execute failed: ClassCastException: attempting to castbundleresource://139.fwk850083982/javax/ws/rs/client/ClientBuilder.class to bundleresource://4.fwk850083982:5/javax/ws/rs/client/ClientBuilder.class

The stacktrace from the knime.log file:

2017-12-04 15:20:38,004 : DEBUG : KNIME-Worker-6 : SpotfireValueWriterFactory : TIBCO Spotfire File Writer : 0:156 : -Exiting initialize() of class SpotfireValueWriterFactory.
2017-12-04 15:20:38,039 : INFO  : KNIME-Worker-6 : SPOWebServiceClient : TIBCO Spotfire File Writer : 0:156 : SPOWebServiceClient url: https://spotfire.XXXXXXXXXXXXX:443 username: myuser1 password: ********
2017-12-04 15:20:38,041 : INFO  : KNIME-Worker-6 : SPOWebServiceClient : TIBCO Spotfire File Writer : 0:156 : Using URL: https://spotfire.global.nibr.novartis.net:443
2017-12-04 15:20:38,618 : INFO  : KNIME-Worker-6 : SPOServletServiceClient : TIBCO Spotfire File Writer : 0:156 : HTTP Authentication Basic for SPOServletServiceClient myuser1 ********
2017-12-04 15:20:38,623 : DEBUG : KNIME-Worker-6 : TIBCO Spotfire File Writer : TIBCO Spotfire File Writer : 0:156 : reset
2017-12-04 15:20:38,623 : ERROR : KNIME-Worker-6 : TIBCO Spotfire File Writer : TIBCO Spotfire File Writer : 0:156 : Execute failed: ClassCastException: attempting to castbundleresource://139.fwk850083982/javax/ws/rs/client/ClientBuilder.class to bundleresource://4.fwk850083982:5/javax/ws/rs/client/ClientBuilder.class
2017-12-04 15:20:38,624 : DEBUG : KNIME-Worker-6 : TIBCO Spotfire File Writer : TIBCO Spotfire File Writer : 0:156 : Execute failed: ClassCastException: attempting to castbundleresource://139.fwk850083982/javax/ws/rs/client/ClientBuilder.class to bundleresource://4.fwk850083982:5/javax/ws/rs/client/ClientBuilder.class
java.lang.LinkageError: ClassCastException: attempting to castbundleresource://139.fwk850083982/javax/ws/rs/client/ClientBuilder.class to bundleresource://4.fwk850083982:5/javax/ws/rs/client/ClientBuilder.class
    at javax.ws.rs.client.ClientBuilder.newBuilder(ClientBuilder.java:97)
    at javax.ws.rs.client.ClientBuilder.newClient(ClientBuilder.java:114)
    at com.tibco.spotfire.libraryclient.SPOServletServiceClient.<init>(SPOServletServiceClient.java:66)
    at com.tibco.spotfire.libraryclient.SpotfireClient.<init>(SpotfireClient.java:52)
    at com.tibco.ext.spotfire.filewriter.node.SpotfireFileWriterNodeModel.uploadToLibrary(SpotfireFileWriterNodeModel.java:259)
    at com.tibco.ext.spotfire.filewriter.node.SpotfireFileWriterNodeModel.execute(SpotfireFileWriterNodeModel.java:159)
    at org.knime.core.node.NodeModel.execute(NodeModel.java:732)
    at org.knime.core.node.NodeModel.executeModel(NodeModel.java:566)
    at org.knime.core.node.Node.invokeFullyNodeModelExecute(Node.java:1128)
    at org.knime.core.node.Node.execute(Node.java:915)
    at org.knime.core.node.workflow.NativeNodeContainer.performExecuteNode(NativeNodeContainer.java:561)
    at org.knime.core.node.exec.LocalNodeExecutionJob.mainExecute(LocalNodeExecutionJob.java:95)
    at org.knime.core.node.workflow.NodeExecutionJob.internalRun(NodeExecutionJob.java:179)
    at org.knime.core.node.workflow.NodeExecutionJob.run(NodeExecutionJob.java:110)
    at org.knime.core.util.ThreadUtils$RunnableWithContextImpl.runWithContext(ThreadUtils.java:328)
    at org.knime.core.util.ThreadUtils$RunnableWithContext.run(ThreadUtils.java:204)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.knime.core.util.ThreadPool$MyFuture.run(ThreadPool.java:123)
    at org.knime.core.util.ThreadPool$Worker.run(ThreadPool.java:246)

If I start a fresh KNIME and run the Spotfire node without having any KNIME REST node executed before, it works fine.

The reason is most likely, that the KNIME REST Nodes and the TIBCO Spotfire Nodes are using the same library (javax.ws.rs.client) but with a different version. Because the KNIME REST Nodes offer an extension point for custom authentication, which uses classes of this library in its API (from what I remember), the KNIME plugin needs to make this library visible to the outside. The Eclipse classloader has in this case a problem when it loaded a javax.ws.rs.client class first from the KNIME REST nodes and afterwards from the TIBCO Spotfire Nodes, which leads to the error we are seeing.

In order to solve this issue, I would suggest to contact Thorsten Meinl from KNIME and discuss what the best solution is.

When do you think could this be fixed? Would be great if the fix could work also with KNIME 3.3 which we are currently rolling out to our users.

Thanks!

Manuel Schwarze, NIBR

 

PS: We are using the following feature:
Spotfire File Nodes    1.7.5.8    com.tibco.ext.feature.knime.spotfire.filenodes.feature.group    TIBCO Software Inc

Just to complete: There were some offline discussions and Manuel and Andrew from Tibco have exchanged emails and an update version of the extension that fixes the problem.

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