The code looks good to me. You can open a debugger to check if your client is receiving the XML packet.
An almost foolish question: is your test application still running when the other client sends the message? I mean, is your connection still open? From your code extract I cannot be sure of that.
Have you been able to open the debugger? Have you seen in the debugger the xml of the Message you are looking for? If your debugger is not showing any message then your PacketListener won’‘t process the message you are expecting. We should then try to find out why the server is not sending to your client the message. What’‘s the JID of your client? And what’'s the TO attribute of the Message that other clients tried to send to your client?
Yes. Your PacketListener will listen for any Message that the server sent you. That’'s why I want to check with the debugger that your client is actually receiving those packets.
I have sent messages to my application with Trillian. Now I oppened an another client (Pandion) and all works fine, I receive messages. It was possibly a problem with Trillian…
Thank You for your time!
P.S. I must say, that Smack is a great and very powerful tool!