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?

 

Thanks,

 

Peter.

 

Best Pensions Administration Software at the FT Pensions and Investment 
Provider Awards

This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to which they are addressed. If 
you have received this communication in error, please inform the sender by 
email immediately then delete the original e-mail and any attachments from your 
system. 
Heywood Limited. Registered in England No. 4161207. Registered Office: Aquila 
House 35 London Road Redhill Surrey RH1 1NJ

Please think about your environment before printing

Reply via email to