java.net.NoRouteToHostException: No route to host

JDK Bug System | Webbug Group | 2 years ago
  1. 0

    [JDK-8132520] Socket to literal ipv6 address fails - Java Bug System

    java.net | 1 year ago
    java.net.NoRouteToHostException: No route to host
  2. 0

    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.

    JDK Bug System | 2 years ago | Webbug Group
    java.net.NoRouteToHostException: No route to host
  3. 0

    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.

    JDK Bug System | 2 years ago | Webbug Group
    java.net.NoRouteToHostException: No route to host
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Server error

    GitHub | 4 years ago | howy7214
    com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
  6. 0

    Ports NOT in use...

    Google Groups | 7 years ago | Vidioten
    java.net.NoRouteToHostException: No route to host

  1. abrazeneb 15 times, last 4 months ago
3 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.net.NoRouteToHostException

    No route to host

    at java.net.PlainSocketImpl.socketConnect()
  2. Java RT
    Socket.<init>
    1. java.net.PlainSocketImpl.socketConnect(Native Method)
    2. java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
    3. java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
    4. java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
    5. java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    6. java.net.Socket.connect(Socket.java:589)
    7. java.net.Socket.connect(Socket.java:538)
    8. java.net.Socket.<init>(Socket.java:434)
    9. java.net.Socket.<init>(Socket.java:244)
    9 frames