Raleigh

罗利的技术博客

支付-va.net.UnknownHostException: mapi.alipay.com
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
阅读更多
个人分类: Android第三方框架
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

不良信息举报

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

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭