我发现了一种情况,resteasy 没有关闭连接。有没有解决的办法?我将我的客户创建为:
ThreadSafeClientConnManager cm = new ThreadSafeClientConnManager();
HttpClient httpClient = new DefaultHttpClient(cm);
ClientExecutor executor = new ApacheHttpClient4Executor(httpClient);
T proxiedService = org.jboss.resteasy.client.ProxyFactory.create(clazz, base, executor);
我在服务上调用以下方法
@DELETE
@Path("{id}")
Response deleteObject(@PathParam("id") Long id);
服务正在返回
HTTP/1.1 500 Internal Server Error [Content-Length: 0, Server: Jetty(8.1.2.v20120308)]
关于我缺少什么来关闭连接的任何想法。注意:对于所有其他响应类型,连接正在关闭。
我知道,如果我不退回 500,一切都会好起来的。但是如果这种情况意外发生,我希望我的客户能够处理它,而不会耗尽连接。