0

I am using Jersey 2.x.
I am trying to call another API from my Jersey REST API.
I have used these type of codes before in my program , but I never faced this exception. I am not able to understand what is the exact issue.
Following is my code which I am using to call another API.

Client client = ClientBuilder.newClient();

WebTarget target = client.target("http://" + moduleTwoAPI);

Response response = target.request().header("Authorization", authToken).put(Entity.json(jsonDetails));

I am getting the following Exception :

javax.ws.rs.ProcessingException: Already connected

I have gone through the following link , but still I am not able to resolve this issue.

I would like to understand what is the exact issue because of which this error is generated.

Shivkumar Mallesappa
  • 2,875
  • 7
  • 41
  • 68

1 Answers1

0

I had the exact same error. Using Postman I could connect to the API, but using my Java code I was getting that error.

I updated my Java version ( I was using a version that was installed on my computer last year), and it solved the problem.

I suspect the problem was due to SSL configurations (like supporting TLS 1.2) of the API I was trying to connect, and the Java version I was using couldn't cope 100% with that.

Sérgio

Sergio
  • 143
  • 12