JGroups(JChannel) Chat Application not working on other computer

I'm developing a simple chat application using JGroups. The application works perfectly in my computer, but when I try to run it on another computer on the same network, it doesn't work.

void start() throws Exception { 
    channel=new JChannel();                
    channel.setReceiver(this);        
    channel.connect("Test");           
}

Am I missing any configuration on the start() function? When I run on the other computer, it doesn't recognize the chat instance on the cluster "Test". Maybe it creates another instance of cluster "Test".

Need some help. Thanks!

Upvotes: 1

Views: 342

Answers (1)

Bela Ban
Bela Ban

Reputation: 86

What's the output the program shows? If it includes an address of 127.0.0.1, then the nodes won't find each other. In this case, set bind_addr, either -Djgroups.bind_addr=x.x.x.x, or channel.getProtocolStack.findProtocol(TP.class).setValue"bind_addr", "x.x.x.x"). The latter needs to be done before connecting the channel. Might also be an IPv6 issue, as mentioned above.

Upvotes: 2

Related Questions