title: How to unlock a node in Jackrabbit held by Open-scoped Locks?
body: <p>I have locked a node using the below code</p>
  
  <pre><code>ocm.lock("/path1", true, true);
  </code></pre>
  
  <p>Here the 3rd argument is true which states that it is a <code>Open-scoped Locks.</code></p>
  
  <p>And it is successfully locked.</p>
  
  <p>But now i am writing a new Java Program to unlock a node.</p>
  
  <pre><code>boolean b1 = ocm.isLocked("/path1");
  System.out.println(b1);                      // RETURNS TRUE.
  Node n = session.getNode("/path1");
  Lock l = n.getLock();
  ocm.unlock("/path1", l.getLockToken());
  </code></pre>
  
  <p>But i am getting a exception here. And it is not unlocking the node.</p>
  
  <pre><code>ERROR [main] ObjectContentManagerImpl.java:957 Cannot unlock path: /path1 Jcr user: admin has no lock token to do this. Lock was placed with user: admin
  Exception in thread "main" org.apache.jackrabbit.ocm.exception.IllegalUnlockException
      at org.apache.jackrabbit.ocm.manager.impl.ObjectContentManagerImpl.unlock(ObjectContentManagerImpl.java:958)
      at ocm.UnlockNode.main(UnlockNode.java:36)
  </code></pre>
  
  <p>How i can unlock the node?</p>
  
  <p>My <code>UnlockNode.java</code> code.</p>
  
  <pre><code>Repository repository = new URLRemoteRepository("http://localhost:8083/rmi");
  Session session = repository.login(new SimpleCredentials("admin","admin".toCharArray()));
  Mapper mapper = new AnnotationMapperImpl(classes);
  ObjectContentManager ocm = new ObjectContentManagerImpl(session, mapper);
  
  LockManager lm = session.getWorkspace().getLockManager();
  lm.addLockToken("a096a79c-5edf-4a17-baa4-aba01f8013d8-J");
  boolean b1 = ocm.isLocked("/path1");
  System.out.println(b1);
  try {
      ocm.unlock("/path1","a096a79c-5edf-4a17-baa4-aba01f8013d8-J");
  }catch (Exception e) {
      System.out.println(e);
  }
  </code></pre>
  
  <p>Thanks.</p>