REST plugin conflicts with custom plugin

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",
see Stack trace (6.0 KB) for details.

This is happening because the “” 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
    • Clear the system property
  • After executing our node
    • Restore the system property

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/” 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.


Our REST nodes rely on CXF therefore we force its usage by setting those properties. Otherwise other plug-ins could inject other JAX-RS libraries that may break our nodes. If possible I suggest that you also use CXF instead of Jersey in your plug-in.
The “META-INF” approach may also work and you could also instantiate the Jersey client directly if you really need to use Jersey.

Our KNIME nodes are driven by an internal SDK that uses Jersey-2. Changing this SDK is a lot more work and could affect other uses of the SDK. The META-INF workaround seems to work.