jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Koci <Martin.K...@aura.cz>
Subject Re: No item in ItemStateManager? Was: Strange exception: javax.jcr.ItemNotFoundException: d1a479a0-b822-43a3-8181-9380635fb02a
Date Mon, 19 Jun 2006 16:15:19 GMT
As I'm looking to current code, this exception is thrown with
SessionItemStateManager, because associated instances of
TransientItemStateManager and TransientItemStateManager haven'n this
item.

I don't understand what createItemInstance method in item manager does -
first called method is for getting state of newly creating item:

	try {
            state = itemStateProvider.getItemState(id);
        } catch (NoSuchItemStateException nsise) {
            throw new ItemNotFoundException(id.toString());
        }
But how can  item has such state when we are in method for creating this
item, so the item doesn't exist yet?

Thanks,

Martin

Martin Koci píše v Po 19. 06. 2006 v 12:00 +0200:
> Hello, 
> 
> I'm adding recursively nodes, but this leads to exception occasionally:
> javax.jcr.ItemNotFoundException: d1a479a0-b822-43a3-8181-9380635fb02a
> 	at
> org.apache.jackrabbit.core.ItemManager.createItemInstance(ItemManager.java:464)
> 	at org.apache.jackrabbit.core.ItemManager.getItem(ItemManager.java:320)
> 	at
> org.apache.jackrabbit.core.NodeImpl.internalAddChildNode(NodeImpl.java:794)
> 	at
> org.apache.jackrabbit.core.NodeImpl.internalAddNode(NodeImpl.java:738)
> 	at
> org.apache.jackrabbit.core.NodeImpl.internalAddNode(NodeImpl.java:685)
> 	at org.apache.jackrabbit.core.NodeImpl.addNode(NodeImpl.java:1772)
> 	at
> cz.aura.cms.preferences.impl.PreferencesServiceImpl.addRecursively(PreferencesServiceImpl.java:195)
> 
> 
> My code is:
> for (int i = 0; i < nodeNames.length; i++) {
> 	    relPath = nodeNames[i];
>                 if (workNode.hasNode(relPath) == false) {
>                     Node node = workNode.addNode(relPath);
>                     workNode = node;
>                 } else {
>                     workNode = workNode.getNode(relPath);
>                 }
> }
> 
> Unfortunately this behaviour is not reproducible with test and come on
> accidentally.
> 
> Thanks,
> 
> Martin
> 
> 
> 


Mime
View raw message