使用HttpClient时产生的异常

ainol2009 2010-01-14 03:18:59
在使用HttpClient时,时不时出现了这个异常:
org.apache.commons.httpclient.HttpRecoverableException: Error in parsing the status line from the response: unable to find line starting with "HTTP"

google了一下,有些人认为是由于server端负担太重,丢弃了部分connection,导致response不了预期的内容才导致产生异常,不知大家有没有碰到过这个问题,而您们又是怎样解决的呢? 谢谢!
...全文
395 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
ainol2009 2010-01-14
  • 打赏
  • 举报
回复
[Quote=引用楼主 ainol2009 的回复:]
在使用HttpClient时,时不时出现了这个异常:
org.apache.commons.httpclient.HttpRecoverableException: Error in parsing the status  line from the response: unable to find line starting with "HTTP"

google了一下,有些人认为是由于server端负担太重,丢弃了部分connection,导致response不了预期的内容才导致产生异常,不知大家有没有碰到过这个问题,而您们又是怎样解决的呢? 谢谢!
[/Quote]

请问
2。 用request 重新试一下。
是什么意思呢,谢谢。
bayougeng 2010-01-14
  • 打赏
  • 举报
回复
把这个异常瞒报,让它继续给你工作就好了。
SambaGao 2010-01-14
  • 打赏
  • 举报
回复
public class HttpRecoverableExceptionextends HttpException
Signals that an HTTP or HttpClient exception has occurred. This exception may have been caused by a transient error and the request may be retried. It may be possible to retrieve the underlying transient error via the inherited HttpException.getCause() method.

根据api 的解释。
1。
由于误差或暂态造成的。
2。
用request 重新试一下。

62,621

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧