Debian Kernel 2.6.30-1 and JVM Socket Issues

Due to an update of my linux kernel i stumbled upon a strange issue. I could not get sockets working properly. After some googling i figured out that it had to be a network configuration issue.

By default (Debian Testing) sockets bind only to ipv6.

The socket binding behaviour can be configured within:

cat /etc/sysctl.d/bindv6only.conf
Set the parameter from net.ipv6.bindv6only=1 to net.ipv6.bindv6only=0

To test the setting you can also use the following command:

  • sysctl -w net.ipv6.bindv6only=0

The error messages might be:

Caused by: java.net.SocketException: Network is unreachable
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
	at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
	at java.net.Socket.connect(Socket.java:525)

Or for debugging java:

FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
ERROR: transport error 202: connect failed: Connection refused
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [../../../src/share/back/debugInit.c:690]