Baza Wiedzy & Pliki Do Pobrania
Baza udostępnia dokumentację stworzoną przez nasz zespół. Wybierz kategorię lub wyszukaj odpowiedzi.
Articles
Java.net.UnknownHostException thrown from my Java application
Q: My Java web application gets data from other sites, however when it tries to access these domains an UnknownHostException is being thrown. For example:
java.net.UnknownHostException: api.hostname.com
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:176)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
at java.net.Socket.connect(Socket.java:579)
at java.net.Socket.connect(Socket.java:528)
A: Please check all hosts that your app connects to. You may check with 'ping' command or verify that DNS translates the domain names to IP addresses correctly with an online DNS tester like http://tracert.com/resolver.html
Any of the domains/hostnames may have DNS broken or might have it broken temporarily so that
your Java application could not resolve domain name to IP and thrown UnknownHostException.
- © 2016-2024 JVMHost.com All rights are reserved.