jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martijn Hendriks" <marti...@gx.nl>
Subject Cannot remove node due to ItemNotFoundException
Date Fri, 06 Apr 2007 07:47:34 GMT
Hi all,

I am trying to remove a node with the following piece of code (using
Jackrabbit 1.2.1 + some patches):

// remove the item at absPath
Item item = jcrSession.getItem(absPath);
String targetPath = item.getParent().getPath();
item.remove();

This always fails with the following exception:

javax.jcr.ItemNotFoundException:
23685cab-326d-444e-ad38-c3064541dc3c/{http://gx.nl/wm9object}password
        at
org.apache.jackrabbit.core.ItemManager.createItemInstance(ItemManager.ja
va:527)
        at
org.apache.jackrabbit.core.ItemManager.getItem(ItemManager.java:325)
        at
org.apache.jackrabbit.core.NodeImpl.onRemove(NodeImpl.java:687)
        at
org.apache.jackrabbit.core.NodeImpl.onRemove(NodeImpl.java:672)
        at
org.apache.jackrabbit.core.NodeImpl.onRemove(NodeImpl.java:672)
        at
org.apache.jackrabbit.core.NodeImpl.onRemove(NodeImpl.java:672)
        at
org.apache.jackrabbit.core.NodeImpl.removeChildNode(NodeImpl.java:636)
        at
org.apache.jackrabbit.core.ItemImpl.internalRemove(ItemImpl.java:871)
        at
org.apache.jackrabbit.core.ItemImpl.remove(ItemImpl.java:1055)

The property that is to be removed in NodeImpl.onRemove() line 687 is a
non-mandatory property which is not set for the node.  So the call to
itemMgr.getItem(..) throws an ItemNotFoundException, which, I expect, is
correct behavior.
I think that it is strange that this particular property is part of the
state, while other non-mandatory properties that are also not set, are
not part of the state. I guess that the property which causes the error
should therefore not be part of the state. The question now is: how
could the node's state end up in this bad state?

(I noticed JCR-768 and applied the small change from the svn commit, but
the exception is still thrown).

Regards,

Martijn Hendriks
<GX> creative online development B.V.
 
t: 024 - 3888 261
f: 024 - 3888 621
e: martijnh@gx.nl
 
Wijchenseweg 111
6538 SW Nijmegen
http://www.gx.nl/ 

Mime
View raw message