Throw the SocketException to announce "Invalid argument" for an available port.
That socket may be created for IPv6 only.
- Use "sysctl net.ipv6.bindv6only" to check if "net.ipv6.bindv6only = 1" in the local environment, if so turn it off:
- If this doesn't work, try to set it by JVM parameters. Add "-Djava.net.preferIPv4Stack=true" into JAVA_OPTS. See Setting Properties and Options on Startup for more information on how to set a system property.