利用可能なポートで "Invalid argument" による SocketException が発生する
症状
Throw the SocketException to announce "Invalid argument" for an available port.
SEVERE: StandardServer.await: create[8005]:
java.net.SocketException: Invalid argument
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:365)
at java.net.ServerSocket.bind(ServerSocket.java:319)
at java.net.ServerSocket.<init>(ServerSocket.java:185)
at org.apache.catalina.core.StandardServer.await(StandardServer.java:363)
...
根本原因
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:
sysctl -w net.ipv6.bindv6only = 0
- 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.
Last modified on Mar 30, 2016
Powered by Confluence and Scroll Viewport.