You can also take a look at the JUnit test cases provided
in Smack to see how we are creating and destroying accounts.
What JUnit test cases are you referring to? I downloaded the source distribution and did a full-text search for “createAccount” but came up with nothing. I can’‘t get account creation to work, and I can find no examples of this in the JUnit tests. The odd thing is I’'m using Jive software on both ends: smack-dev-2.1.0 against Wildfire 2.4.0.
I have enabled Inband Account Registration and Anonymous Login (in Wildfire → Server → Registration & Login).
I’‘ve tried with and without the loginAnonymously() line but either way it doesn’'t work.
private void connectIfNecessary() throws XMPPException {
…
try {
connection.login(getUsername(), getPassword(), getResource());
} catch (XMPPException xe) {
//if first login failed, try to create an account and then login
//connection.loginAnonymously(); //tried with and without this line
AccountManager accountMgr = connection.getAccountManager();
accountMgr.createAccount(getUsername(), getPassword());
connection.login(getUsername(), getPassword(), getResource());
}
…
}
/code
The error message is: Unable to connect to Jabber Server. Server does not support account creation.[/b]
Furthermore, if I add code like the following, Smack reports that account creation is unsupported.
if(!accountMgr.supportsAccountCreation()) {
//account creation not supported!
…
}
/code
Surely it must be supported because Spark (and other clients) have no problem registering accounts with Wildfire…