I faced this error when trying to run my server from Ubuntu app inside Windows OS. Then running my Java app from Windows OS to connect this server.
When running both (my Java app and my Server) from Ubuntu app inside Windows OS, the error is gone and connects successfully.