2 yyz0612 yyz0612 于 2017.01.03 14:07 提问

百度API调用异常,谢谢

在调用百度API实现“将地址解析为对应经纬度”时提示一下异常,求解决方案

java.net.UnknownHostException: api.map.baidu.com
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at java.net.URL.openStream(Unknown Source)
at change.LatitudeUtils.getGeocoderLatitude(LatitudeUtils.java:27)
at change.LatitudeUtils.main(LatitudeUtils.java:62)
java.lang.NullPointerException
at change.LatitudeUtils.getGeocoderLatitude(LatitudeUtils.java:52)
at change.LatitudeUtils.main(LatitudeUtils.java:62)

3个回答

qq_28186997
qq_28186997   2017.01.03 14:36

用的什么web。是Nginx吗

bdmh
bdmh   Ds   Rxr 2017.01.03 14:36

UnknownHostException,无法解析域名?

hehexiaoxia
hehexiaoxia   2017.01.03 15:14

找不到服务,最好把调用过程和参数贴一下。

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!