Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 232
saivinod Avatar asked Feb 09 '23 04:02

saivinod


1 Answers

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

Thanks

like image 59
Maruthi Shanmugam Avatar answered Feb 14 '23 00:02

Maruthi Shanmugam