Creating a PubSub node hierarchy

I am trying to put together a PubSub node hierarchy with Smack 3.3. The only methods I’ve found so far for this are the setChildren and getChildren methods of the ConfigurationForm class.It seems that the setChildren calls pass, but I don’t know how to (easily) check whether I achieved what I wanted. The real problem is caused by getChildren, which always throws a NullPointerException. The code goes like this:

Node parent = this.getChannel(parentId);

ConfigureForm fp = parent.getNodeConfiguration();

Iterator it = fp.getChildren();

In this case parent is an existing PubSub node which is successfully found by my local method. The last line throws the null exception.

My questions are:

  1. Any clues what am I doing wrong?

  2. Is this supported at all?

  3. Should I create the PubSub node hierarchy in a different way?

What server are you using? There was a bug in Openfire (OF-572) related to this that was fixed in version 3.8.

The methods you are using should work, there is also the set/getCollection() method which is the inverse. It sets/gets the parent of the current node.

Thank you for your response. In the meantime I managed to get it working with set/getCollection as you suggested. As far as the server version is concerned, I built 3.8.1 from the latest sources on Windows 7 less than a month ago.