Dependencies Failing for java-client

Product/components used and version/fix level:

java-client SDK

Detailed explanation of the problem:

I get an error when running a project as soon as I invoke getInventoryApi from an instance of a Platform class.

this.platform = new PlatformImpl(
      new CumulocityCredentialsFactory()
this.identityApi = platform.getIdentityApi();
this.inventoryApi = platform.getInventoryApi();

I suppose, the problem is with dependencies and versions, but I can not tell, what I do wrong. I only need cumulocity client functions, no microservice nor agent functions. The service will not run as microservice on Cumulocity. It will just use cumulocity as a data source.

My pom.xml has following dependencies (I already had to add, as it was not added automatically):



Error messages / full error message screenshot / log file:



An attempt was made to call a method that does not exist. The attempt was made from the following location:


The following method did not exist:

'void org.glassfish.jersey.client.JerseyClient.<init>(, org.glassfish.jersey.internal.util.collection.UnsafeValue,'

The calling method’s class, com.cumulocity.sdk.client.CumulocityHttpClient, was loaded from the following location:


The called method’s class, org.glassfish.jersey.client.JerseyClient, is available from the following locations:


The called method’s class hierarchy was loaded from the following locations:

org.glassfish.jersey.client.JerseyClient: file:/Users/petergaspar/.m2/repository/org/glassfish/jersey/core/jersey-client/3.1.3/jersey-client-3.1.3.jar

Correct the classpath of your application so that it contains compatible versions of the classes com.cumulocity.sdk.client.CumulocityHttpClient and org.glassfish.jersey.client.JerseyClient

Question related to a free trial, or to a production (customer) instance?

Hi @Peter_Gaspar ,

I just checked the pom of 1017.0.346 and there the following dependency is defined:


So it should be fine but it might be that another dependency is using jersey 3.1.1 conflicting with the one used by the cumulocity-client.
You might explicitly add jersey in the correct version or change the order of the dependencies to resolve that.

Thanks Stefan. Yes, explicitly downgrading the jersey to 2.35 helped. I had to do it in the dependency-management section though, because other packages also automatically downloaded version 3.

1 Like

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