Our custom plugin uses Jersey-2 for communication. If I add a “REST Web Services” node (optionally remove it) and execute our custom node, our node fails with error:
" Execute failed: java.lang.ClassNotFoundException: org.apache.cxf.jaxrs.client.spec.ClientBuilderImpl cannot be found by com.linguamatics.solutions.knime_1.6.0:",
see Stack trace (6.0 KB) for details.
This is happening because the “javax.ws.rs.client.ClientBuilder” system property is set to org.apache.cxf.jaxrs.client.spec.ClientBuilderImpl when the REST node is added. See stack trace setting client builder property (5.4 KB)
I have experimented with one workaround:
- Before executing our node
- Save the system property javax.ws.rs.client.ClientBuilder
- Clear the system property javax.ws.rs.client.ClientBuilder
- After executing our node
- Restore the system property javax.ws.rs.client.ClientBuilder
One disadvantage of this approach is that nodes cannot execute concurrently.
Other possible solutions (I have not experimented with these) are
- Introduce a version of org.apache.cxf.jaxrs.client.spec.ClientBuilderImpl in our bundle
- Add a UTF-8 text file named “META-INF/services/javax.ws.rs.client.ClientBuilder” containing the fully qualified name of the builder class we want to use.
However above are workarounds, I prefer if the REST plugin didn’t set this system property.