Failed create chat room in android and getting No response from server (tigase server)

StackOverflow https://stackoverflow.com/questions/22115337

  •  18-10-2022
  •  | 
  •  

Question

I'm developing an IM app use tigase as server, and use asmack library in android side. Now I can do register/login/chat p2p, but when I create chat room, I met a problem, android side code as below:

XMPPConnection connection = XmppConnectionManager.getInstance().getConnection();
try {
    MultiUserChat muc = new MultiUserChat(connection, "testroom" + "@" +  
        connection.getServiceName());
muc.create("nickname");
    ------
} catch (Exception e) {
e.printStackTrace();
}

After execute muc.create("nickname"), It's always throw exception, and exception info is: No response from server. In tigase server side, I'm enabled the MUC component in etc/init.properties as below:

--comp-name-1 = muc
--comp-class-1 = tigase.muc.MUCComponent

I have modify the project as the question create a group chat functionality in android and getting No response from server.. on muc.create() But still do not work,I do not know why, need your kindly help.

Was it helpful?

Solution

I have fixed this problem. It's my fault in client side, I must specify the MUC service name as configured in server side, It's different with tigase service name, configured as below:

--virt-hosts = localhost  #tigase server name
--external= muc.localhost:muc-pass  #muc.localhost is muc service name

So the client side code is as below:

   MultiUserChat muc = new MultiUserChat(connection, roomName  
                + "@muc." + connection.getServiceName());  

Thanks to @Haider.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top