powered by Jive Software

Problem of presence Pocket PC




I congratulate the developers of wildfire server they enable me to take advantage of a very effective and powerful tool.

I downloaded wildfire 3.0.0 and now I have one problem that I can’'t resolve :

My costumers use jabber client on Pocket PC Phone, so with GPRS.

When GPRS disconnects (frequently), the pocket pc has to reconnect to wildfire server and so a new thread is created in wildfire server.

Problem is :

When the old session is automatically closed after a few time, it sends an unavailable presence (but presence is ok in the new thread) and finally user appears as unavailable.

how can I resolve it ? with a parameter in admin console? with a part of development in sources of wildfire?

Thank you in advance for your answer.

Unexpcted unavailable presence

if I change this part of the file SessionManager.java :

public void onConnectionClose(Object handback) {

try {

ClientSession session = (ClientSession)handback;

boolean presenceUpdate = true;

for(ClientSession clientSession : getSessions(session.getUsername()))


if (clientSession.getStreamID()!=session.getStreamID() && clientSession.getLastActiveDate().after(session.getLastActiveDate() ))


presenceUpdate = false;





try {

if (session.getPresence().isAvailable() || !session.wasAvailable()) {

// Send an unavailable presence to the user’'s subscribers

// Note: This gives us a chance to send an unavailable presence to the

// entities that the user sent directed presences

Presence presence = new Presence();






finally {

// Remove the session


// Decrement the counter of user sessions





catch (Exception e) {

// Can’'t do anything about this problem…

Log.error(LocaleUtils.getLocalizedString(“admin.error.close”), e);




it seems to resolve my problem.

Is it a good way?


Hey Christophe,

Are you reconnecting using the same resource when the connection is dropped? Which is your resource policy (you can check it from the admin console)? By default, when a user tries to log in using a resource that is already taken (by the same user) then the old connection is closed/kicked. At the same time the server tries to validate the old session and if it found dead then it is removed.

The fix that you pasted is not fully correct since it is not considering the case where a user is correctly logged from many different resources.


– Gato



Thanks for your help.

You’'re right my fix is not correct. I think I have to find “why the dead connection did not disconnect on incoming new connection”.

I always connect the pocket pc with the same resource (which is my application title + release number).

In admin console, I choose “always disconnect” for the management of conflict.


Message was edited by: Christophe Nguyen


I found the location of my problem :

When the pocket pc tries to reconnect, old session must be closed but it doesn’'t work :

IQAuthHandler::IQ login[/u] :

sessionManager.isActiveRoute(username, resource) ==> returns true (my first session opened before gprs was lost)

and just after this …

oldSession = sessionManager.getSession(username, domain, resource); ==> it returns null value ???

(in getSession, SessionMap sessionMap = sessions.get(username) returns true whereas in isActiveRoute SessionMap sessionMap = sessions.get(username) returned the session ???)



In fact the problem comes from required variable username :

In sessionManager.isActiveRoute :

SessionMap sessionMap = sessions.get(username); is used whith username = username.toLowerCase() (example AAAAA)


in oldSession = sessionManager.getSession(username, domain, resource); username is not converted with toLowerCase() (example aaaaa).

How can I fix this bug properly ? (I’‘m .NET developer and I don’'t know enough java to do this myself).

Thank you in advance


Hey Christophe,

Thanks for the bug report. The issue JM-760 has been fixed. You may want to try again using the next nightly build version of Wildfire. Anyway, you may also want to fix the client since clients should not be sending usernames with uppercase letters.


– Gato