Mirko Zeibig created OAK-4485:
---------------------------------

             Summary: unable to check if node is locked or checked out
                 Key: OAK-4485
                 URL: https://issues.apache.org/jira/browse/OAK-4485
             Project: Jackrabbit Oak
          Issue Type: Bug
          Components: core
         Environment: OAK 1.3.7 (bundled with Sling 8)
            Reporter: Mirko Zeibig


I am unable to retrieve the locked and checked out information of a special 
node. What I have done:
{code}
Node vnode = session.getNode("/jcr:system/jcr:nodeTypes/nt:versionLabels");
NodeIterator vnc = vnode.getNodes();
while (vnc.hasNext()) {
    Node cofn = vnc.nextNode();
    cofn.getPath();
    cofn.getName();
    cofn.isCheckedOut();
    cofn.isLocked();
}
{code}

The requested (parent) node has 3 children:
* /jcr:system/jcr:nodeTypes/nt:versionLabels/rep:namedPropertyDefinitions
* /jcr:system/jcr:nodeTypes/nt:versionLabels/jcr:propertyDefinition[1]
* /jcr:system/jcr:nodeTypes/nt:versionLabels/rep:residualPropertyDefinitions

Calling {{isLocked}} on second one results in an execption:
{code}
javax.jcr.PathNotFoundException: Node 
/jcr:system/jcr:nodeTypes/nt:versionLabels/jcr:propertyDefinition not found
        at 
org.apache.jackrabbit.oak.jcr.lock.LockOperation.perform(LockOperation.java:59)
        at 
org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.perform(SessionDelegate.java:209)
        at 
org.apache.jackrabbit.oak.jcr.lock.LockManagerImpl.isLocked(LockManagerImpl.java:106)
        at 
org.apache.jackrabbit.oak.jcr.session.NodeImpl.isLocked(NodeImpl.java:1216)
{code}

calling {{isCheckedOut}} results in:
{code}
javax.jcr.PathNotFoundException: 
/jcr:system/jcr:nodeTypes/nt:versionLabels/jcr:propertyDefinition[1]
        at 
org.apache.jackrabbit.oak.jcr.version.VersionManagerImpl$3.perform(VersionManagerImpl.java:258)
        at 
org.apache.jackrabbit.oak.jcr.version.VersionManagerImpl$3.perform(VersionManagerImpl.java:251)
        at 
org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.perform(SessionDelegate.java:209)
        at 
org.apache.jackrabbit.oak.jcr.version.VersionManagerImpl.isCheckedOut(VersionManagerImpl.java:251)
        at 
org.apache.jackrabbit.oak.jcr.session.NodeImpl.isCheckedOut(NodeImpl.java:1133)
{code}

The paths in the exception messages are different!

Calling these methods on existing nodes should never result in an exception 
like the above-mentioned.





--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to