收藏
回答

java.net.UnknownHostException: api.weixin.qq.com?

分析日志发下以下几类关于访问 api.weixin.qq.com的错误 :

1、java.lang.RuntimeException: org.apache.http.conn.ConnectTimeoutException: Connect to api.weixin.qq.com:443 [api.weixin.qq.com/140.207.119.12, api.weixin.qq.com/58.246.220.31] failed: connect timed out

2、java.lang.RuntimeException: java.net.UnknownHostException: api.weixin.qq.com: Name or service not known

3、java.lang.RuntimeException: org.apache.http.conn.ConnectionPoolTimeoutException: Timeout waiting for connection from pool

    at me.chanjar.weixin.mp.api.impl.BaseWxMpServiceImpl.getOAuth2AccessToken(BaseWxMpServiceImpl.java:156) ~[weixin-java-mp-3.2.0.jar:?]

4、java.lang.RuntimeException: org.apache.http.NoHttpResponseException: api.weixin.qq.com:443 failed to respond

    at me.chanjar.weixin.mp.api.impl.BaseWxMpServiceImpl.getOAuth2AccessToken(BaseWxMpServiceImpl.java:156) ~[weixin-java-mp-3.2.0.jar:?]

5、com.github.binarywang.wxpay.exception.WxPayException: Connect to api.mch.weixin.qq.com:443 [api.mch.weixin.qq.com/2408:8711:10:10:0:0:0:2f, api.mch.weixin.qq.com/2408:8711:10:10:0:0:0:2c] failed: Network is unreachable (connect failed)

请问一下是什么原因?



回答关注问题邀请回答
收藏

1 个回答

  • Duke
    Duke
    2023-12-12

    1、failed: Network is unreachable (connect failed) 这个应该是禁用ipv6就好了

    2、java.net.UnknownHostException: api.weixin.qq.com 这个问题暂未解决


    2023-12-12
    有用 1
    回复 1
    • Duke
      Duke
      2023-12-14
      2也解决了,代码调用的时候,没有使用代理
      2023-12-14
      回复
登录 后发表内容
问题标签