Project

General

Profile

multiple clent-side receive error xml 501

shir Hu
Added about 4 years ago

I use many clients login tigase server same accounts, such as pandion,android,jaxmpp3,

if the sequence is:

  1-jaxmpp3
  2-android
  3-pandion

the jaxmpp3 receive xml as follow after android or pandion login:

 <presence xmlns="jabber:client" from="shir1@etw-pc/develop" to="shir1@etw-pc/develop" type="error"><error code="501" type="cancel"><feature-not-implemented xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error></presence>

and if the sequence is:

  1-pandion
  2-android
  3-jaxmpp3

All the things is OK

My jaxmpp3 login code :

   final Jaxmpp jaxmpp = new Jaxmpp();
   try {
            ConnectionConfig config = new ConnectionConfig(server, port,resource, domain, user, pwd);

            config.initConnectionConfig(jaxmpp);
            jaxmpp.getEventBus().addHandler(Connector.StanzaReceivedHandler.StanzaReceivedEvent.class, new StanzaReceivedHandler(){
                @Override
                public void onStanzaReceived(SessionObject sessionObject,
                        StreamPacket stanza) {
                    // TODO Auto-generated method stub
                    try {
                        stanza.getValue();
                        System.out.println(sessionObject.getUserBareJid().getLocalpart() + " RECEIVED: "
                                    +stanza.getAsString());
                        System.out.println(jaxmpp.getConnector().getState());

                    } catch (XMLException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }
                }});

            jaxmpp.login(true);
        } catch (JaxmppException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

ConnectionConfig.java for set connectionConfiguration .Is there any other code can add to jaxmpp3 to avoid this?


Replies (3)

Added by shir Hu about 4 years ago

After I "sendInitialPresence()" with module PresenceModule, It works well now.

(1)
Avatar?id=6098&size=32x32

Added by Bartosz Małkowski TigaseTeam about 4 years ago

sendInitialPresence() should be called by jaxmpp itselfs after resource binding.

If something is still wrong, please us all stanzas exchangind between jaxmpp client and xmpp server.

Added by shir Hu about 4 years ago

It works well after I comment "sendInitialPresence()", Thank you very much.

    (1-3/3)