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

807 questions
13
votes
4 answers

Error while using jersey-client in osgi - No generator was provided

I get the following exception when I try to create a WebTarget from a Jersey client. My code Client client = ClientBuilder.newClient(); WebTarget baseTarget = client.target("http://127.0.0.1:9000"); Exception stack…
jubi
  • 133
  • 1
  • 1
  • 5
13
votes
2 answers

Jersey 2.6 with Jackson JSON deserialization

My goal is to make web calls and convert returned JSON to POJOs. I'm trying to use Jersey+Jackson for this but am getting exceptions when running. My maven pom file includes the following dependencies -
ashutosh
  • 629
  • 1
  • 7
  • 20
13
votes
3 answers

Jersey jax.rs client 2.5 follow redirect from HTTP to HTTPS

I have a setup where tomcat server hosting my REST servers redirects calls from HTTP (port 9080) to HTTPS ( port 9443 ). I'm using jersey 2.5 implementation and cannot manage to configure the clients to follow redirections. I've found this SO…
devlearn
  • 1,645
  • 2
  • 16
  • 28
12
votes
2 answers

Jersey 2 filter uses Container Request Context in Client Request Filter

I have a Jersey 2 Web Service that upon receiving a request, makes another request to another web service in order to form the response for the original request. So, when client "A" makes a request to my web service "B", "B" makes a request to "C"…
oggmonster
  • 4,162
  • 6
  • 46
  • 71
12
votes
3 answers

How to extract ObjectMapper from JAX-RS Client?

I am using Jersey JAX-RS client (version 2.0). I know it is using a Jackson ObjectMapper to generate and parse JSON. I want to use that same object to generate JSON for some java classes so that I can write them to a log. I know I can create a new…
necromancer
  • 21,492
  • 19
  • 65
  • 111
11
votes
1 answer

HTTP Stream dropping abnormally with java jersey client

For one of our project, we are consuming HTTP feed stream by using java jersey client With the client Feed consuming is fine, but after the 10 mins of time, stream dropping abnormally; even though stream producer is up and running and producing the…
Ram Kowsu
  • 587
  • 1
  • 5
  • 22
11
votes
1 answer

Closing connection in GET request using Jersey Client 2.22.1

I am using Jersey client for REST calls from Java code: org.glassfish.jersey.core jersey-client 2.22.1 In my GET request, …
Dev
  • 11,996
  • 15
  • 57
  • 138
11
votes
3 answers

Restful webservice with jersey 2.0 without maven

Can anybody tell me how to make a restful web service with Jersey 2.0 by not using maven. I have searched everywhere and found tutorial for Jersey1.x versions but not for 2.0. Please help
user2629427
  • 191
  • 2
  • 3
  • 11
11
votes
2 answers

How to read JSON request body in Jersey

I have a requirement, where in i need to read JSON request that is coming in as part of the request and also convert it to POJO at the same time. I was able to convert it to POJO object. But I was not able to get the request body (payload) of the…
ashokr
  • 113
  • 1
  • 1
  • 7
10
votes
3 answers

How call PUT through Jersy REST client with null entity

I want to call some "upgrade" REST API through Jersy client, which is declared as PUT and does not require any body content. But when I request this API as below: webTarget.request().put(Entity.json(null)); It gives error as below: Entity must not…
Atul Kumar
  • 658
  • 2
  • 6
  • 27
10
votes
1 answer

Jersey REST Client - Treat Custom MediaType as MediaType.APPLICATION_JSON

I'm writing a REST client using Jersey with JacksonFeature enabled for a webservice that forces me to specify their custom-named content type, even though it's just regular JSON. In other words, when I do this: Request request =…
kwikness
  • 1,395
  • 4
  • 19
  • 37
10
votes
3 answers

REST JAX-RS javax.ws.rs.ProcessingException:

I am getting below exception whenever my REST client code makes a call to the REST service using below code: Code: public void putWatcher(Watcher watcher) { System.out.println("In REST Client putWatcher.***********"); target =…
user3275095
  • 1,425
  • 4
  • 20
  • 32
10
votes
1 answer

Mock or build a Jersey InboundJaxrsResponse

I'm fairly new developing jersey client, and has run into some problems with some testing. First off all I maybe should mention that my application is all client side, no server side stuff at all. My problem is that I would like to create a Response…
Robert
  • 4,042
  • 4
  • 20
  • 32
10
votes
8 answers

Unable to Mock Glassfish Jersey Client response object

I am having problems with creating a mock Response object to use with my unit tests. I am using org.glassfish.jersey.core.jersey-client version 2.3.1 to implement my RESTful client and mockito version 1.9.5 to help me with mock objects. Here is my…
9
votes
3 answers

Jersey 2.8 client is not ignoring unknown properties during deserialization

I am using Jersey Client 2.8 and trying to register my own Jackson configurator which will sets custom ObjectMapper properties. public class ConnectionFactory { private final Client client; public ConnectionFactory() { ClientConfig…
Onkar Deshpande
  • 261
  • 4
  • 13
1
2
3
53 54