powered by Jive Software

Get Disconnected from the Server

The story is that I get disconnected from the Jabberd server once I either add or delete contact in the Roster.

Here is the just the piece of code::::



con = new XMPPConnection(host,port);

PacketFilter filter = new PacketTypeFilter(Message.class);

con.login(username, password);





  1. r.createEntry(contact*"@"*host, null, null);

if( con.isConnected() ){





  1. r.createEntry(“sohail@”+host, null, null);

Now what happens is that (1)contact is added successfully but the client gets disconnected immeditaly

{Disconnected is printed on the screen}

and so the exception is thrown when try to create new entry(2)… Not connected to server Exception

Kindly figure it out why is it so


Sohail Qureshi

Two things to try:

  1. I’‘m not sure you’'re allowed to use null for the nickname when creating a roster entry.

  2. Try adding a connection listener and then print the exception that is disconnecting you from the server.



Ok !!!

First of all let me tell you that i am trying to develop a GUI based application in java for which i am asking you guy for assistance. When the gui is initilzed i have crated the connection & relevent stuff as mentioned before.

Now what happen is that when I press add button on my gui it ask me to add new contact/friends information. it adds the contact information in the roster successfully but gets disconnected.

and now when i again try to add or delete contact while selecting from the list it throws java.lang.IllegalStateException: Not connected to server…

Dont you think its a wired kind of problem,

I have tried both stuff i.e added a connection listener but it is never called.I have also given nickname instead of null while adding a new contact.

What I have noticed …Enabling the debug mode, I observered that somewhat error type occurs have 404 code.

That is all I could say for now.



Its Urgent …

Kindly Help me Out ! !


Sohail Qureshi

Ok thanks for the assiastance.

The xml send to the server is

The xml received from the server is

<iq xmlns=’‘jabber:client’’ id=’‘77WP2-39’’ type=’‘result’’/>

<presence xmlns=’‘jabber:client’’ from=’‘amina@aquarious.imaxan.ie’’ to=’‘sohail3@aquarious.imaxan.ie/Smack’’ type=’‘error’’>

<error type=’‘cancel’’ code=’‘404’’>

<item-not-found xmlns=’‘urn:ietf:params:xml:ns:xmpp-stanzas’’/>

After analyzizing I can easily conclude what was the problem…

Ok let me summarize it

First of all I had been adding contacts in the roster that were never registered in the server. In other words dummy entries…

And finally when i tried to remove those dummy entries, at first I could remove it but it get disconnected i.e stream is closed

Now tell me that while adding new entries in the roster, how can we make a check that it not a dummy entry i.e the user is registered in jabberd Server…

I think you got my point ! !

With Best Regards,

Sohail Qureshi