hi martijn,

On 4/6/07, Martijn Hendriks <[EMAIL PROTECTED]> wrote:
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:

hmm, a couple of questions:

- is the issue reproduceable with any item or does it
 only occur on an item with a specific definition?
- is a custom access manager involved? if yes, try
 again after disabling it in order to isolate the issue.
- is the issue reproduceable using either svn head
 revision or a released jackrabbit version? if so,
 please post a jira issue and, if possible, attach a
 simple test case.

happy eastern!
stefan


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: [EMAIL PROTECTED]

Wijchenseweg 111
6538 SW Nijmegen
http://www.gx.nl/

Reply via email to