} catch (XMPPException e) {
final XMPPError error = e.getXMPPError();
// 401 == Not Authorized
if (error != null && error.getCode() == 401) {
// is ist possible to create Accounts?
if (accountManager.supportsAccountCreation()) {
//try to create the Account (maybe it wasn't there)
accountManager.createAccount(user, password);
log.info("Logging in to Jabber as user: " + user + " on connection: " + connection);
// try to login again (if this fails we are screwed and fail ultimatively)
connection.login(user, password, resource);