java.net.NoRouteToHostException

tip

Signals that an error occurred while attempting to connect a socket to a remote address and port. Typically, the remote host cannot be reached because of an intervening firewall, or if an intermediate router is down.


rafael

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • FULL PRODUCT VERSION : java version "1.7.0_79" Java(TM) SE Runtime Environment (build 1.7.0_79-b15) Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode) java version "1.8.0_45" Java(TM) SE Runtime Environment (build 1.8.0_45-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode) ADDITIONAL OS VERSION INFORMATION : Darwin 2guns.local 14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:05 PDT 2015; root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64 EXTRA RELEVANT SYSTEM CONFIGURATION : a working ipv6 network connection A DESCRIPTION OF THE PROBLEM : This code: // www.google.com address InetAddress adr = InetAddress.getByName("2a00:1450:4008:800::1010"); Socket socket = new Socket(adr, 22); throws this: java.net.NoRouteToHostException: No route to host at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at java.net.Socket.connect(Socket.java:538) at java.net.Socket.<init>(Socket.java:434) at java.net.Socket.<init>(Socket.java:244) This only happens on macos x not on linux or windows. And please don't ask about that if my network is work, it is, i proofed it with telnet. There are no socks or proxies configured, i stepped with the debugger to the nativ connect call and this throws the exception but receives the right data (address,port) It only happens if a literal ipv6 address is used. REGRESSION. Last worked in version 8u25 ADDITIONAL REGRESSION INFORMATION: it also failed on macos with jre 7_45 STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : package test; import java.net.InetAddress; import java.net.Socket; public class Test { public static void main(String[] args) throws Exception { // www.google.com address InetAddress adr = InetAddress.getByName("2a00:1450:4008:800::1010"); Socket socket = new Socket(adr, 80); } } EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - no exception ACTUAL - java.net.NoRouteToHostException: No route to host at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at java.net.Socket.connect(Socket.java:538) at java.net.Socket.<init>(Socket.java:434) at java.net.Socket.<init>(Socket.java:244) REPRODUCIBILITY : This bug can be reproduced always. ---------- BEGIN SOURCE ---------- package test; import java.net.InetAddress; import java.net.Socket; public class Test { public static void main(String[] args) throws Exception { // www.google.com address InetAddress adr = InetAddress.getByName("2a00:1450:4008:800::1010"); Socket socket = new Socket(adr, 80); } } ---------- END SOURCE ---------- CUSTOMER SUBMITTED WORKAROUND : no known, i try a could of ipv6 related options, no difference.
    via by Webbug Group,
  • FULL PRODUCT VERSION : java version "1.7.0_79" Java(TM) SE Runtime Environment (build 1.7.0_79-b15) Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode) java version "1.8.0_45" Java(TM) SE Runtime Environment (build 1.8.0_45-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode) ADDITIONAL OS VERSION INFORMATION : Darwin 2guns.local 14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:05 PDT 2015; root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64 EXTRA RELEVANT SYSTEM CONFIGURATION : a working ipv6 network connection A DESCRIPTION OF THE PROBLEM : This code: // www.google.com address InetAddress adr = InetAddress.getByName("2a00:1450:4008:800::1010"); Socket socket = new Socket(adr, 22); throws this: java.net.NoRouteToHostException: No route to host at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at java.net.Socket.connect(Socket.java:538) at java.net.Socket.<init>(Socket.java:434) at java.net.Socket.<init>(Socket.java:244) This only happens on macos x not on linux or windows. And please don't ask about that if my network is work, it is, i proofed it with telnet. There are no socks or proxies configured, i stepped with the debugger to the nativ connect call and this throws the exception but receives the right data (address,port) It only happens if a literal ipv6 address is used. REGRESSION. Last worked in version 8u25 ADDITIONAL REGRESSION INFORMATION: it also failed on macos with jre 7_45 STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : package test; import java.net.InetAddress; import java.net.Socket; public class Test { public static void main(String[] args) throws Exception { // www.google.com address InetAddress adr = InetAddress.getByName("2a00:1450:4008:800::1010"); Socket socket = new Socket(adr, 80); } } EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - no exception ACTUAL - java.net.NoRouteToHostException: No route to host at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at java.net.Socket.connect(Socket.java:538) at java.net.Socket.<init>(Socket.java:434) at java.net.Socket.<init>(Socket.java:244) REPRODUCIBILITY : This bug can be reproduced always. ---------- BEGIN SOURCE ---------- package test; import java.net.InetAddress; import java.net.Socket; public class Test { public static void main(String[] args) throws Exception { // www.google.com address InetAddress adr = InetAddress.getByName("2a00:1450:4008:800::1010"); Socket socket = new Socket(adr, 80); } } ---------- END SOURCE ---------- CUSTOMER SUBMITTED WORKAROUND : no known, i try a could of ipv6 related options, no difference.
    via by Webbug Group,
  • Server error
    via GitHub by howy7214
    ,
  • Ports NOT in use...
    via by Vidioten,
  • GitHub comment 15#31909908
    via GitHub by gregh3269
    ,
  • GitHub comment 15#31813438
    via GitHub by bmatthews68
    ,
    • java.net.NoRouteToHostException: No route to host at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at java.net.Socket.connect(Socket.java:538) at java.net.Socket.<init>(Socket.java:434) at java.net.Socket.<init>(Socket.java:244)

    Users with the same issue

    abrazeneb
    15 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Aria Pahlavan
    6 times, last one,
    15 more bugmates