我正在尝试从以下网址获取数据: http://webservices.nextbus.com/service/publicXMLFeed?command=vehicleLocations&a=sf-muni&r=M&t=0
我已将Nifi(在Oracle VirtualBox上运行)GetHttp proccesor URL属性配置为上述URL,但是我遇到以下异常:
Caused by: java.net.UnknownHostException: webservices.nextbus.com
at java.net.InetAddress.getAllByName0(InetAddress.java:1280) ~[na:1.8.0_111]
at java.net.InetAddress.getAllByName(InetAddress.java:1192) ~[na:1.8.0_111]
at java.net.InetAddress.getAllByName(InetAddress.java:1126) ~[na:1.8.0_111]
我在VM和主机上都使用了以下命令。
nslookup webservices.nextbus.com
在VM和主机上输出以下内容:
Non-authoritative answer:
Name: 4yu7q.x.incapdns.net
Address: 192.230.77.86
Aliases: webservices.nextbus.com
我正在使用Google DNS(在/etc/resolv.conf中,我有以下内容)
nameserver 8.8.8.8
Pinging webservices.nextbus.com也很成功
ping webservices.nextbus.com
Pinging 4yu7q.x.incapdns.net [192.230.77.86] with 32 bytes of data:
Reply from 192.230.77.86: bytes=32 time=15ms TTL=56
Reply from 192.230.77.86: bytes=32 time=14ms TTL=56
UnknownHostException可能是什么原因以及如何修复它?
答案 0 :(得分:0)
未从resolv.conf文件中获取DNS更改。重启NiFi解决了这个问题。