Exception Being Thrown in Pubsub Extension

I’ve seen some other posts on this board regarding this issue but I can’t seem to figure it out. I am developing with aSmack on the Android platform and I am trying to subscribe to an XMPP Pubsub node. Instead of subscribing, I keep getting the following exception:

java.lang.ClassCastException: org.jivesoftware.smack.util.PacketParserUtils$2

My code is as follows:

mgr = new PubSubManager(connection, “pubsub.myservername.org”);

pm = ProviderManager.getInstance();

pm.addIQProvider(“pubsub”,“http://jabber.org/protocol/pubsub”, new PubSubProvider());

try {

LeafNode node = (LeafNode)mgr.getNode(“status”); // This throws the above exception!

My understanding is that I have to manually register the PubSubProvider() as Android won’t do it for me. Beyond that I’m at a loss as to what is wrong and what the fix might be…

You will have to register all the providers that you are using (pubsub or otherwise). There is more than one for pubsub, you can find them in the smack.providers file in the meta-inf directory.

Thanks, works fine now!