powered by Jive Software

Trying to make PEP work

I’m trying to publish a PEP item. I use Smack 4.2.2-SNAPSHOT, connecting to xmmp.jp that states support for PEP. My basic code is:

PEPManager pepManager = PEPManager.getInstanceFor(MyService.xmpp.connection);

boolean worked = pepManager.addPEPListener(new PEPListener() {
    @Override
    public void eventReceived(EntityBareJid from, EventElement event, Message message) {
        Toast.makeText(getApplicationContext(), "got pep event!", Toast.LENGTH_LONG).show();
    }

});

if (pepManager.isSupported())
    pepManager.publish(new Item("pepItem1"), "mysmacktest1@xmpp.jp");
else
    Toast.makeText(getApplicationContext(), "isSupported false", Toast.LENGTH_LONG).show();

And getting a PubSubException$NotAPubSubNodeException. Log:


11-23 16:38:31.138 19146-19480/com.example.crypsis.mchat D/SMACK: SENT (0): <iq to='mysmacktest1@xmpp.jp' id='R1PoF-9' type='get'><query xmlns='http://jabber.org/protocol/disco#info'></query></iq>
11-23 16:38:31.358 19146-19481/com.example.crypsis.mchat D/SMACK: RECV (0): <iq xml:lang='en' to='mysmacktest1@xmpp.jp/1057120466901002035324187843' from='mysmacktest1@xmpp.jp' type='result' id='R1PoF-9'><query xmlns='http://jabber.org/protocol/disco#info'><identity type='pep' category='pubsub'/><identity type='registered' category='account'/><feature var='http://jabber.org/protocol/disco#info'/><feature var='vcard-temp'/><feature var='urn:xmpp:mam:tmp'/><feature var='urn:xmpp:mam:0'/><feature var='urn:xmpp:mam:1'/><feature var='msgoffline'/><feature var='http://jabber.org/protocol/offline'/><feature var='http://jabber.org/protocol/pubsub'/><feature var='http://jabber.org/protocol/rsm'/><feature var='http://jabber.org/protocol/pubsub#create-nodes'/><feature var='http://jabber.org/protocol/pubsub#auto-create'/><feature var='http://jabber.org/protocol/pubsub#auto-subscribe'/><feature var='http://jabber.org/protocol/pubsub#delete-nodes'/><feature var='http://jabber.org/protocol/pubsub#delete-items'/><feature var='http://jabber.org/protocol/pubsub#filtered-notifications'/><feature var='http://jabber.org/protocol/pubsub#modify-affiliations'/><feature var='http://jabber.org/protocol/pubsub#outcast-affiliation'/><feature var='http://jabber.org/protocol/pubsub#persistent-items'/><feature var='http://jabber.org/protocol/pubsub#publish'/><feature var='http://jabber.org/protocol/pubsub#purge-nodes'/><feature var='http://jabber.org/protocol/pubsub#retract-items'/><feature var='http://jabber.org/protocol/pubsub#retrieve-affiliations'/><feature var='http://jabber.org/protocol/pubsub#retrieve-items'/><feature var='http://jabber.org/protocol/pubsub#retrieve-subscriptions'/><feature var='http://jabber.org/protocol/pubsub#subscribe'/><feature var='http://jabber.org/protocol/commands'/></query></iq>
11-23 16:38:31.368 19146-19480/com.example.crypsis.mchat D/SMACK: SENT (0): <iq to='mysmacktest1@xmpp.jp' id='R1PoF-11' type='get'><query xmlns='http://jabber.org/protocol/disco#info' node='mysmacktest1@xmpp.jp'></query></iq>
11-23 16:38:31.618 19146-19481/com.example.crypsis.mchat D/SMACK: RECV (0): <iq xml:lang='en' to='mysmacktest1@xmpp.jp/1057120466901002035324187843' from='mysmacktest1@xmpp.jp' type='result' id='R1PoF-11'><query node='mysmacktest1@xmpp.jp' xmlns='http://jabber.org/protocol/disco#info'><identity type='registered' category='account'/></query></iq>
11-23 16:38:31.618 19146-19146/com.example.crypsis.mchat W/System.err: org.jivesoftware.smackx.pubsub.PubSubException$NotAPubSubNodeException
11-23 16:38:31.618 19146-19146/com.example.crypsis.mchat W/System.err:     at org.jivesoftware.smackx.pubsub.PubSubManager.getNode(PubSubManager.java:254)
11-23 16:38:31.618 19146-19146/com.example.crypsis.mchat W/System.err:     at org.jivesoftware.smackx.pep.PEPManager.publish(PEPManager.java:147)
11-23 16:38:31.618 19146-19146/com.example.crypsis.mchat W/System.err:     at com.example.crypsis.mchat.MainActivity.PepClick(MainActivity.java:135)
11-23 16:38:31.618 19146-19146/com.example.crypsis.mchat W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
11-23 16:38:31.618 19146-19146/com.example.crypsis.mchat W/System.err:     at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:288)
11-23 16:38:31.628 19146-19146/com.example.crypsis.mchat W/System.err:     at android.view.View.performClick(View.java:5702)
11-23 16:38:31.628 19146-19146/com.example.crypsis.mchat W/System.err:     at android.widget.TextView.performClick(TextView.java:10896)
11-23 16:38:31.628 19146-19146/com.example.crypsis.mchat W/System.err:     at android.view.View$PerformClick.run(View.java:22546)
11-23 16:38:31.628 19146-19146/com.example.crypsis.mchat W/System.err:     at android.os.Handler.handleCallback(Handler.java:739)
11-23 16:38:31.628 19146-19146/com.example.crypsis.mchat W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:95)
11-23 16:38:31.628 19146-19146/com.example.crypsis.mchat W/System.err:     at android.os.Looper.loop(Looper.java:158)
11-23 16:38:31.628 19146-19146/com.example.crypsis.mchat W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:7224)
11-23 16:38:31.628 19146-19146/com.example.crypsis.mchat W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
11-23 16:38:31.628 19146-19146/com.example.crypsis.mchat W/System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
11-23 16:38:31.628 19146-19146/com.example.crypsis.mchat W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
11-23 16:38:31.668 19146-19146/com.example.crypsis.mchat I/Choreographer: Skipped 32 frames!  The application may be doing too much work on its main thread.
11-23 16:38:31.678 19146-19146/com.example.crypsis.mchat D/SecWifiDisplayUtil: Metadata value : none
11-23 16:38:31.698 19146-19146/com.example.crypsis.mchat D/ViewRootImpl: #1 mView = android.widget.LinearLayout{c8b8d47 V.E...... ......I. 0,0-0,0 #10203a7 android:id/toast_layout_root}

Soo, what is wrong? What node should I be using? XEP-0163 states that “the root pubsub node simply is the account owner’s bare JID (localpart@domain.tld or < domain.tld >)”.