AnsweredAssumed Answered

Issue with smack 4.2.0 alpha1

Question asked by Bahadur on Aug 9, 2015
Latest reply on Aug 10, 2015 by Bahadur

Smack Version: 4.2.0

Openfire version: 3.10.2

 

 

I am having a strange issue with the latest version of the smack 4.2.0 alpha1.

I have made a connection and then logged in to the remote server. So far, I have successfully connected. I attached a stanza(packer) listener to the connection to listen to the incoming messages. Then I created a multi-chat user room in the remote Openfire server. I also created a dummy user in the group and then logged the dummy user from the Spark ( an windown GUI ).

Now, when I run the code and then log in to the already created MUC, i am unable to join. However, I can still send and receive messages from the chatroom. Even the openfire web-panel show both users as online.

I have posted the related code at:

08-10 02:50:04.280  10960-11138/com.example.sumit.myapplication D/SMACK﹕ SENT (0): <iq to='win-sk7oe0qjf48' id='t874Q-10' type='get'><query xmlns='http://jabber.org/protocol/disco#items'></query></iq>

 

08-10 02:50:04.410  10960-11139/com.example.sumit.myapplication D/SMACK﹕ RECV (0): <iq type="result" id="t874Q-10" from="win-sk7oe0qjf48" to="test@win-sk7oe0qjf48/Smack"><query xmlns="http://jabber.org/protocol/disco#items"><item jid="conference.win-sk7oe0qjf48" name="Public Chatrooms"/><item jid="broadcast.win-sk7oe0qjf48" name="Broadcast service"/><item jid="search.win-sk7oe0qjf48" name="User Search"/><item jid="proxy.win-sk7oe0qjf48" name="Socks 5 Bytestreams Proxy"/><item jid="pubsub.win-sk7oe0qjf48" name="Publish-Subscribe service"/></query></iq>

 

08-10 02:50:04.410  10960-10960/com.example.sumit.myapplication V/LogChatt﹕ [org.jivesoftware.smackx.muc.HostedRoom@22cf0513, org.jivesoftware.smackx.muc.HostedRoom@25632350, org.jivesoftware.smackx.muc.HostedRoom@3fd89949, org.jivesoftware.smackx.muc.HostedRoom@563b24e, org.jivesoftware.smackx.muc.HostedRoom@221adf6f]

 

08-10 02:50:04.410  10960-11138/com.example.sumit.myapplication D/SMACK﹕ SENT (0): <presence to='Saathi@conference.win-sk7oe0qjf48/Anonymous' id='t874Q-12'><x xmlns='http://jabber.org/protocol/muc'></x></presence>

 

08-10 02:50:04.630  10960-11139/com.example.sumit.myapplication D/SMACK﹕ RECV (0): <presence id="ro8O7-46" to="test@win-sk7oe0qjf48/Smack" from="saathi@conference.win-sk7oe0qjf48/sumit1"><x xmlns="http://jabber.org/protocol/muc#user"><item jid="sumit1@win-sk7oe0qjf48/Spark" affiliation="none" role="participant"/></x></presence>

08-10 02:50:04.760  10960-11139/com.example.sumit.myapplication D/SMACK﹕ RECV (0): <presence to="test@win-sk7oe0qjf48/Smack" id="t874Q-12" from="saathi@conference.win-sk7oe0qjf48/Anonymous"><x xmlns="http://jabber.org/protocol/muc#user"><item jid="test@win-sk7oe0qjf48/Smack" affiliation="none" role="participant"/><status code="110"/><status code="100"/></x></presence><message type="groupchat" from="saathi@conference.win-sk7oe0qjf48" to="test@win-sk7oe0qjf48/Smack"><subject>admin</subject><delay xmlns="urn:xmpp:delay" stamp="2015-08-09T06:39:05.822Z" from="saathi@conference.win-sk7oe0qjf48"/><x xmlns="jabber:x:delay" stamp="20150809T06:39:05" from="saathi@conference.win-sk7oe0qjf48"/></message>

 

Exception Thrown:

08-10 02:50:14.440  10960-10960/com.example.sumit.myapplication W/System.err﹕ org.jivesoftware.smack.SmackException$NoResponseException: No response received within reply timeout. Timeout was 10000ms (~10s). Used filter: AndFilter: (FromMatchesFilter (full): Saathi@conference.win-sk7oe0qjf48/Anonymous, StanzaTypeFilter: org.jivesoftware.smack.packet.Presence).

 

Relevant Code:

 

chatmanager = MultiUserChatManager.getInstanceFor(f_c.connection());     // f_c.connection returns the XMPPTCPConnection

new_chat = chatmanager.getMultiUserChat(id);

 

try {

 

  DiscussionHistory history = new DiscussionHistory();

  history.setMaxStanzas(0);

   new_chat.join(Resourcepart.from("Anonymous"));

 

} catch (SmackException.NoResponseException e) {

  e.printStackTrace();

  Log.v("LogCatt", e.getFilter().toString());

   try {

  Log.v("LogCatt", chatmanager.getServiceNames().toString());

  } catch (SmackException.NoResponseException e1) {

  e1.printStackTrace();

  } catch (XMPPException.XMPPErrorException e1) {

  e1.printStackTrace();

  } catch (NotConnectedException e1) {

  e1.printStackTrace();

  } catch (InterruptedException e1) {

  e1.printStackTrace();

  }

  Log.v("LogCat", e.toString());

} catch (XMPPException.XMPPErrorException e) {

  e.printStackTrace();

  Log.v("LogCat", e.toString());

} catch (NotConnectedException e) {

  e.printStackTrace();

  Log.v("LogCat", e.toString());

} catch (InterruptedException e) {

  e.printStackTrace();

  Log.v("LogCat", e.toString());

} catch (XmppStringprepException e) {

  e.printStackTrace();

  Log.v("LogCat", e.toString());

} catch (SmackException e) {

  e.printStackTrace();

}

 

if(new_chat.isJoined())

{

  Log.v("LogCatt", "But joined...!");

}

 

Message was edited by: Bahadur

 

Message was edited by: Bahadur

Outcomes