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
3
votes
2 answers

Eclipse can't find Jersey imports

I'm trying to implement the very simple client specified here in section 6.5 and given by the following Eclipse Java code (under Ubuntu): package de.vogella.jersey.first.client; import java.net.URI; import javax.ws.rs.core.MediaType; import…
user1300214
3
votes
0 answers

[Jersey 2.x]How to retry request?

I have a standard Jersey 2.7 client and would like to implement following scenario: Send JAX-RS request to a server. The server is unavailable (it has been shot down) The client retries the last request (I have load balancing on server side so…
Michał Kowalczyk
  • 358
  • 1
  • 5
  • 21
3
votes
1 answer

Initializing jersey client in constructor of spring managed bean

I am using jersey client to send POST requests to a third party webservice. Since creating jersey clients is expensive, I am doing this inside the constructor of a service client class which is Spring managed. My thinking is that when my server…
kau
  • 372
  • 1
  • 3
  • 14
3
votes
1 answer

ApacheConnectorProvider : Jersey Client 2.5.1

Ref: https://jersey.java.net/documentation/latest/user-guide.html#d0e4337. I am trying to use the ApacheConnector as a Connector for the jersey-client. The client seemed to work fine in the 2.4.1 version of jersey-client and apache connector. The…
Varun
  • 86
  • 1
  • 1
  • 8
3
votes
1 answer

Do Jersey client support NTLM proxy

I'm trying to make a jersey client call using NTLM proxy? is that possible as i was not able to get any clear information on the same. Did anyone tried before?
user2315454
  • 61
  • 2
  • 4
3
votes
1 answer

Mock Jersey Client Request response using Mockito and Junit

I searched on the forum and tried to get some heads up, by experimenting what others have already mentioned in other related posts but nothing worked for me since I am new to mockito junit, hence posting this question. I have a rest client , which…
kunal
  • 93
  • 1
  • 2
  • 7
3
votes
1 answer

Exception: AbstractMethodError: javax.ws.rs.core.Response.getStatusInfo()Ljavax/ws/rs/core/Response$StatusType;

When trying a POST-Request using jersey 1.18, I get the following exception: Exception in thread "main" java.lang.AbstractMethodError: javax.ws.rs.core.Response.getStatusInfo()Ljavax/ws/rs/core/Response$StatusType; at…
sschober
  • 2,003
  • 3
  • 24
  • 38
3
votes
1 answer

NoClassDefFoundError for Jersey 2.4.1 client in Android

I have an Android project targeting API 17 which needs to consume a Jersey 2.4.1 REST service. However, at runtime I keep getting a NoClassDefFoundError for org.glassfish.jersey.model.internal.CommonConfig$1. This class is in the Jersey JAR files I…
rossco
  • 523
  • 4
  • 20
3
votes
1 answer

ApacheConnector does not process request headers that were set in a WriterInterceptor

I am experiencing problems when configurating my Jersey Client with the ApacheConnector. It seems to ignore all request headers that I define in a WriterInterceptor. I can tell that the WriterInterceptor is called when I set a break point within…
Rafael Winterhalter
  • 42,759
  • 13
  • 108
  • 192
3
votes
0 answers

Auto Generate REST Client from WADL

Are there any tools to auto generate a Command Line REST Client from WADL, something close to xmlBeans which can generate Bean classes from WSDL? I have tried cxf-wadl2java and wadl2java. cxf-wadl2java : This is throwing a lot of errors in the…
Srihari
  • 766
  • 1
  • 6
  • 22
3
votes
2 answers

Passing Two Objects in Rest Api using Jersey

I have written a Restful web service API, which is accepting two different Object, Is it possible to call this api using Jersey client. I am not able to call this using Jersey client. Is this a limitation of Rest API that we can not pass multiple…
Sunny Gupta
  • 6,929
  • 15
  • 52
  • 80
3
votes
1 answer

Jersey client requires XMLInputFactory which is missing in Android

I'm trying to use Jersey with Jackson in Android, but I got the following error: Could not find class 'javax.xml.stream.XMLInputFactory', referenced from method…
Konstantin Milyutin
  • 11,946
  • 11
  • 59
  • 85
3
votes
1 answer

JAX-RS / Jersey ".get(Integer.class)" and single JSON primitive (Integer) values?

I have a JAX-RS WebService with the following method: @Path("/myrest") public class MyRestResource { ... @GET @Path("/getInteger") @Produces(APPLICATION_JSON) public Integer getInteger() { return 42; } When accessed…
lathspell
  • 3,040
  • 1
  • 30
  • 49
2
votes
1 answer

Spring OAuth 2.0 with jersey request : response 401 Unauthorized after entering correct credentials

Here is my problem: when I try to call this method, I got this error InboundJaxrsResponse{ context=ClientResponse{method=POST, uri=http://localhost:9001/oauth/token, status=401, reason=Unauthorized}} public String getToken() { …
it'sme
  • 23
  • 2
2
votes
1 answer

Can Jersey Client be used in multithreaded environment for consuming rest api?

I want to create a Jersey Client for a multithreaded project. Do i need to create a connection pool for the Client ? There is 500 TPS traffic on the server .How to calculate the below parameters for best…
Codemaster
  • 145
  • 2
  • 13