NoRouteToHostException on client or server?

后端 未结 6 2361
無奈伤痛
無奈伤痛 2021-02-19 19:24

I am getting

Caused by: java.net.NoRouteToHostException: No route to host
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.do         


        
6条回答
  •  醉梦人生
    2021-02-19 20:14

    It may be possible the ping will provide responses, but the application may still fail to connect. If that is the case, I would suggest using telnet to try and connect to the host using the desired port, telnet host.address port

    If the connection is refused then the port on the host will need to be allowed. It that succeeds, but the application still won't connect:

    1. Verify the address:port being used in your application are the same as those used in the telnet test.
    2. It may be a local port on the client blocking the connection, in which case you would need to allow the port on the client

提交回复
热议问题