Can not get pubsub working from 3.2 beta

Hi guys,

i tired to follow some example in here to get pubsub working from smack 3.2. but it just gives me mixed errors. not sure why. Here is pub code

public static void main(String[] args) throws XMPPException {

// connect as publisher

ConnectionConfiguration config = new ConnectionConfiguration(“James.local”, 5222);

XMPPConnection connection = new XMPPConnection(config);

connection.connect();

connection.login(“test3”, “test3”);

ConfigureForm form = new ConfigureForm(FormType.submit);

form.setAccessModel(AccessModel.open);

form.setDeliverPayloads(true);

form.setNotifyRetract(true);

form.setMaxItems(20);

form.setPersistentItems(true);

form.setPublishModel(PublishModel.open);

PubSubManager manager = new PubSubManager(connection);

LeafNode myNode = (LeafNode) manager.createNode(“MyNode15”, form);

// LeafNode myNode = (LeafNode) manager.getNode(“MyNode14”);

SimplePayload payload = new SimplePayload(“event”, “pubsub:test:event”,

“” +

“New blog post” +

“Stalker published new blog post” +

“”);

PayloadItem item = new PayloadItem(null, payload);

myNode.send(item);

}

I got the following exceptions on line: myNode.send(item);

Exception in thread “main” bad-request(400)

at org.jivesoftware.smackx.pubsub.packet.SyncPacketSend.getReply(SyncPacketSend.ja va:53)

at org.jivesoftware.smackx.pubsub.packet.SyncPacketSend.getReply(SyncPacketSend.ja va:61)

at org.jivesoftware.smackx.pubsub.LeafNode.send(LeafNode.java:299)

at org.jivesoftware.smackx.pubsub.LeafNode.send(LeafNode.java:276)

at com.catchif.App.main(App.java:43)

Thank you very much for any help!

James

Make this change where you create the PubSubManager:

new PubSubManager(connection, “pubsub.” + connection.getServiceName());

This will be the default behaviour for the 3.2 release, but I haven’t checked in that change yet.

Thank you. that works!