Questions tagged [jersey-client]

The Jersey client API is a high-level Java based API for interoperating with RESTful Web services.

The Jersey client API is a high-level Java based API for interoperating with RESTful Web services. It makes it very easy to interoperate with RESTful Web services and enables a developer to concisely and efficiently implement a reusable client-side solution that leverages existing and well established client-side HTTP implementations.

More Details

820 questions
7
votes
2 answers

How to use mockito for testing Database connection

I am using Junit to test my jersey api. I want to test DAO without a database. I tried using Mockito but still not able to use mock object to test the DAO which contains Hibernate calls to DB. I want to write Junit for my Helper class which calls…
Jugi
  • 1,244
  • 3
  • 23
  • 51
6
votes
2 answers

how to use PATCH method with Jersey Invocation Builder?

WebTarget webTarget = httpClient.target(url); Invocation.Builder invocationBuilder = webTarget.request(MediaType.APPLICATION_JSON) .header(HttpUtils.AUTHORISATION_HEADER_NAME, "Bearer " + theAccessToken); response =…
John Little
  • 10,707
  • 19
  • 86
  • 158
6
votes
1 answer

PathParam for Jersey WebResource

I'm working on a task to create a Jersey client. I'm using Jersey 1.18. The target URL looks like below. https://api.test.com/test/{id}?param1=test1¶m2=test2 I need to add a PathParam to my WebResource to call this URL. I see an option to add…
Jane
  • 127
  • 1
  • 9
6
votes
5 answers

Encoding curly braces in Jersey Client 2

We are using Jersey Client 2.21. I am noticing that when we put curly braces (aka curly brackets) as a param value, then it does not get properly encoded. Not only that, but anything inside the curly braces does not get encoded either. This is…
Jose Martinez
  • 11,452
  • 7
  • 53
  • 68
6
votes
1 answer

Jersey Client closing InputStream response - does it really work?

I am using Jersey Client v2.16 (a transitive dependency of Dropwizard 0.8.0, which I am using, too). I am somehow puzzled by the closing mechanism of a response when the entity is read as an InputStream. The documentation states: Also if the…
Andrei Nicusan
  • 4,555
  • 1
  • 23
  • 36
6
votes
1 answer

Jersey Client 2 proxy and multipart support

I am trying to add proxy support to my Jersey Client. I use org.glassfish.jersey.core:jersey-client:2.11 but I can switch to any Jersey Client 2 version. Currently the client uses the default Jersey connector which does not support proxy AFAIK. I…
6
votes
2 answers

Jersey client async POST request to not wait for response

I have created a simple Jersey client and it is able to successfully do a POST request with a payload. But right now it waits for a response from the http endpoint: public void callEndpoint(String endpoint, String payload) { try { …
Sumitk
  • 1,485
  • 6
  • 19
  • 31
6
votes
3 answers

java.lang.ClassNotFoundException: javax.ws.rs.MessageProcessingException

I am deploying a war to Tomcat 7.0.57. This code uses Jersey 2.x Client to communicate with a Rest endpoint and exposes its own Rest endpoints using CXF (AKA the war's endpoint). When I hit one of the war's endpoints, the code seems to work and…
Daniel Kaplan
  • 62,768
  • 50
  • 234
  • 356
6
votes
1 answer

Jersey Image Upload Client

I am trying to upload image using Jersey webservice , i am using jersey client to upload image. below is jersey web service which takes inputstream and uploads image on server. it works fine when i directly call it using jsp multipart form upload…
Jitendra Kumawat
  • 133
  • 1
  • 2
  • 12
6
votes
0 answers

Jersey Client: Sending trailers in HTTP request with chunked transfer

I am implementing a java client to upload large files to the Akamai NetStorage Version 4 (Object Storage) via HTTP API. When using chunked transfer, the API requires trailing headers (trailers) to be send at the end of the message body. Currently I…
akyras
  • 61
  • 1
6
votes
3 answers

java.lang.NoClassDefFoundError error when running my project

I have been struggling to get this to work and I think i can use some help. I am working on a Java project where the pom.xml has a bunch of dependencies some of which are themselves indirectly dependent on this jar: com.sun.jersey:jersey-core:1.17.1…
user352951
  • 271
  • 1
  • 5
  • 11
6
votes
4 answers

Jersey2 Client throwing javax.ws.rs.NotFoundException

I have written a sample REST service using Jersey2. Here is my web.xml: jerseysample Jersey REST Service
Prasanth
  • 1,005
  • 5
  • 19
  • 39
5
votes
4 answers

Maven clean/install failing

when I'm trying to clean/install maven following error I'm facing... any suggestions Error: Could not find or load main class…
UmaShankar
  • 221
  • 5
  • 14
5
votes
2 answers

Jersey - Maven - MessageBodyWriter not found for media type=application/json

Currently i have the problem that everything in Netbeans my webservice works but if i start the jar file with the command "java -jar FILENAME PARAMETERS there is the following error. MessageBodyWriter not found for media type=application/json,…
5
votes
1 answer

Jersey Migration from 1.19 to 2.25 Maven Dependencies

I am migrating from Jerser 1.19 to Jersey 2.25 com.sun.jersey jersey-server 1.19 compile
Patan
  • 17,073
  • 36
  • 124
  • 198