Parent node is always null after restarting Openfire server.
Reproduction scenario:
-
create a pubsub leaf node with nodeId “myNode1” and root collection node set as parent (received via
XMPPServer.getInstance().getPubSubModule().getRootCollectionNode();
) -
read the node via
Node myNode1 = XMPPServer.getInstance().getPubSubModule().getNode("myNode1");
-
==>
myNode1.getParent()
returns the root collection node
So far, everything works as expected…
-
create a pubsub leaf node with nodeId “myNode2” and root collection node set as parent (received via
XMPPServer.getInstance().getPubSubModule().getRootCollectionNode();
) -
stop the Openfire server
-
start the Openfire server
-
read the node via
Node myNode2 = XMPPServer.getInstance().getPubSubModule().getNode("myNode2");
-
==>
myNode2.getParent()
returns null
Problem is the same as described in Error loading the parent of LeafNodes
The getParent()
checks parentIdentifier which is null because it is only set in the constructor and not when changeParent()
method will be called (which is the case after the nodes will be loaded from database during Openfire start).