Help in the error isue!

hi… i have this…


ConnectionListener listener = new ConnectionListener() {

public void connectionClosed() {

JOptionPane.showMessageDialog(null…);

}

public void connectionClosedOnError(Exception e) {

JOptionPane.showMessageDialog(null…);

}

};


now i wanted to cause an error in order to check my program.

i enered a my user name (jid) but different password (in the registry window)…

in the debug window… i recieved 2 errors:

  1. 401… (un authorized) which i understand…

  2. 409…

now when i catch the exceptions (the errors)… i can only catch one error…

but something go nuts there…

because

when i catch the 401 error and i cant register this new user i close the connection and then the listener of the connection display me the right message.

but !! immidiattly after i see again the message when the connection is closed.

i check my code perfectly line after line… and i got to an conclusion that the reason that the connection is closed twice is that i got 2 errors… and maybe something is bugged here…

can u check it please and let me know?

its very important

pleas help !!..

i still dont understand whats going on.

when i catch the error…

and thats when i entered the username but differnet password, i close the connection and it closes me twice!!!..

i know for sure it aint problem in my code because… in every time i close the connection i print on the screen the number of the command’’ connection.close()’’

so i only see one time when it get to that command.

but it closes the connection twice…

althogh there is just one number rinted on the screen…

but when i delete that (the same) connection.close

nothing is hapaning (of course)…

so i think that when these errors(2 errors) happen

there is some problem with using connection.close

because in the other places the close of connection works fine…

but in this case it closes twice…

please check that out its important

anyone???

did you understand the problem?

please answer as soon as you read it.

gil,

Unfortunately, I don’'t quite understand the problem. Can you paste in some sample code along with a clearer explanation of what goes wrong?

Thanks,

Matt

actually i dont even understand the problem.

maybe it is in the server itself.

because the problem not always exist.

however the problem was:

when i try to log in using my user name but different password i get two errors from the server

and then (in that case) when i do connection.close…

the connection is closed twice (i know that because on the event close i print somwthing)…

but again…

at last time i check it was ok and the connection was closed one time…

i think the problem is in the server