No response while joining conference SmackException NoResponseException

661 Views Asked by At

i am getting below exception while joining the conference chat.

Exception:

org.jivesoftware.smack.SmackException$NoResponseException: No response received within reply timeout. Timeout was 10000ms (~10s). Waited for response using: AndFilter: (StanzaTypeFilter: Presence, OrFilter: (AndFilter: (FromMatchesFilter (ignoreResourcepart): [email protected], MUCUserStatusCodeFilter: status=110), AndFilter: (FromMatchesFilter (full): [email protected]/user00000003, StanzaIdFilter: id=c3v5j-70, PresenceTypeFilter: type=error))). 07-02 12:39:58.019 31567-31567/com.br.granplay W/System.err: at org.jivesoftware.smack.StanzaCollector.nextResultOrThrow(StanzaCollector.java:260)

Code:

muc = MucManager.getInstance()
                        .getMultiUserChat(MucManager.getEntityBareJid(jid));
                String strresource = XmppConnection.getXMPPConnction()
                        .getUser().getLocalpart().toString();
                Resourcepart resourcepart = Resourcepart.from(strresource);
                MucEnterConfiguration.Builder mec = muc.getEnterConfigurationBuilder(
                       resourcepart);

                mec.requestNoHistory();
                MucEnterConfiguration mucEnterConfig = mec.build();
                muc.join(mucEnterConfig);
2

There are 2 best solutions below

0
Abdul On BEST ANSWER

i was using below config for the xmpp connection before fix.

 XMPPTCPConnectionConfiguration conf = XMPPTCPConnectionConfiguration.builder()
                .setXmppDomain(mServiceName)
                .setHostAddress(getIpAddressOrNull(mServiceName))
                .setResource("Android")
                .setUsernameAndPassword(mUsername, mPassword) 
                .setKeystoreType(null) //This line seems to get rid of the problem
                .setSecurityMode(ConnectionConfiguration.SecurityMode.disabled)
                .setCompressionEnabled(true)
                .setSendPresence(true)
                .setDebuggerEnabled(false)
                .build();

Problem Fixed after removing resource part.

.setResource("Android")
0
Bhavesh Jabuvani On
org.jivesoftware.smack.SmackException$NoResponseException: No response received within reply timeout

Generally, this exception comes when user's presence is not updated to the Openfire server and try to join a room.

So update your presence(Unavailable) on onStop(), on close app. And set your presence(Available) onResume().

Still, you get this exception then on exception send user's presence "Unavailable" to the Openfire server and after 1-2 sec sends presence "Available" and then join to group.