Smack usage questions

I’'m been playing with Smack this week and have a couple of questions:

  • I could not get the Chat sample from the documentation to work… messages are sent to the Wildfire server and remote Spark client, but the responses never make it to the Chat.nextMessage() call. I see the messages arriving in the debug console, but they simple don’'t show up in the listening (main) thread. Any ideas why this could be?

  • Since Chat didn’'t work, I went ahead and created and implementation using PacketListeners. I can send and receive packets, but for some reason each message I send to a Spark client shows up twice. The debug console confirms that only one XMPP packet is going out from Smack, but Spark shows the message twice. Any idea why this is happening?

(I think Ethereal is showing the same behavior but unfortunately the XML body of the message is showing up as jibberish (\027\003…). As a seperate thread, can someone point me to an Ethereal dissector that works with XMPP?)



Hey Dan,

You can take a look at the junit test cases to find some working examples of Chat usage. FYI, Smack 3.0 (not released yet) has changed the way Chats work. You can grab the code from SVN or the nightly build and give it a try.


– Gato