Page 2 of 3
Re: es.git.openkm.core.LockException: Node locked.
PostPosted:Tue Sep 28, 2010 8:53 pm
by El_Caballero
To find the locktoken of a file, you can run it directly in the run-script section. For example:
Code: Select alles.git.openkm.util.JCRUtils.getLockToken("93578f93-0bf7-493c-9fea-a9e75e4ea775");
It will give you the locktoken of the file with uuid "93578f93-0bf7-493c-9fea-a9e75e4ea775".
Another tip: When you are editing the okm:lockTokens, separate it with commas ( like "," ), iif you have severals lockTokens
Regarts
I guess that we can add the lockTokens with script too.
Re: es.git.openkm.core.LockException: Node locked.
PostPosted:Mon Oct 04, 2010 10:29 pm
by pavila
In OpenKM 5.0 okmAdmin user can unlock a document lock by another user. This simplifies the job for the repository administrator.
Re: es.git.openkm.core.LockException: Node locked.
PostPosted:Sun Jan 02, 2011 6:06 pm
by larson
I am afraid it is not true. I can't unlock document even with okmAdmin using version 5.0
Re: es.git.openkm.core.LockException: Node locked.
PostPosted:Thu Jan 13, 2011 10:24 am
by jmonin
For me :
- it works with the okmAdmin user
- it doesn't work with a user which has been granted the AdminRole role!
Re: es.git.openkm.core.LockException: Node locked.
PostPosted:Thu Jan 20, 2011 8:03 pm
by pavila
Some improvement have been made in this sense and are included at the nightbuild for the next OpenKM release:
http://integration.openkm.com/5.0/OpenKM.war.
Re: es.git.openkm.core.LockException: Node locked.
PostPosted:Sun Mar 06, 2011 11:21 am
by nils petersohn
hello,
i am having problems with this also in version 5.0.2. build 4894
everything i do below is with the user okmAdmin, which is the only user in my fresh install.
the case is that i somehow checked out a file and like to cancel the checkout.
i also played with webdav a lot. but i think that is not important here in this case or is it?
i am getting an exception not on line 180 like in the first post but on line 189 now:
Code: Select all05:46:22,327 ERROR [DirectDocumentModule] Node locked.
javax.jcr.lock.LockException: Node locked.
at org.apache.jackrabbit.core.lock.XALockManager.checkLock(XALockManager.java:189)
at org.apache.jackrabbit.core.ItemValidator.checkLock(ItemValidator.java:389)
at org.apache.jackrabbit.core.ItemValidator.checkCondition(ItemValidator.java:312)
at org.apache.jackrabbit.core.ItemValidator.checkModify(ItemValidator.java:274)
at org.apache.jackrabbit.core.NodeImpl.restore(NodeImpl.java:3607)
at com.openkm.module.direct.DirectDocumentModule.cancelCheckout(DirectDocumentModule.java:1025)
at com.openkm.api.OKMDocument.cancelCheckout(OKMDocument.java:169)
at com.openkm.frontend.server.OKMDocumentServlet.cancelCheckout(OKMDocumentServlet.java:234)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
...
The next steps i did were: select the file in the repository view. (see attachment)
when i click on unlock at the top (next to "remove current") the following exception occurs:
Code: Select all06:03:05,364 ERROR [RepositoryViewServlet] Node not locked by session: node /okm:root/Ihre Belegnummer_ 199016311658.eml
javax.jcr.lock.LockException: Node not locked by session: node /okm:root/Ihre Belegnummer_ 199016311658.eml
at org.apache.jackrabbit.core.lock.SessionLockManager.unlock(SessionLockManager.java:183)
at org.apache.jackrabbit.core.NodeImpl.unlock(NodeImpl.java:4680)
at com.openkm.servlet.admin.RepositoryViewServlet.unlock(RepositoryViewServlet.java:153)
at com.openkm.servlet.admin.RepositoryViewServlet.doGet(RepositoryViewServlet.java:96)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
...
i am not able to unlock the file with the information of the previous posts.
what is the architecture of the locking mechanism? how can i reset the locking state for a file?
Re: es.git.openkm.core.LockException: Node locked.
PostPosted:Mon Mar 07, 2011 9:57 am
by pavila
If a node was locked in WebDAV it can't be unlocked easilly. Some WebDAV clients are buggy with locks and may cause problems. Anyway, as I can see in the screenshot the lockOwner is okmAdmin so should be able to make the unlock. Please, run the SQL sentence:
And tell me the results.
Re: es.git.openkm.core.LockException: Node locked.
PostPosted:Mon Mar 07, 2011 11:23 pm
by nils petersohn
i am not really sure how to get to the database.
i tried the admistration sql shell with no results: this means there is no entry in the table.
Re: es.git.openkm.core.LockException: Node locked.
PostPosted:Tue Mar 08, 2011 7:37 pm
by pavila
I see the database is empty, so you need to generate the lock token for that node and make the insert.
Re: es.git.openkm.core.LockException: Node locked.
PostPosted:Sun Mar 27, 2011 11:10 pm
by jojo1976
Hi,
I have this problem just now....
I was editing with Open Office Addon with an empty new installation to try this extension.
Nom i'm afraid, i tried to unlock the file and I can't.... in a real enviroment this would be a problem.....
Re: es.git.openkm.core.LockException: Node locked.
PostPosted:Mon Mar 28, 2011 4:34 pm
by pavila
This issue is supposed to be fixed in OpenKM 5.0.3, so please, can you confirm which have you installed? Also would help the steps to reproduce the issue.
Re: es.git.openkm.core.LockException: Node locked.
PostPosted:Mon Mar 28, 2011 9:56 pm
by jojo1976
Ops.....
I was trying to reproduce the problem and finally got it.
The fault was totally mine ... The problem was that I closed the service with blocked documents and I had hibernate.dialect.HSQLDialect to create.....
I've done a lot of testing and everything works fine.
Sorry for the inconvenience

Re: es.git.openkm.core.LockException: Node locked.
PostPosted:Tue Mar 29, 2011 6:05 pm
by pavila
Then, good news for us

Re: es.git.openkm.core.LockException: Node locked.
PostPosted:Wed Apr 27, 2011 12:15 am
by roycal93
Hi people,
I have the same problem, can't make checkin - cancel checkout to a document that is locked by my user (OpenKM gives me the error Node Locked). According to what I read it happens because I'm trying to make something using a different token.
I know the best way to do it is by getting the token associated to my user and use it for the checkin-cancel checkout processes. But honestly I don't know where do you get this method: SessionManager sessions = SessionManager.getInstance();
String oldToken = sessions.getTokenByUserId(session.getUserID());
getTokenByUserId is the one I exactly need but I think it is not part of any web service I had used.
Please let me know if that method is available for openkm or I have to implement it on my project. (I am using c#)
Best regards,
RC.
Re: es.git.openkm.core.LockException: Node locked.
PostPosted:Wed Apr 27, 2011 7:53 am
by pavila
The checkout - checkin operation is performed from web interface or by web services?