Creating new account

Hi all… I’‘m writing a chat app client (applet) I’'m connecting to server fine (our own jabber server here at work), but get an error when try to open acct for a user…

java.lang.NullPointerException

at chat.init(chat.java:147)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

now line 147 in chat.java is where I have this:

try {

acct.createAccount(Uid,pswd);

} catch (XMPPException e) {

System.out.println("Exception Caught: " + e.getMessage() + " " + e);

}

(compiles fine, further up I have: ‘‘AccountManager acct;’’)

so have 2 questions:

  1. why is this code failing, and

  2. why is XMPEException not being caught…)

(it’‘s not printing what it’'s supposed to print if catches exception…)

(no problem w/server, can create a new accts from clients such as Jeti, etc…)

thank you very much…

Did you initialize the AccountManager? Try “new AccountManager(XMPPConnection)”.

thank you very much for yr response… ok, did this now…

XMPPConnection conn;

AccountManager acct;

try {

acct = new AccountManager(conn);

acct.createAccount(sNewUid,pswd);

} catch (XMPPException e) {

System.out.println("Exception Caught: " + e.getMessage() + " " + e);

}

I get this error:

Exception Caught: (400) (400)

pls, what is this ‘‘400’’ error?

have been looking at Smack documentation, and even though I found code to create new acct in there can’'t find it now… (I mean the page where he says how to create new acct… I think I remember taking that code from there…) again, thank you very much…

When all else fails:

http://www.jabber.org/jeps/jep-0086.html

thank you for pointing me to this page… it says error 400 is a ‘‘bad rquest’’… why is this a bad request? this is correct code for opening an acount, right? (it compiles fine, at any rate…)

other things it says about this error:

– malformed JID (I have properly-formed JID (name@jabberserver.com)

– unexpected request (which means?)

(I’‘m using JID as password also, i.e., JID and pswd are the same… could this be a problem? (shouldn’'t be, it seems to me…))

how do I figure this out? how do other folks here create accounts…

again, many thanks for yr help…

You should not be supplying the "name@jabberserver.com" but just “name” for the username

Added quotes for clarity

Message was edited by:

AWenckus

thank you very much…

ok, didn’'t know about JID format… thank you…

ok, so now have correct JID format… now am getting error 409 (conflict) “conflict” is a bit vague, don’'t know what this refers to… I commented out all other code (to create chatroom, etc…) just left code there to connect to server and register new user… still get this 409 error…

I’'m confused now b/c enabled console thing, and looked again in my jabber book (oreilly, pg 212) and I realized this is stream for registering a new user:

only THEN, apparently, do you send uid/pswd info to server… so, questions:

  1. this conflicts with what it says in docs to open acct (that you send uid/psw in that 1st stmt to open acct)

  2. in our system we will connect to server, then do everything “behind the scenes”:

– create new acct

– login user

– connect user to chatroom

– open chatroom window

(that’'s it, no private chats, nothing… this is for a very specific purpose…)

user will not have to type in anything to reg/login… we will pass all that info w/a query string (and convert e-mail add to JID and create a password)

so, can this be done? again thank you very much… any help is much appreciated…

Usually, though not always, you can get by with not sending that initial jabber:iq:register packet to the server. Im not sure how Messenger performs in this instance. 409 conflict usually indicates that that username already exists on the server.

thank you very much for yr responses and for all your help…

of course once I fixed that malformed-JID error and succeeded in creating acct had to create acct w/new uid every time… again, thank you very much…