关闭

支付-va.net.UnknownHostException: mapi.alipay.com

1514人阅读 评论(0) 收藏 举报
分类:
java支付宝java.net.UnknownHostException: mapi.alipay.com异常解决

java.net.UnknownHostException: mapi.alipay.com
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
at java.net.Socket.connect(Socket.java:519)
at java.net.Socket.connect(Socket.java:469)
at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:271)
at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:328)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:172)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:729)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:158)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:977)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:234)
at com.alipay.util.AlipayNotify.checkUrl(AlipayNotify.java:105)
at com.alipay.util.AlipayNotify.verifyResponse(AlipayNotify.java:86)
at com.alipay.util.AlipayNotify.verify(AlipayNotify.java:40)

以上报无法解析域名的错误。
解决办法:将域名对应的ip在hosts文件配置下即可。
步骤:
1.ping 一下mapi.alipay.com,得到IP。
2. ①windows的hosts文件路径:“c:\windows\system32\drivers\etc”。
更改hosts文件,添加:110.75.146.31 mapi.alipay.com
②Linux更改hosts的操作如下:
>vi /et/host
110.75.146.31 mapi.alipay.com
0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:239032次
    • 积分:3192
    • 等级:
    • 排名:第11378名
    • 原创:35篇
    • 转载:316篇
    • 译文:0篇
    • 评论:23条
    最新评论