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

Getting “javax.ws.rs.ProcessingException: Already connected” intermittently during load test

I am calling some rest API using JersyClientBuilder.withConfig(config).build() and javax.ws.rs.client.Client. Noramlly when running for one or two users everything is working fine but when running loadTest for users more then 50 intermittently I am…
user838634
  • 41
  • 5
3
votes
0 answers

Jersey SSE client not reporting errors

I am following the example given in the Jersey documentation, "Consuming SSE Events within Jersey clients": import javax.ws.rs.sse.SseEventSource; ... Client client = ClientBuilder.newBuilder().build(); WebTarget target =…
rwfbc
  • 900
  • 1
  • 10
  • 22
3
votes
1 answer

How to catch WebApplicationException with JAX-RS

I am trying to catch WebApplicationException with my javax.ws.rs.ext.ExceptionMapper class but I get a strange behavior. This is my simple rest method: @GET @Path("/saySomething") public List saySomething() { String response =…
zappee
  • 20,148
  • 14
  • 73
  • 129
3
votes
1 answer

Jersey 2.25.1 Client Logging Example

I am using the Jersey 2.25.1 Client and can't get any log output. I've looked at the 2.25.1 documentation - https://www.scribd.com/document/350321996/Jersey-Documentation-2-25-1-User-Guide - and followed what they described for Client logging -…
Ben
  • 33
  • 4
3
votes
1 answer

How to create Jersey 2 client with Executor

I have created a jersey 2 client with the below code, ClientConfig clientConfig = new ClientConfig(); clientConfig.property(ClientProperties.READ_TIMEOUT, 5000); clientConfig.property(ClientProperties.CONNECT_TIMEOUT, 10000); Client client = …
Ram Kumar
  • 93
  • 7
3
votes
2 answers

Implement a JUnit test for a rest service

I have to implement some JUnit tests for my rest services. For instance this is one of my Rest services: @Path("/dni-fe") public class HelloWorld { @POST @Path("/home") @Consumes(MediaType.APPLICATION_JSON) …
harry-potter
  • 1,981
  • 5
  • 29
  • 55
3
votes
0 answers

How to get the actual values from OutboundJaxrsResponse in java?

In my RestClient returns below response to my jersey service. OutboundJaxrsResponse{status=200, reason=OK, hasEntity=true, closed=false, buffered=false} The above one returns the list. How can I get the list and how to validate each record id? If…
user6063872
3
votes
2 answers

How to map java.util.Optional with jersey client

I have a DTO with a field of type java.util.Optional, like this: public class Person { private final Optional id; @JsonCreator public Person(@JsonProperty("id") Long id) { this.id = id; } public Optional id { return…
LucaA
  • 693
  • 3
  • 7
  • 18
3
votes
1 answer

Jersey Rx client jersey-client-async-executor shutdown

The web application [ROOT] appears to have started a thread named [jersey-client-async-executor-0] but has failed to stop it. How to gracefully shutdown the jersey-client-async-executor? This is used with Spring Boot, JerseyRxClient with embedded…
ethan
  • 1,881
  • 2
  • 17
  • 31
3
votes
1 answer

Jersey2 Client OutOfMemoryError when uploading large file

I am working on fileupload using below code but while uploading more than 300 MB file, I am getting OutOfMemoryError. Here's my code below package com.actifio.service.foresight; import java.io.File; import java.io.IOException; import…
Soujanya
  • 277
  • 4
  • 17
3
votes
1 answer

Jersey Client log response and also getEntity

I am using Jersey Client to make a REST service call. Now when I receive the response I want to log the json response and I also want to get the entity populated in my response bean. Client client = Client.create(config); ClientResponse cr =…
Siddharth
  • 2,046
  • 5
  • 26
  • 41
3
votes
2 answers

jersey-client 2.22.2 - How to set SunPKCS11 keystore on SslConfigurator properly?

I have been attempting to have my jersey client do a ssl client authentication with my Jersey/Grizzly Rest api. Other clients are successful handshaking with this server, but I am having trouble with my java client using Jersey client. When I run…
EScott
  • 41
  • 4
3
votes
1 answer

Instead of Downloading, Stream video file with Jersey

I want to stream video file instead of Downloading it. I tried with the below code. But it is downloading. @GET @Path("video") @Produces(MediaType.APPLICATION_OCTET_STREAM) public Response video() { File file = new…
Lokesh Reddy
  • 85
  • 1
  • 11
3
votes
2 answers

Mapping JSON to Java Object return null value

I want to parsing json object like this: { "Count" : 1, "Data" : [ { "ContactID" : 1567993182, "Email" : "enamdimensi@localhost.com", "Action" : "unsub", "Name" : "", …
Atang Sutisna
  • 101
  • 1
  • 1
  • 10
3
votes
1 answer

test jersey 2 client and webtarget

I am using jersey 2 I have an abstract class with which I construct my request. Now, I also have some abstract client classes I use as proxy classes and actual implementations. These work well, but are untested. My question is how I could test…
bobK
  • 704
  • 2
  • 7
  • 24