2 hhhttt2 hhhttt2 于 2016.01.20 17:32 提问

Tomcat7,httpasyncclient-4.0.1,给自己发get请求,接收不到

Tomcat7中启动一个线程和主服socket通信,在该线程中用httpasyncclient给本Tomcat发送一个get请求。现在问题是执行了一段时间后,tomcat接收不到该请求,其他的浏览器发过来的请求都可以接收到。也不清楚是请求发送失败还是tomcat出问题了。不知道是什么原因导致的。
正常情况下,httpasyncclient发送该请求,打印的日志如下:
[exchange: 70] start execution
559163 DEBUG [2016-01-20 11:41:02] CookieSpec selected: best-match
559163 DEBUG [2016-01-20 11:41:02] Auth cache not set in the context
559163 DEBUG [2016-01-20 11:41:02] [exchange: 70] Request connection for {}->http://127.0.0.1:8080
559163 DEBUG [2016-01-20 11:41:02] Connection request: [route: {}->http://127.0.0.1:8080][total kept alive: 1; route allocated: 1 of 2; total allocated: 1 of 20]
559163 DEBUG [2016-01-20 11:41:02] Connection leased: [id: http-outgoing-5][route: {}->http://127.0.0.1:8080][total kept alive: 0; route allocated: 1 of 2; total allocated: 1 of 20]
559179 DEBUG [2016-01-20 11:41:02] [exchange: 70] Connection allocated: http-outgoing-5 [ACTIVE]
559179 DEBUG [2016-01-20 11:41:02] http-outgoing-5 127.0.0.1:56522<->127.0.0.1:8080[ACTIVE][r:r]: Set attribute http.nio.exchange-handler
559179 DEBUG [2016-01-20 11:41:02] http-outgoing-5 127.0.0.1:56522<->127.0.0.1:8080[ACTIVE][rw:r]: Event set [w]
559179 DEBUG [2016-01-20 11:41:02] http-outgoing-5 [ACTIVE] Request ready
559179 DEBUG [2016-01-20 11:41:02] Connection route already established
559179 DEBUG [2016-01-20 11:41:02] [exchange: 70] Attempt 1 to execute request
559179 DEBUG [2016-01-20 11:41:02] Target auth state: UNCHALLENGED
559179 DEBUG [2016-01-20 11:41:02] Proxy auth state: UNCHALLENGED
559179 DEBUG [2016-01-20 11:41:02] http-outgoing-5 >> GET /360pay/uc/user?devID=90e11876fcb7a658&clientID=1216597&session_id=sst1gameb003440bf1d84210a6d50c3c8adeda3e160342&client_version=2.0.3&gatewayID=7 HTTP/1.1
559179 DEBUG [2016-01-20 11:41:02] http-outgoing-5 >> Host: 127.0.0.1:8080
559179 DEBUG [2016-01-20 11:41:02] http-outgoing-5 >> Connection: Keep-Alive
559179 DEBUG [2016-01-20 11:41:02] http-outgoing-5 >> User-Agent: Apache-HttpAsyncClient/4.0.1 (java 1.5)
559179 DEBUG [2016-01-20 11:41:02] http-outgoing-5 127.0.0.1:56522<->127.0.0.1:8080[ACTIVE][rw:w]: Event set [w]
559194 DEBUG [2016-01-20 11:41:02] [exchange: 70] Request completed
559194 DEBUG [2016-01-20 11:41:02] http-outgoing-5 127.0.0.1:56522<->127.0.0.1:8080[ACTIVE][rw:w]: 262 bytes written
559194 DEBUG [2016-01-20 11:41:02] business data sign:sid=sst1gameb003440bf1d84210a6d50c3c8adeda3e160342
559194 DEBUG [2016-01-20 11:41:02] http-outgoing-5 >> "GET /360pay/uc/user?devID=90e11876fcb7a658&clientID=1216597&session_id=sst1gameb003440bf1d84210a6d50c3c8adeda3e160342&client_version=2.0.3&gatewayID=7 HTTP/1.1[\r][\n]"
559194 DEBUG [2016-01-20 11:41:02] http-outgoing-5 >> "Host: 127.0.0.1:8080[\r][\n]"
559194 DEBUG [2016-01-20 11:41:02] http-outgoing-5 >> "Connection: Keep-Alive[\r][\n]"
559194 DEBUG [2016-01-20 11:41:02] http-outgoing-5 >> "User-Agent: Apache-HttpAsyncClient/4.0.1 (java 1.5)[\r][\n]"
559194 DEBUG [2016-01-20 11:41:02] http-outgoing-5 >> "[\r][\n]"
559194 DEBUG [2016-01-20 11:41:02] will be md5:sid=sst1gameb003440bf1d84210a6d50c3c8adeda3e16034218efdc1ce1bbe1bf33a33686dac788f6
559194 DEBUG [2016-01-20 11:41:02] http-outgoing-5 127.0.0.1:56522<->127.0.0.1:8080[ACTIVE][r:w]: Event cleared [w]
不正常情况下:
[exchange: 11538] start execution
135320174 DEBUG [2016-01-20 05:47:10] CookieSpec selected: best-match
135320174 DEBUG [2016-01-20 05:47:10] Auth cache not set in the context
135320174 DEBUG [2016-01-20 05:47:10] [exchange: 11538] Request connection for {}->http://127.0.0.1:8080
135320174 DEBUG [2016-01-20 05:47:10] Connection request: [route: {}->http://127.0.0.1:8080][total kept alive: 0; route allocated: 2 of 2; total allocated: 2 of 20]
只有这么点日志,是get请求发送失败吗?求大神指教下

1个回答

devmiao
devmiao   Ds   Rxr 2016.01.20 17:49
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!