jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karakó Miklós <karako.mik...@ecmc.hu>
Subject RE: restoreVersion and ItemStateException
Date Thu, 17 Apr 2008 13:45:48 GMT
hi,

I did some investigation about it, and I found that it connected with our AccessManager class.
In the isGranted method we call the HierarchyManager's getPath() method. This method throws
the exception below.

isGrant is the following:
        NodeId nid = null;
        if (id.denotesNode()) {
                nid = (NodeId) id;
        } else {
                PropertyId pid = (PropertyId) id;
                nid = pid.getParentId();
        }

        Path path = hierarchyMgr.getPath(nid);

Is there any way to fix it? Or I have to check the node's path with an another (full-access)
Session in the AccessManager class?

regards,
Miki

javax.jcr.ItemNotFoundException: failed to build path of ca43f402-e682-49e9-99c4-40034b8316b0:
ca43f402-e682-49e9-99c4-40034b8316b0: ca43f402-e682-49e9-99c4-40034b8316b0
        at org.apache.jackrabbit.core.HierarchyManagerImpl.getPath(HierarchyManagerImpl.java:407)
        at ...EmptyAccessManager.evaluateRights(EmptyAccessManager.java:227)
        at ...EmptyAccessManager.isGranted(EmptyAccessManager.java:178)
        at org.apache.jackrabbit.core.ItemManager.getItem(ItemManager.java:391)
        at org.apache.jackrabbit.core.SessionImpl.getNodeById(SessionImpl.java:487)
        at org.apache.jackrabbit.core.SessionImpl.getNodeByUUID(SessionImpl.java:456)
        at org.apache.jackrabbit.core.NodeImpl.restoreFrozenState(NodeImpl.java:3961)
        at org.apache.jackrabbit.core.NodeImpl.restoreFrozenState(NodeImpl.java:3976)
        at org.apache.jackrabbit.core.NodeImpl.internalRestore(NodeImpl.java:3840)
        at org.apache.jackrabbit.core.NodeImpl.internalRestore(NodeImpl.java:3801)
        at org.apache.jackrabbit.core.NodeImpl.restore(NodeImpl.java:3072)
          ...
Caused by: org.apache.jackrabbit.core.state.NoSuchItemStateException: ca43f402-e682-49e9-99c4-40034b8316b0
        at org.apache.jackrabbit.core.state.SessionItemStateManager.getItemState(SessionItemStateManager.java:189)
        at org.apache.jackrabbit.core.HierarchyManagerImpl.getItemState(HierarchyManagerImpl.java:188)
        at org.apache.jackrabbit.core.ZombieHierarchyManager.getItemState(ZombieHierarchyManager.java:61)
        at org.apache.jackrabbit.core.HierarchyManagerImpl.getPath(HierarchyManagerImpl.java:402)
        ... 18 more
org.apache.jackrabbit.core.state.NoSuchItemStateException: ca43f402-e682-49e9-99c4-40034b8316b0
        at org.apache.jackrabbit.core.state.SessionItemStateManager.getItemState(SessionItemStateManager.java:189)
        at org.apache.jackrabbit.core.HierarchyManagerImpl.getItemState(HierarchyManagerImpl.java:188)
        at org.apache.jackrabbit.core.ZombieHierarchyManager.getItemState(ZombieHierarchyManager.java:61)
        at org.apache.jackrabbit.core.HierarchyManagerImpl.getPath(HierarchyManagerImpl.java:402)
        at ...EmptyAccessManager.evaluateRights(EmptyAccessManager.java:227)
        at ...EmptyAccessManager.isGranted(EmptyAccessManager.java:178)
        at org.apache.jackrabbit.core.ItemManager.getItem(ItemManager.java:391)
        at org.apache.jackrabbit.core.SessionImpl.getNodeById(SessionImpl.java:487)
        at org.apache.jackrabbit.core.SessionImpl.getNodeByUUID(SessionImpl.java:456)
        at org.apache.jackrabbit.core.NodeImpl.restoreFrozenState(NodeImpl.java:3961)
        at org.apache.jackrabbit.core.NodeImpl.restoreFrozenState(NodeImpl.java:3976)
        at org.apache.jackrabbit.core.NodeImpl.internalRestore(NodeImpl.java:3840)
        at org.apache.jackrabbit.core.NodeImpl.internalRestore(NodeImpl.java:3801)
        at org.apache.jackrabbit.core.NodeImpl.restore(NodeImpl.java:3072)


> -----Original Message-----
> From: Karakó Miklós [mailto:karako.miklos@ecmc.hu]
> Sent: Thursday, April 10, 2008 2:27 PM
> To: users@jackrabbit.apache.org
> Subject: restoreVersion and ItemStateException
>
> hi,
>
>
>
> Sometimes I got a mysterious ItemStateException when I try to restore a
> node's version with:
>
>
>
> node.restore("1.1", false);
>
>
>
> We use same-name-sibling and I (deep) lock the node before the restore
> call in a single thread environment.
>
> Could anyone explain why it is happened?
>
>
>
> best regards,
>
> Miki
>
>
>
> javax.jcr.RepositoryException: failed to add property
> {http://www.jcp.org/jcr/1.0}created to
> /Tartalom/Cikkek/cikk2/collection-element/binary-link: there's already
> a property state instance with id af292d3e-f051-46d2-a5fc-
> 50db9d992673/{http://www.jcp.org/jcr/1.0}created: there's already a
> property state instance with id af292d3e-f051-46d2-a5fc-
> 50db9d992673/{http://www.jcp.org/jcr/1.0}created
>
>                 at
> org.apache.jackrabbit.core.NodeImpl.createChildProperty(NodeImpl.java:4
> 80)
>
>                 at
> org.apache.jackrabbit.core.NodeImpl.getOrCreateProperty(NodeImpl.java:4
> 11)
>
>                 at
> org.apache.jackrabbit.core.NodeImpl.internalSetProperty(NodeImpl.java:1
> 300)
>
>                 at
> org.apache.jackrabbit.core.NodeImpl.restoreFrozenState(NodeImpl.java:38
> 99)
>
>                 at
> org.apache.jackrabbit.core.NodeImpl.restoreFrozenState(NodeImpl.java:39
> 77)
>
>                 at
> org.apache.jackrabbit.core.NodeImpl.restoreFrozenState(NodeImpl.java:39
> 77)
>
>                 at
> org.apache.jackrabbit.core.NodeImpl.internalRestore(NodeImpl.java:3842)
>
>                 at
> org.apache.jackrabbit.core.NodeImpl.internalRestore(NodeImpl.java:3803)
>
>                 at
> org.apache.jackrabbit.core.NodeImpl.restore(NodeImpl.java:3077)
>
>                 at
> hu.ecmc.felvi.editor.service.jcrservice.RepositoryServices.restoreVersi
> on(RepositoryServices.java:1517)
>
> ...
>
> Caused by: org.apache.jackrabbit.core.state.ItemStateException: there's
> already a property state instance with id af292d3e-f051-46d2-a5fc-
> 50db9d992673/{http://www.jcp.org/jcr/1.0}created
>
>                 at
> org.apache.jackrabbit.core.state.SessionItemStateManager.createTransien
> tPropertyState(SessionItemStateManager.java:620)
>
>                 at
> org.apache.jackrabbit.core.NodeImpl.createChildProperty(NodeImpl.java:4
> 61)
>
>                 ... 49 more
>
> org.apache.jackrabbit.core.state.ItemStateException: there's already a
> property state instance with id af292d3e-f051-46d2-a5fc-
> 50db9d992673/{http://www.jcp.org/jcr/1.0}created
>
>                 at
> org.apache.jackrabbit.core.state.SessionItemStateManager.createTransien
> tPropertyState(SessionItemStateManager.java:620)
>
>                 at
> org.apache.jackrabbit.core.NodeImpl.createChildProperty(NodeImpl.java:4
> 61)
>
>                 at
> org.apache.jackrabbit.core.NodeImpl.getOrCreateProperty(NodeImpl.java:4
> 11)
>
>                 at
> org.apache.jackrabbit.core.NodeImpl.internalSetProperty(NodeImpl.java:1
> 300)
>
>                 at
> org.apache.jackrabbit.core.NodeImpl.restoreFrozenState(NodeImpl.java:38
> 99)
>
>                 at
> org.apache.jackrabbit.core.NodeImpl.restoreFrozenState(NodeImpl.java:39
> 77)
>
>                 at
> org.apache.jackrabbit.core.NodeImpl.restoreFrozenState(NodeImpl.java:39
> 77)
>
>                 at
> org.apache.jackrabbit.core.NodeImpl.internalRestore(NodeImpl.java:3842)
>
>                 at
> org.apache.jackrabbit.core.NodeImpl.internalRestore(NodeImpl.java:3803)
>
>                 at
> org.apache.jackrabbit.core.NodeImpl.restore(NodeImpl.java:3077)
>
>                 at
> hu.ecmc.felvi.editor.service.jcrservice.RepositoryServices.restoreVersi
> on(RepositoryServices.java:1517)
>
>                 ...

Mime
View raw message