AnsweredAssumed Answered

Unable to join MUC

Question asked by Danial on Mar 20, 2017
Latest reply on Mar 23, 2017 by Danial

Hello, I am trying to create a small android chat application connected to an openfire server. I was on smack 4.1 and the connections were working fine ... i updated to smack 4.2 and added all the changes.

 

I am currently facing two issues :

where talk.fake.address is the real address

ONE:

When i try to connect to openfire server sometimes i receive :

 

SMACKException: The following addresses failed: '_xmpp-client._tcp.talk.fake.address:5222' failed because: 
de.measite.minidns.hla.ResolutionUnsuccessfulException: Asking for _xmpp-client._tcp.talk.fake.addresss.  IN SRV yielded an error response NX_DOMAIN

Somehow smack is adding _xmpp-client._tcp to my domain link and sometimes it doesn't which causes error in connecting to the server (sometimes) .

 

 

TWO:

When i try to join a room :

Resourcepart resourcepart = Resourcepart.from(userName);
MucEnterConfiguration.Builder mucEnterConfigurationBuilder = multiUserChat.getEnterConfigurationBuilder(resourcepart);
mucEnterConfigurationBuilder.requestHistorySince(since);
mucEnterConfigurationBuilder.timeoutAfter(10000);

multiUserChat.join(mucEnterConfigurationBuilder.build());
multiUserChat.addMessageListener(chatFragment);
multiUserChat.addPresenceInterceptor(new PresenceListener() {
   @Override
   public void processPresence(Presence presence) {
  Log.e("presence","interceptor:" + presence.toString());
  }
});
multiUserChat.addParticipantListener(new PresenceListener() {
   @Override
   public void processPresence(Presence presence) {
  Log.e("presence","presence:" + presence.toString());
  }
});
return multiUserChat.isJoined();

 

CASE 1 :

if i place the interceptors after joining the room, i just get a timeout :

 

03-20 10:21:38.789 31416-31416/team.wefoot.co.wefoot W/System.err: org.jivesoftware.smack.SmackException$NoResponseException: No response received within reply timeout. Timeout was 5000ms (~5s). Waited for response using: AndFilter: (StanzaTypeFilter: Presence, OrFilter: (AndFilter: (FromMatchesFilter (ignoreResourcepart): 192a8e4e2ec795499c8161a4df3d68604c31p0u5xr220000@conference.talk.staging.wefoot.fr, MUCUserStatusCodeFilter: status=110), AndFilter: (FromMatchesFilter (full): 192a8e4e2ec795499c8161a4df3d68604c31p0u5xr220000@conference.talk.staging.wefoot.fr/deadlyscorpion_19923147, StanzaIdFilter: id=bMQxz-6, PresenceTypeFilter: type=error))).
03-20 10:21:38.789 31416-31416/team.wefoot.co.wefoot W/System.err:     at org.jivesoftware.smack.StanzaCollector.nextResultOrThrow(StanzaCollector.java:253)
03-20 10:21:38.789 31416-31416/team.wefoot.co.wefoot W/System.err:     at org.jivesoftware.smackx.muc.MultiUserChat.enter(MultiUserChat.java:346)
03-20 10:21:38.789 31416-31416/team.wefoot.co.wefoot W/System.err:     at org.jivesoftware.smackx.muc.MultiUserChat.join(MultiUserChat.java:702)
03-20 10:21:38.789 31416-31416/team.wefoot.co.wefoot W/System.err:     at team.wefoot.co.xmpp.MyXMPP.joinMultiUserChatRoom(MyXMPP.java:286)
03-20 10:21:38.789 31416-31416/team.wefoot.co.wefoot W/System.err:     at team.wefoot.co.ChatFragment.joinChat(ChatFragment.java:313)
03-20 10:21:38.789 31416-31416/team.wefoot.co.wefoot W/System.err:     at team.wefoot.co.ChatFragment.onCreateView(ChatFragment.java:157)
03-20 10:21:38.789 31416-31416/team.wefoot.co.wefoot W/System.err:     at android.support.v4.app.Fragment.performCreateView(Fragment.java:2189)
03-20 10:21:38.789 31416-31416/team.wefoot.co.wefoot W/System.err:     at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1299)
03-20 10:21:38.789 31416-31416/team.wefoot.co.wefoot W/System.err:     at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1528)
03-20 10:21:38.789 31416-31416/team.wefoot.co.wefoot W/System.err:     at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1595)
03-20 10:21:38.789 31416-31416/team.wefoot.co.wefoot W/System.err:     at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:757)
03-20 10:21:38.789 31416-31416/team.wefoot.co.wefoot W/System.err:     at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2355)
03-20 10:21:38.789 31416-31416/team.wefoot.co.wefoot W/System.err:     at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2146)
03-20 10:21:38.789 31416-31416/team.wefoot.co.wefoot W/System.err:     at android.support.v4.app.FragmentManagerImpl.optimizeAndExecuteOps(FragmentManager.java:2098)
03-20 10:21:38.789 31416-31416/team.wefoot.co.wefoot W/System.err:     at android.support.v4.app.FragmentManagerImpl.execSingleAction(FragmentManager.java:1979)
03-20 10:21:38.789 31416-31416/team.wefoot.co.wefoot W/System.err:     at android.support.v4.app.BackStackRecord.commitNowAllowingStateLoss(BackStackRecord.java:626)
03-20 10:21:38.789 31416-31416/team.wefoot.co.wefoot W/System.err:     at android.support.v4.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:143)
03-20 10:21:38.789 31416-31416/team.wefoot.co.wefoot W/System.err:     at android.support.v4.view.ViewPager.populate(ViewPager.java:1268)
03-20 10:21:38.789 31416-31416/team.wefoot.co.wefoot W/System.err:     at android.support.v4.view.ViewPager.populate(ViewPager.java:1116)
03-20 10:21:38.789 31416-31416/team.wefoot.co.wefoot W/System.err:     at android.support.v4.view.ViewPager.setAdapter(ViewPager.java:540)
03-20 10:21:38.789 31416-31416/team.wefoot.co.wefoot W/System.err:     at team.wefoot.co.GameActivity.onSuccess(GameActivity.java:260)
03-20 10:21:38.789 31416-31416/team.wefoot.co.wefoot W/System.err:     at team.wefoot.co.participants.presenter.ParticipantPresenter.onSuccess(ParticipantPresenter.java:65)
03-20 10:21:38.789 31416-31416/team.wefoot.co.wefoot W/System.err:     at team.wefoot.co.participants.ParticipantInteractor.onResponse(ParticipantInteractor.java:194)
03-20 10:21:38.789 31416-31416/team.wefoot.co.wefoot W/System.err:     at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall$1$1.run(ExecutorCallAdapterFactory.java:68)
03-20 10:21:38.789 31416-31416/team.wefoot.co.wefoot W/System.err:     at android.os.Handler.handleCallback(Handler.java:739)
03-20 10:21:38.789 31416-31416/team.wefoot.co.wefoot W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:95)
03-20 10:21:38.789 31416-31416/team.wefoot.co.wefoot W/System.err:     at android.os.Looper.loop(Looper.java:148)
03-20 10:21:38.789 31416-31416/team.wefoot.co.wefoot W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:7406)
03-20 10:21:38.789 31416-31416/team.wefoot.co.wefoot W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
03-20 10:21:38.789 31416-31416/team.wefoot.co.wefoot W/System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
03-20 10:21:38.789 31416-31416/team.wefoot.co.wefoot W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

 

CASE 2 :

if i place the interceptors before joining the room, i get a timeout but in this case :

i get all the history correctly and all the messages yet i still get the reply timeout above.

If i put the reply timeout to more than 10 seconds ... lets say 20 seconds ... during those 20 seconds i can send and receive messages to the server as if i am joined in the chatroom.

Outcomes