Smack client unable to parse IQ message from openfire plugin


In my openfire plugin, I receive an IQ message from the smack client and process it correctly (it performs a series of database lookups). From IQHandler, I return a proper IQ object. In the smack MessageListener, I get what appears to be a PacketParserUtils object (not a Packet).

Can someone point me to some documentation or to a similar project.


I will take a guess that you are creating a custom IQ packet and haven’t registered an appropriate provider to read it in Smack. This would result in the packet getting put into a default extension.

I have this:

ProviderManager pm = ProviderManager.getInstance();

pm.addIQProvider( “query”,“jabber:iq:location”,new LocationIQ() );

where class LocationIQ extends IQ.

I’m running the smack client under Android. Would this have an effect?

I would think that should work under Android. Have you tried stepping through in the debugger to see why yoru provider is not getting used?

BTW, what class is being passed to your Listener?

The result from collector.nextResult() is a PacketParserUtils object (confusing because this is not a subclass of Packet). I also get a PacketParserUtils object when I let it go to the Packet Listener.

I was abusing the MXParser by running off the end of the xml (calling when there’s nothing left to parse). When this happens, it causes pure havoc in PacketReader, PacketParserUtils, and the collector.

I’m going to continue with smack v3.2.0 instead of asmack.

Yeah, any provider that messes up the end tag for a stanza will pretty much kill the connection.