AnsweredAssumed Answered

Unable to get PayloadItem in HandlePublishedItems

Question asked by Barabas on Apr 15, 2015
Latest reply on Apr 15, 2015 by Barabas

Hello, I am having issues with handlePublishedItems. I am trying to extract the payload sent from my PubSub, but I keep getting the following error:

5673-5703/ E/AbstractXMPPConnection﹕ Exception in packet listener     java.lang.ClassCastException: org.jivesoftware.smackx.pubsub.Item cannot be cast to org.jivesoftware.smackx.pubsub.PayloadItem


This is my following code for handlePublishedItems:



Here is the payload I am sending:

leafNode.send(new PayloadItem("test " + System.currentTimeMillis(), new SimplePayload("book", "pubsub:test:book", "Two Towers")));



I am following the example directly from here: /pubsub.html



Any help is appreciated.

Thank you!