I noticed if my jabber server (jabberd2) has account registration enabled, then in Smack if I try to create a new account and then immediately using that account to login, the login fails with an exception complaining Smack fails to receive the response to it final resource bind request (the SASL plain text authentication does succeed and at server side the bind also happens, it’s just somehow Smack didn’t get the bind success response from server). As a workaround, I tried to disconnect the XMPP connection after createAccount, then reconnect before the login, and that worked. I wonder why this happens?
XMPPConnection xcon = new XMPPConnection(“chat.gaocan.com”);
String acct = “test_” + new Random().nextInt(1000000);
String passwd = “test_pwd”;
// following 3 lines are a must otherwise login will fail
xcon = new XMPPConnection(“chat.gaocan.com”);