I am trying to build a RESTFul client using Jersey framework, 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 am getting an error class ClientBuilder not found, even though I have the following jars under WEB-INF/lib and under 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 jar I am missing here? and where I can find it? I have searched the web and the only jar I found that has ClientBuilder is related to the RESTEasy framework, so I don't think that it is related.
Thanks for your time
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 a new version, or use the 1.17.1 API which can be found here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With