浏览 6784 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2014-09-20
1.连接是正常关闭的。 2.HttpConnectionManager使用的是MultiThreadedHttpConnectionManager。 3.如果不涉及大量的图片,异常会在2000-8000次后出现这个异常。 4.初步怀疑是因为线程太多,等待造成。 不知大家有什么好的解决方案没有? Caused by: java.net.UnknownHostException: at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:195) ~[na:1.6.0_43] at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) ~[na:1.6.0_43] at java.net.Socket.connect(Socket.java:529) ~[na:1.6.0_43] at java.net.Socket.connect(Socket.java:478) ~[na:1.6.0_43] at java.net.Socket.<init>(Socket.java:375) ~[na:1.6.0_43] at java.net.Socket.<init>(Socket.java:249) ~[na:1.6.0_43] at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:80) ~[commons-httpclient-3.1.jar:na] at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:122) ~[commons-httpclient-3.1.jar:na] at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707) ~[commons-httpclient-3.1.jar:na] at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361) ~[commons-httpclient-3.1.jar:na] at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387) ~[commons-httpclient-3.1.jar:na] at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171) ~[commons-httpclient-3.1.jar:na] at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397) ~[commons-httpclient-3.1.jar:na] at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323) ~[commons-httpclient-3.1.jar:na] at com.jiwu.reaper.http.HttpClientManager.execute(HttpClientManager.java:120) ~[classes/:na] ... 20 common frames omitted 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |
发表时间:2014-09-25
关注一下,还发现还有这样的问题
|
|
返回顶楼 | |
发表时间:2014-09-26
我也遇到过,没找到原因。调用端重试,服务端做幂等,算是能解决这个问题。
|
|
返回顶楼 | |
发表时间:2014-09-26
可以迁移只httpclient4 在这版本无此问题,之前因为遇到这个问题,才迁移只版本4
|
|
返回顶楼 | |
发表时间:2014-09-27
1. try this: System.setProperty("http.keepAlive","false");
if not working, try this: 2. do not close streams and ((HttpURLConnection)conn).disconnect() |
|
返回顶楼 | |