ClientBuilder class not found

I am trying to create a RESTFul client using a Jersey frame, so I added the following class:

import javax.ws.rs.client.Client; import javax.ws.rs.client.ClientBuilder; public class ActivityClient { private Client client; public ActivityClient(){ client = ClientBuilder.newClient(); } //...code } 

but I get the ClientBuilder error class was not found, although I have the following banks in the WEB-INF / lib section and along the application class path:

 asm-3.1.jar jackson-core-asl-1.9.2.jar jackson-jaxrs-1.9.2.jar jackson-mapper-asl-1.9.2.jar jackson-xc-1.9.2.jar jersey-client-1.17.1.jar jersey-core-1.17.1.jar jersey-json-1.17.1.jar jersey-server-1.17.1.jar jersey-servlet-1.17.1.jar jettison-1.1.jar jsr311-api-1.1.1.jar 

So can someone please tell me which bank I'm missing here? and where can i find it? I searched on the Internet and the only bank that I found that ClientBuilder is associated with the RESTEasy framework, so I do not think it is related.

thank you for your time

+7
java java-ee rest jersey jersey-client
source share
1 answer

As far as I can see, ClientBuilder is part of the Jersey 2.x API and you are using Jersey 1.17.1, so either use the new version or use the API 1.17.1 which can be found here

+9
source share

All Articles