When trying to bind an IPv6 address to a socket, the Java application encounters the following exception and fails to bind:
Java.net.SocketException: Protocol family unavailable
The recently published Stemcell 3363.20 disables IPv6 at the kernel level. If you use this Stemcell, you can run into this issue.
To prevent your JVM from doing this, set the following two system properties to true:
-Djava.net.preferIPv4Stack=true
-Djava.net.preferIPv4Addresses=true
This can likely be done by:
cf set-env <APP> JAVA_OPTS '-Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses=true'
or the manifest.yml
equivalent.