javax.ws.rs.ProcessingException:java.net.SocketException:来自服务器的文件意外结束

时间:2016-03-22 12:53:28

标签: java jersey

我在点击其余服务时遇到以下错误      球衣客户>

  

javax.ws.rs.ProcessingException:java.net   .SocketException:        来自服务器的文件意外结束           在
      org.glassfish.jersey.client.HttpUrlConnector.apply(HttpUrlConnector.java:229)           在
      org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:246)             在
              org.glassfish.jersey.client.JerseyInvocation $ 1.call(JerseyInvocation.java:667)           在org.glassfish.jersey.client.JerseyInvocation $ 1.call(JerseyInvocation.java:664)           在org.glassfish.jersey.internal.Errors.process(Errors.java:315)           在org.glassfish.jersey.internal.Errors.process(Errors.java:297)           在org.glassfish.jersey.internal.Errors.process(Errors.java:228)           在org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:   443)           在org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:664)           在org.glassfish.jersey.client.JerseyInvocation $ Builder.method(JerseyInvocation.jav)   一:424)           在org.glassfish.jersey.client.JerseyInvocation $ Builder.post(JerseyInvocation.java:333)

1 个答案:

答案 0 :(得分:0)

使用javax.ws.core.Response时,需要在消耗响应后调用close()。只需仔细检查一下http连接没有泄漏。

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

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