简体   繁体   中英

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

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

Thanks

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM