0

I am getting the below error while hitting the rest service from jersey client>

javax.ws.rs.ProcessingException: java.net .SocketException: Unexpected end of file from server at
org.glassfish.jersey.client.HttpUrlConnector.apply(HttpUrlConnector.java:229) at
org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:246) at
org.glassfish.jersey.client.JerseyInvocation$1.call(JerseyInvocation.java:667) at org.glassfish.jersey.client.JerseyInvocation$1.call(JerseyInvocation.java:664) at org.glassfish.jersey.internal.Errors.process(Errors.java:315) at org.glassfish.jersey.internal.Errors.process(Errors.java:297) at org.glassfish.jersey.internal.Errors.process(Errors.java:228) at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java: 443) at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:664) at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.jav a:424) at org.glassfish.jersey.client.JerseyInvocation$Builder.post(JerseyInvocation.java:333)

4
  • Possible duplicate of Java simple code: java.net.SocketException: Unexpected end of file from server Commented Mar 23, 2016 at 8:12
  • Hello Meiko, I read this post before posting this question. It was not helpful for me. i checked the server log too, Everything is fine there. Also the same URL is working fine with rest client tools ( Fiddler, Advanced Rest Client, Postman etc). The problem is coming while using jersey client to send the request. ( Sometimes, result is coming as expected, while some time it gives this exception ). Also, the URL is having special character in pathParam value, Commented Mar 24, 2016 at 14:19
  • hi, i think the marked answer is matching here too... any other information than the error in your question could help. Commented Mar 24, 2016 at 14:22
  • Hello Meiko, Sorry for too late to post here.. But, the problem still persists. I am unable to figure out the cause.. Other information is that, I get this exception only for invalid urls, ie I am validating the 404 response as part of my functional testing. Below is the line of code in which request hangs sometimes and gives the EOF exception. Response res = requestbuilder.post( Entity.entity( multipart, multipart.getMediaType() ) ); Commented May 27, 2016 at 18:01

1 Answer 1

0

when using javax.ws.core.Response it needs to call close() after consumption of the response. just double check somewhere there is no leak regarding http connection.

https://github.com/docker-java/docker-java/issues/110

http://phillbarber.blogspot.de/2014/02/lessons-learned-from-connection-leak-in.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.