This content has been marked as final.
Show 3 replies
-
1. Re: Problem with AutoDiscovery in JBoss-4.0.2 (on RH EL 3.0)
sinus Jun 8, 2005 3:36 AM (in response to sinus)This problem seems to correspond with bug report JBAS-1843:
http://jira.jboss.com/jira/browse/JBAS-1843
Mathias -
2. Re: Problem with AutoDiscovery in JBoss-4.0.2 (on RH EL 3.0)
starksm64 Jun 9, 2005 11:03 AM (in response to sinus)Yes. What does the multicast routing table look like for the 192.168.0.1 interface?
-
3. Re: Problem with AutoDiscovery in JBoss-4.0.2 (on RH EL 3.0)
sinus Jun 15, 2005 6:11 AM (in response to sinus)Multicasting was ok and the server answered to a "ping 230.0.0.4".
The problem persisted on SuSE Linux 9.1 kernel 2.6.4-52-default, but not on WinXP.
I had a look in the source org.jboss.ha.jndi.DetachedHANamingService.java, class AutomaticDiscovery, method start() and found two issues.
The original code:stopping = false; // Use the jndi bind address if there is no discovery address if (discoveryBindAddress != null) discoveryBindAddress = bindAddress; InetSocketAddress bindAddr = new InetSocketAddress(discoveryBindAddress, adGroupPort); socket = new MulticastSocket(bindAddr); socket.setTimeToLive(autoDiscoveryTTL); group = InetAddress.getByName(adGroupAddress); socket.joinGroup(group);
First, discoveryBindAddress should likely be tested as equal to null. It makes no sense to set it to bindAddr if one already exists.
Second, there seems to be a bug in the constructor of MulticastSocket when instantiated with an InetAddress. I changed the code to first instantiate with a port number and then set the interface in a second call.
Changed code:
stopping = false; // Use the jndi bind address if there is no discovery address if (discoveryBindAddress == null) discoveryBindAddress = bindAddress; socket = new MulticastSocket(adGroupPort); socket.setInterface(discoveryBindAddress); socket.setTimeToLive(autoDiscoveryTTL); group = InetAddress.getByName(adGroupAddress); socket.joinGroup(group);
This code works on the Linux server. I had not the time to test other platforms. Please check this out.
Mathias