On 2012-05-10 13:39, Peter Fry wrote:
I am trying to debug why a node can't be added to a parent. I'm getting
a ItemExistsException at line 1281 of NodeImpl  i.e. in



         NodeState thisState = data.getNodeState();

         ChildNodeEntry cne = thisState.getChildNodeEntry(nodeName, 1);

         if (cne != null) {

             // there's already a child node entry with that name;

             // check same-name sibling setting of new node

             if (!def.allowsSameNameSiblings()) {

                 throw new ItemExistsException(

                         "This node already exists: "

                         + itemMgr.safeGetJCRPath(nodePath));

             }

             // check same-name sibling setting of existing node

             NodeImpl existing = itemMgr.getNode(cne.getId(),
getNodeId());

             if (!existing.getDefinition().allowsSameNameSiblings()) {

                 throw new ItemExistsException(

                         "Same-name siblings not allowed for " +
existing);

             }

         }



But when I query the respository with JCR 2 using:



NodeIterator nodes = node.getNodes();

while (nodes.hasNext()) {

        Node node1 = nodes.nextNode();

}



I don't get the node listed that is causing the collision. How come some
nodes show up in the addNode code

That don't show up in the node.getNodes() call?
...

Wild guess: permissions?

Reply via email to