NoRouteToHostException on client or server?

后端 未结 6 2249
無奈伤痛
無奈伤痛 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:26

    Basically it says that your client cannot connect to the server due to the address is inaccessible from the client machine.

    Please check that the address you are connecting to is accessible, either via ping command in your Command Prompt (Windows) or terminal (Unix-based):

    ping 

    or if it's a web server you can try to check it in your web browser.
    The ping command is helpful for me in most cases, since I would know why exactly I can't connect to the address. It can be a mistyped address or like the javadoc suggests, problem with firewall.

提交回复
热议问题