jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Angela Schreiber <anch...@adobe.com>
Subject Re: setPolicy javax.jcr.ItemExistsException? bug???
Date Tue, 23 Oct 2012 07:39:44 GMT
hi

the access control content is protected and you cannot
remove it using regular JCR write operations.

please use methods provided by AccessControlManager and 
AccessControlList to get/set policies and manipulate the
set of ACEs, respectively. You may even want to use the
AccessControlUtils present with jcr-commons if you use
the default ac-model present with jackrabbit.

i suspect that your 'removeItem' method catches the
ConstraintViolationException that is thrown when trying
to modify protected items... in any case the ACE node
was most probably never removed which in turn explains
the ItemExistsException and the non-zero size.

bref: not a bug. user error :)

regards
angela



On 10/23/12 2:58 AM, dbac wrote:
>
> aclNode = acNode.getNode(N_POLICY);
>              // remove all existing aces
>              for (NodeIterator aceNodes = aclNode.getNodes();
> aceNodes.hasNext();) {
>                  NodeImpl aceNode = (NodeImpl) aceNodes.nextNode();
>                  removeItem(aceNode);
>              }
>
>              System.out.println(aclNode.getNodes().getSize());  //0
>               but  aclNode.getNodeState().getChildNodeEntries().size()  //59
> why not 0???
>
>              why?
>               because this problem,  when  add  a node ,its name  is  in
> these childNodeEntries  ,so  ItemExistsException,  it's a bug??
>
>
>
> --
> View this message in context: http://jackrabbit.510166.n4.nabble.com/setPolicy-javax-jcr-ItemExistsException-bug-tp4656857.html
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Mime
View raw message