Connection from host to virtual server fails with unavailable network from Java

I have a server that runs several virtual machines. I am trying to connect to one of these servers using Java, but it does not work with "Network unreachable". Usecase is a Hudson connection to run a slave on a windowed machine. It works using python sockets, so it is rather strange.

This is the network configuration on the host machine http://dpaste.com/168704/ . The problem is reproduced using this snippet http://dpaste.com/168708/ .

Any ideas? I was able to reproduce this problem only with java. ssh, ping, python and nc have also been tested and they work.

Edit: It seems that all outgoing connections from java are suffering from the same fate from the host machine.

+3
source share
2 answers

I was struck by this error http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=560056 .

So, now it works with a quick fix :-)

+2
source

It is likely that the wrong address is resolved for the host name. Add this debugging to your test:

InetSocketAddress saddr = 
  new InetSocketAddress("waltraction.dhcp.samfundet.no", 135);
InetAddress addr = saddr.getAddress();
if (addr == null) {
  System.out.println("Unresolved address.");
else 
  System.out.println(addr.getHostAddress());

Simple use of the address used may indicate a problem, but if not, update the question and get additional help.

0
source

Source: https://habr.com/ru/post/1735724/


All Articles