item-not-found(404) when trying to get a node using Smackx pubsub

Posted by DustMason on Stack Overflow See other posts from Stack Overflow or by DustMason
Published on 2010-05-11T06:42:00Z Indexed on 2010/05/11 6:44 UTC
Read the original article Hit count: 321

Filed under:
|
|
|
|

I'm trying to use the latest Smackx trunk to get and then subscribe to a pubsub node. However, openfire just sends me a back an error: item not found (404).

I am instantiating the java objects from ColdFusion, so my code snippets might look funny but maybe someone will be able to tell me what I've forgotten.

Here's how I create the node:

    ftype = createObject("java", "org.jivesoftware.smackx.pubsub.FormType");
    cform = createObject("java", "org.jivesoftware.smackx.pubsub.ConfigureForm").init(ftype.submit);
    cform.setPersistentItems(true);
    cform.setDeliverPayloads(true);
    caccess = createObject("java", "org.jivesoftware.smackx.pubsub.AccessModel");
    cform.setAccessModel(caccess.open);
    cpublish = createObject("java", "org.jivesoftware.smackx.pubsub.PublishModel");
    cform.setPublishModel(cpublish.open);
    cform.setMaxItems(99);

    manager = createObject("java", "org.jivesoftware.smackx.pubsub.PubSubManager").init(XMPPConnection);

    myNode = manager.createNode("subber", cform);

And here's how I am trying to get to it (in a different section of code):

    manager = createObject("java", "org.jivesoftware.smackx.pubsub.PubSubManager").init(XMPPConnection);
    myNode = manager.getNode("subber");

Immediately upon creating the node I seem to be able to publish to it like so:

    payload = createObject("java", "org.jivesoftware.smackx.pubsub.SimplePayload").init("book","pubsub:test:book","<book xmlns='pubsub:test:book'><title>Lord of the Rings</title></book>");
    item = createObject("java", "org.jivesoftware.smackx.pubsub.Item").init(payload);
    myNode.publish(item);

However, it is the getNode() call that is causing my code to error.

I have verified that the nodes are being created by checking the DB used by my openfire server. I can see them in there, properly attributed as leaf nodes, etc.

Any advice? Anyone else out there doing anything with XMPP and ColdFusion? I have had great success sending and receiving messages with CF and Smack just haven't had the pubsub working yet :)

Thanks!

© Stack Overflow or respective owner

Related posts about coldfusion

Related posts about java