Smack 4.4.0
at org.jivesoftware.smack.StanzaCollector.nextResultOrThrow(StanzaCollector.java:281)
at org.jivesoftware.smackx.muc.MultiUserChat.enter(MultiUserChat.java:396)
at org.jivesoftware.smackx.muc.MultiUserChat.join(MultiUserChat.java:709)
at com.pesamoja.xmpp.ChatConnection.joinMultiUserChat(ChatConnection.java:554)
at com.pesamoja.xmpp.ChatService.lambda$joinAllGroups$2$ChatService(ChatService.java:340)
at com.pesamoja.xmpp.-$$Lambda$ChatService$nplZqmwD7MUMiqioo33g8-kS0eA.accept(Unknown Source:4)
at io.reactivex.internal.subscribers.LambdaSubscriber.onNext(LambdaSubscriber.java:65)
at io.reactivex.internal.operators.flowable.FlowableObserveOn$ObserveOnSubscriber.runAsync(FlowableObserveOn.java:407)
at io.reactivex.internal.operators.flowable.FlowableObserveOn$BaseObserveOnSubscriber.run(FlowableObserveOn.java:176)
at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:124)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:192)
at android.app.ActivityThread.main(ActivityThread.java:6754)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:549)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:828)
public void joinMultiUserChat(String user, String roomsName) {
MultiUserChat muc = null;
try {
// Create a MultiUserChat window using XMPPConnection
if (connection == null) {
return;
}
if (multiUserChatManager == null) {
multiUserChatManager = MultiUserChatManager.getInstanceFor(connection);
}
muc = multiUserChatManager.getMultiUserChat(JidCreate.entityBareFrom(roomsName));
MucEnterConfiguration mucEnterConfiguration = muc.getEnterConfigurationBuilder(Resourcepart.from(user))
.requestNoHistory()
.timeoutAfter(30000)
.build();
// Users to join in the chat room
muc.join(mucEnterConfiguration);
System.out.println("The conference room success....");
} catch (SmackException.NotConnectedException | SmackException.NoResponseException | XmppStringprepException | InterruptedException | MultiUserChatException.NotAMucServiceException | XMPPException e) {
e.printStackTrace();
System.out.println("The conference room to fail....");
}
}