美文网首页
NoHttpResponseException: api.wei

NoHttpResponseException: api.wei

作者: _水杉 | 来源:发表于2019-04-19 17:50 被阅读0次

    在请求微信API接口时,经常提示下面这个错误:

    java.lang.RuntimeException: org.apache.http.NoHttpResponseException: api.weixin.qq.com:443 failed to respond
    at me.chanjar.weixin.mp.api.impl.AbstractWxMpServiceImpl.executeInternal(AbstractWxMpServiceImpl.java:314)
    at me.chanjar.weixin.mp.api.impl.AbstractWxMpServiceImpl.execute(AbstractWxMpServiceImpl.java:251)
    at me.chanjar.weixin.mp.api.impl.AbstractWxMpServiceImpl.post(AbstractWxMpServiceImpl.java:241)
    at me.chanjar.weixin.mp.api.impl.WxMpTemplateMsgServiceImpl.sendTemplateMsg(WxMpTemplateMsgServiceImpl.java:34)
    at com.liuceng.zen.service.CustomerNotifyService.ciNotifyWxSenderToBackend(CustomerNotifyService.java:239)
    at com.liuceng.zen.service.CustomerNotifyService.ciNotifyWxSenderOnBackend(CustomerNotifyService.java:174)
    at com.liuceng.zen.service.CustomerNotifyService.ciNotifyWxSender(CustomerNotifyService.java:91)
    at 
    ...
    

    翻来覆去,又是百度,又是Github项目上查issue。费尽周折,终于找到自认为的答案了,完美解决问题了。

    httpclient4.4 出现NoHttpResponseException的异常解决,文章不是关键,关键是评论:

    这个是httpclient 4.4版本的一个bug,升级到4.4.1版本就好了。附bug描述:https://issues.apache.org/jira/browse/HTTPCLIENT-1609


    感慨

    文章所说的方法,我没有试。说的实在太模糊了,以我的水平要实现那些代码到项目里,不知得到猴年马月呢。

    网上有好多人宣称自己找到了解决方法(现在我也成为其中一个了~_~!,就是不知道是不是能够解决你问题的那一个),但是至今都2019-04-19了,还是有好多人在网上苦苦寻觅。很难相信,真正的解决方法早在2017年就公布了(甚至更早,因为评论是2017/04/28 11:01 的)。


    结束语

    如果你也遇到了异常NoHttpResponseException: api.weixin.qq.com:443 failed to respond,我不保证我找到的方法也能解决你遇到的问题,但是值得一试,毕竟只是升级httpclient到4.4.1这么简单。(修改了httpclient版本之后,记得重新导入maven库,并且重新编译项目)

    相关文章

      网友评论

          本文标题:NoHttpResponseException: api.wei

          本文链接:https://www.haomeiwen.com/subject/lxecgqtx.html