http://radio-weblogs.com/0132383/stories/2004/05/21/mutlicastChecker.html
Example
java -jar mcastserver.jar -ipaddress xxx.x.x.x -port xxxxx
This zip file mcasttester.zip file contains two executable JAR files and the source code for the application. Extract this into a directory of your choosing.
mcastserver
Example
java -jar mcastserver.jar -ipaddress xxx.x.x.x -port xxxxx
Debugging an OracleAS clustered environment, with server configurations, application code requirements, replication settings, etc. can be a somewhat engaging process -- particularly if you are in a hurry and need to get it working ASAP. Using a methodical approach, it's very easy to do, but we're not always in a methodical mood right? ;-).
One step that can be quite easily overlooked is to check to see if the actual network environment you are using for your cluster setup supports Multicast. OracleAS relies on the use of multicast to replicate in-memory held data for web application sessions, and stateful session EJBs amongst the other instances contained in the cluster. If multicast isn't available on the system then the state replication aspect just won't work ... no matter what other configuration items you check, change and swear at.
So to help verify that multicast actually is available, I've written two small Java apps which can send and receive multicast datagrams on your network. This should enable you to confirm that multicast is working before you dive off and start looking for other possible causes of problems.This zip file mcasttester.zip file contains two executable JAR files and the source code for the application. Extract this into a directory of your choosing.
mcastserver
The multicast server program is contained within the mcastserver.jar file. It's an executable JAR file so all you need to do run it is type
>java -jar mcastserver.jar
If no parameters are specified, it uses a default multicast address of 230.230.230.1 and a port of 2608, and will send a message of "no worries mate" every ten seconds.
If you want to change the default settings such as the address, port, message, delay, random timer, verbose mode, then you can specify the new values via command line parameters.
Here's the help screen:
Usage: sab.mcast.Server [-ipaddress aaa.bbb.ccc.ddd] [-port n] [-delay amount][-message "message to display"] [-useRandom] [-verbose] [-h | -help]
[-h | -help] : prints this help message.
[-ipaddress aaa.bbb.ccc.ddd] : sets the multicast address the client binds to.
[-port nnnn] : sets the multicast port the client listens on.
[-delay n] : sets the delay between requests, or max delay if using random.
[-useRandom] : sets the use of random delays, up to the max delay value.
[-verbose] : dumps out verbose info.
[-message "text to send"] : sets the message to send.
[-ipaddress aaa.bbb.ccc.ddd] : sets the multicast address the client binds to.
[-port nnnn] : sets the multicast port the client listens on.
[-delay n] : sets the delay between requests, or max delay if using random.
[-useRandom] : sets the use of random delays, up to the max delay value.
[-verbose] : dumps out verbose info.
[-message "text to send"] : sets the message to send.
Example Usage:
sab.mcast.Server -ipaddress 240.240.240.1 -port 9127 -delay 5000 -random -verbose -message "here it comes"
mcastclient
The multicast client program is contained within the mcastclient.jar file. It's an executable JAR file so all you need to do run it is type
>java -jar mcastclient.jar
If no parameters are specified, it listens on the default multicast address of 230.230.230.1 and port of 2608. These match the default settings used my the mcastserver.
You can specify specific a multicast address and port using command line parameters. Note that the ipaddress and port setings must match those used by the server, otherwise it'll be listening, but noone will be home ... ;-)
Usage: sab.mcast.Client [-ipaddress aaa.bbb.ccc.ddd] [-port nnnn] [-verbose] [-sequencecheck] [-h | -help]
[-ipaddress aaa.bbb.ccc.ddd] : sets the multicast address the client binds to.
[-port nnnn] : sets the multicast port the client listens on.
[-sequencecheck] : keeps track of the message sequence numbers and reports jumps.
[-verbose] : dumps out verbose info.
[-h] : prints this help message.
[-ipaddress aaa.bbb.ccc.ddd] : sets the multicast address the client binds to.
[-port nnnn] : sets the multicast port the client listens on.
[-sequencecheck] : keeps track of the message sequence numbers and reports jumps.
[-verbose] : dumps out verbose info.
[-h] : prints this help message.
Example Usage:
sab.mcast.Client -ipaddress 240.240.240.1 -port 9127 -verbose
The Quick Test
To quickly establish if multicast is working in your environment, put the mcastserver.jar on one box, and put the mcastclient.jar on the other boxes in your cluster.
On the server node, start mcastserver.jar with the default parameters:
>java -jar mcastserver.jar
You should see the following output
Server running with multicast address [230.230.230.1:2608]
On the client node(s), start mcastclient.jar with the default parameters:
>java -jar mcastclient.jar
You should see the following output and then messages appear every ten seconds
Client running using multicast address of [230.230.230.1:2608]
Message (1) received from [/140.83.24.117:4679] with message of "no worries mate!"
Message (2) received from [/140.83.24.117:4679] with message of "no worries mate!"
Message (1) received from [/140.83.24.117:4679] with message of "no worries mate!"
Message (2) received from [/140.83.24.117:4679] with message of "no worries mate!"
and onwards.
To verify that a specific multicast, port combination you want to use works, you can specify it on both the client and the server using the -ipaddress and -port command line parameters.
>java -jar mcastserver.jar -ipaddress 235.235.237.1 -port 12345
To send a specific message, set the -message parameter on the server
>java -jar mcastserver.jar -message