yyz0612
yyz0612
2017-01-03 06:07

百度API调用异常,谢谢

  • 百度
  • 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条回答