saivinod
saivinod

Reputation: 51

java.lang.noclassdeffounderror: org/glassfish/hk2/api/servicelocatorfactory$createpolicy

Why am I getting error even though I added all the required jars. I am trying to build rest client using JERSEY

client=ClientBuilder.newClient();
response = client.target("https://XXX/rest/api/2/search?jql="+query).request("application/json").header(authorizationHeaderName, authorizationHeaderValue).get();

responseBody = response.readEntity(String.class);
JSONObject jsonObject = new JSONObject(responseBody);
JSONArray jsonArray = jsonObject.getJSONArray("issues");

added jars: JARs

Upvotes: 5

Views: 24645

Answers (1)

Maruthi Shanmugam
Maruthi Shanmugam

Reputation: 346

ServiceLocatorFactory$createPolicy is part of the hk2-api 2.4.* and above. You are using a lower version of hk2-api.

Thanks

Upvotes: 8

Related Questions