IP_MULTICAST_IF error in JBoss - OutSystems AgilePlatform for Java

IP_MULTICAST_IF error in JBoss - OutSystems AgilePlatform for Java

  
Symptoms:

On startup and shutdown, JBoss prompts the following error (in the server start.log):
java.net.SocketException: bad argument for IP_MULTICAST_IF: address not bound to any interface 
at java.net.PlainDatagramSocketImpl.socketSetOption(Native Method)<br/>
at java.net.PlainDatagramSocketImpl.setOption(PlainDatagramSocketImpl.java:299)

Everything continues to work properly, nevertheless.


Cause:

This problems occurs because IPv6 is configured on the server and JBoss on Linux does not work propertly with IPV6 (supposedly due to a bug in JDK 5). More information on this problem in http://www.jboss.org/community/docs/DOC-10014


Resolution:

As described in the above mentioned article, simply add the following option to JBoss startup:
-Djava.net.preferIPv4Stack=true

You can do that at the end of JAVA_OPTS section in $JBOSS_HOME/bin/run.conf. Below is an example of how that section can be written:
if [ "x$JAVA_OPTS" = "x" ]; then 
JAVA_OPTS="-server -XX:ThreadStackSize=128 -Xms512m -Xmx1024m -XX:PermSize=256m
-XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true"
fi