The post seems to be big. But I am missing a very minute detail. Please help me find it.
I have the applicaion server(sun GlassFish Enterprise server 2.1) installed on one machine(I am calling it server).The server sends messages and other machines(called clients) should receive them. I created an instance of QueueConnectionFactory and physical destination queue in the admin console of the server. Then I tried (both MessageSender and MessageReceiver programs on same machine) on localhost.It worked well. I tried to access the server remotely from another machine i.e I want the server to send messages and the other machine to collect them. I wrote the following program on the client machine,