AnsweredAssumed Answered

Smack 4.2.1-SNAPSHOT failed to capture Carbon.Enable() response on new registered Jid

Question asked by cmeng on Jun 5, 2017
Latest reply on Jun 8, 2017 by cmeng

aTalk has a method (as shown below) to enable the carbon using Carbon.Enable(); and verify success by checking for its iq response. However it always reports failure to receive response on timeout for a newly IB-Registered Jid account 'test@atalk.org/atalk', even thought the response did indeed sent by the server.

 

aTalk xmpp client has 3 jabber account registered. Carbon.Enable() is working correctly for the other two accounts

See capture log below.

Anybody has ideas what can be the problem that causes this strange behavior? Any help is appreciated?

 

=========================================

private void enableDisableCarbon(final boolean enable)
{
   IQ iq = enable ? new Carbon.Enable() : new Carbon.Disable();
   isCarbonEnabled = false;

   Stanza response = null;
   try {
   iq.setFrom(jabberProvider.getOurJID());
   iq.setType(IQ.Type.set);
   StanzaCollector packetCollector = jabberProvider.getConnection()
   .createStanzaCollectorAndSend(new StanzaIdFilter(iq.getStanzaId()), iq);
   response = packetCollector.nextResultOrThrow();
   }
   catch (Exception e) {
   logger.error("Failed to enable carbon for: " + jabberProvider.getOurJID(), e);
   return;
   }

   if ((response == null) || (response.getError() != null)) {
   logger.error("Failed to enable carbon: " + response.getError());
   }
   else if ((response instanceof IQ) && (((IQ) response).getType() == IQ.Type.result)) {
   isCarbonEnabled = true;
   logger.info("Carbon enabled for: " + iq.getStanzaId());
   }
   else {
   logger.error("Failed to enable carbon. The response is not correct: " + response);
   }
}

 

=========== aTalk catpured log for Carbon.Enable() ================

06-06 13:54:08.975 D/SMACK: SENT (2): <iq id='d4F35-206' type='set'><enable xmlns='urn:xmpp:carbons:2'/></iq>

06-06 13:54:09.345 D/SMACK: RECV (2): <iq xml:lang='en' to='leopard@icrypto.com/atalk' from='leopard@icrypto.com' type='result' id='d4F35-206'/>

06-06 13:54:09.345 I/αTalk: [17] impl.protocol.jabber.OperationSetBasicInstantMessagingJabberImpl.enableDisableC arbon().694 Carbon enabled for: d4F35-206

.....

06-06 13:54:09.735 D/SMACK: SENT (1): <iq id='d4F35-231' type='set'><enable xmlns='urn:xmpp:carbons:2'/></iq>

06-06 13:54:09.785 D/SMACK: RECV (1): <iq xml:lang='en' to='test@atalk.org/atalk' from='test@atalk.org' type='result' id='d4F35-231'/>

.....

06-06 13:54:10.045 D/SMACK: SENT (0): <iq id='d4F35-238' type='set'><enable xmlns='urn:xmpp:carbons:2'/></iq>

06-06 13:54:10.105 D/SMACK: RECV (0): <iq xml:lang='en' to='leopard@atalk.org/atalk' from='leopard@atalk.org' type='result' id='d4F35-238'/>

06-06 13:54:10.135 I/αTalk: [25] impl.protocol.jabber.OperationSetBasicInstantMessagingJabberImpl.enableDisableC arbon().694 Carbon enabled for: d4F35-238

.......

06-06 13:54:14.735 E/αTalk: [22] impl.protocol.jabber.OperationSetBasicInstantMessagingJabberImpl.enableDisableC arbon().684 Failed to enable carbon for: test@atalk.org/atalk

                            org.jivesoftware.smack.SmackException$NoResponseException: No response received within reply timeout. Timeout was 5000ms (~5s). Waited for response using: StanzaIdFilter: id=d4F35-231.

                                at org.jivesoftware.smack.StanzaCollector.nextResultOrThrow(StanzaCollector.java:2 53)

                                at org.jivesoftware.smack.StanzaCollector.nextResultOrThrow(StanzaCollector.java:2 08)

                                at net.java.sip.communicator.impl.protocol.jabber.OperationSetBasicInstantMessagin gJabberImpl.enableDisableCarbon(OperationSetBasicInstantMessagingJabberImpl.java :681)

                                at net.java.sip.communicator.impl.protocol.jabber.OperationSetBasicInstantMessagin gJabberImpl.initAdditionalServices(OperationSetBasicInstantMessagingJabberImpl.j ava:657)

                                at net.java.sip.communicator.impl.protocol.jabber.OperationSetBasicInstantMessagin gJabberImpl.access$700(OperationSetBasicInstantMessagingJabberImpl.java:50)

                                at net.java.sip.communicator.impl.protocol.jabber.OperationSetBasicInstantMessagin gJabberImpl$RegistrationStateListener$1.run(OperationSetBasicInstantMessagingJab berImpl.java:624)

                                at java.lang.Thread.run(Thread.java:818)

Outcomes