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
5
votes
0 answers

javax.ws.rs.ProcessingException: java.net.SocketTimeoutException - Jersey Client

I am attempting to read a REST web service response in a client and it works fine for individual calls. While doing the load test (~5000 calls in 5 minutes) for same web service call, I am getting socket read time out error. The bigger problem is,…
satz
  • 51
  • 1
  • 4
5
votes
5 answers

How to print server responses using LoggingFeature in Dropwizard 1.0.2?

The following code results in JSON server responses being printed in Dropwizard 0.9.2 and 1.0.2: return ClientBuilder .newBuilder() .build() .register(new LoggingFilter(Logger.getLogger(LoggingFilter.class.getName()),…
l0b0
  • 55,365
  • 30
  • 138
  • 223
5
votes
1 answer

Jersey 2 Client java.lang.NoSuchMethodError: org.glassfish.jersey.CommonProperties.getValue

I'm trying to setup a very simple Jersey client example. So I started with a pom.xml like this:
IwantToKnow
  • 351
  • 1
  • 5
  • 18
5
votes
1 answer

Url encoding issue with Jersey Client

I need to make a service call such as this: http://myservice.com/path?var1=value1&var2=value2 The issue I have is value1 and value2 ends up getting encoded, and this makes the service call fail. For example, value1 is something like…
Beebunny
  • 4,190
  • 4
  • 24
  • 37
5
votes
2 answers

AsyncInvoker not releasing the Thread

I am using AsyncInvoker using Jersey 2.0. This works fine for me. However, thread is not ending after completion of the return. Please note that I don't expect any response for the services I call. public Future fire(WebTarget webTarget)…
krutik
  • 119
  • 4
5
votes
1 answer

Upgrading from Jersey Client 1.x to Jersey Client 2.x

I am using jersey-client-1.9. sample code: import com.sun.jersey.api.client.Client; import com.sun.jersey.api.client.ClientResponse; import com.sun.jersey.api.client.WebResource; Client client = Client.create(); webResource =…
Dev
  • 13,492
  • 19
  • 81
  • 174
5
votes
1 answer

Cannot resolve symbol ExternalServiceResource while registering http client to jersey environment in Dropwizard Application

Iam implementing Dropwizard client in a Dropwizard REST Application. I am following their User Manual. While trying to register the client to jersey environment but cannot find the class ExternalServiceResource @Override public void…
Chetan
  • 4,735
  • 8
  • 48
  • 57
5
votes
1 answer

jersey @PathParam: how to pass a variable which contains more than one slashes

package com.java4s; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.Response; @Path("/customers") public class RestServicePathParamJava4s { @GET …
Vinay Kumar
  • 63
  • 1
  • 1
  • 5
5
votes
2 answers

Jersey REST Client : Posting MultiPart data

I am trying to write a Jersey client app which can post multi part form data to a Restful Jersey service. I need to post a CSV file with the data and a JSON with meta-data. I am using Jersey client 1.18.3. Here is my code (some names have been…
AbuMariam
  • 3,282
  • 13
  • 49
  • 82
5
votes
0 answers

JsonMappingException: Root name does not match expected

My question is as follows: jackson desearlization: Two keys at root. How do i unwrap one and ignore the other? I want this problem to be solved without using a wrapper class as solved in this question. I am developing a jersey client application.…
Dariush Jafari
  • 5,223
  • 7
  • 42
  • 71
5
votes
0 answers

Jersey 2.7 - setting retry handler

I would like to set a retry handler for Jersey client utilizing ApacheConnector. I wish to do it, because I want it to retry on timeout (my HAProxy will switch it to another server). I have no clue how to do this in Jersey 2.7. Example code: public…
Michał Kowalczyk
  • 358
  • 1
  • 5
  • 21
5
votes
1 answer

Why does Jersey swallow my "Content-Encoding" header

Why does the following example swallow my HTTP-Header for "Content-Encoding" in the request. I am writing an application where I need to decode a custom encoding format. However, I can never get hold of the "Content-Encoding" header from the…
Rafael Winterhalter
  • 42,759
  • 13
  • 108
  • 192
5
votes
1 answer

How can I cancel a pending asynchronous request and unregister invocation callback using Jersey Client 2.2.x?

I have a simple REST service with a sleep method which doesn't do anything more than sleep for the specified time in milliseconds and then returns with a No Content response. My RESTTest class tries to invoke…
oosie
  • 63
  • 5
5
votes
2 answers

How to setup a Jersey client with Jackson (2.x) provider to process a POST request

I'm struggling to setup a Jersey client for testing a POST request to a resource. My Jersey and Jackson dependencies look like these: org.glassfish.jersey.containers
zazi
  • 686
  • 1
  • 7
  • 19
5
votes
1 answer

Restful WebService call with Jersey client version 2.2

CASE I am trying to fetch User data to Servlet filter using REST service. POM.xml org.glassfish.jersey.containers jersey-container-servlet 2.2
Sami
  • 2,311
  • 13
  • 46
  • 80