• es.git.openkm.core.LockException: Node locked.

  • OpenKM has many interesting features, but requires some configuration process to show its full potential.
OpenKM has many interesting features, but requires some configuration process to show its full potential.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #1543  by teeger
 
After I upload file with \'&\' sign the program will not let me delete it. I get this:
Code: Select all
ERROR [DirectDocumentModule] Node locked.
javax.jcr.lock.LockException: Node locked.
        at org.apache.jackrabbit.core.lock.XALockManager.checkLock(XALockManager.java:180)
        at org.apache.jackrabbit.core.NodeImpl.checkLock(NodeImpl.java:4232)
        at org.apache.jackrabbit.core.NodeImpl.restore(NodeImpl.java:3091)
        at es.git.openkm.module.direct.DirectDocumentModule.cancelCheckout(DirectDocumentModule.java:755)
        at es.git.openkm.api.OKMDocument.cancelCheckout(OKMDocument.java:182)
        at es.git.openkm.frontend.server.OKMDocumentServlet.cancelCheckout(OKMDocumentServlet.java:204)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:527)
        at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:164)
        at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
        at java.lang.Thread.run(Thread.java:595)
00:18:49,709 ERROR [OKMDocumentServlet] Node locked.
es.git.openkm.core.LockException: Node locked.
        at es.git.openkm.module.direct.DirectDocumentModule.cancelCheckout(DirectDocumentModule.java:776)
        at es.git.openkm.api.OKMDocument.cancelCheckout(OKMDocument.java:182)
        at es.git.openkm.frontend.server.OKMDocumentServlet.cancelCheckout(OKMDocumentServlet.java:204)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:527)
        at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:164)
        at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
        at java.lang.Thread.run(Thread.java:595)
Caused by: javax.jcr.lock.LockException: Node locked.
        at org.apache.jackrabbit.core.lock.XALockManager.checkLock(XALockManager.java:180)
        at org.apache.jackrabbit.core.NodeImpl.checkLock(NodeImpl.java:4232)
        at org.apache.jackrabbit.core.NodeImpl.restore(NodeImpl.java:3091)
        at es.git.openkm.module.direct.DirectDocumentModule.cancelCheckout(DirectDocumentModule.java:755)
        ... 30 more
Filesystem intergrity is OK running on GNU/Linux 2.6.18-6-686

file permission owned by ROOT , JBOSS/bin/run.sh running as ROOT tried OpenKM logon with admin (formly system) and still throws error. running latest stable build ver 3.0

please advise on next steps
 #2545  by ribizli
 
Hi pavila,

we\'ve got some kind of \'Lock\' error message, too.

We can\'t check-in or cancel the checkout for a specific document. But it seems so, that the error is related to the transaction handling not to the locking. Sorry, but I haven\'t any glue how the users put the document into this state, but I can\'t resolve it.

Attached can you find the related log part.


PS: there are some other opened issues (other unanswered forum posts) from our side, could you please process them too? [file name=log_txn_error.txt size=17940]http://www.openkm.com/images/fbfiles/fi ... _error.txt[/file]
 #2546  by ribizli
 
Hi pavila,

I know what happened. I\'ve changed the login logic to logout the old session if the same user logs in into the system (to avoid the 30 min waiting time if the browser was closed accidentally and the session was lost). I think my implementation was not correct and there exists two opened Jackrabbit sessions now. Here is my code:

DirectAuthModule:
Code: Select all
SessionManager sessions = SessionManager.getInstance();
String oldToken = sessions.getTokenByUserId(session.getUserID());

if (oldToken != null) {
  Session oldSession = sessions.getInfo(oldToken).getSession();
  oldSession.logout();
  sessions.remove(oldToken);
}
I think the \'oldSession.logout\' is not enough, is it? Should I call the AuthModule.logout(oldToken) too?

My second question is: How can I close now the locking session?

Thanks in advance.
 #2554  by pavila
 
The modifications in this part of code are specially dangerous and I don\'t recommend you touching this. These modifications can lead on several application dysfunctions.

An please, if you have modified the code you should specify it clearly in the question!

Which others questions are opened?
 #2583  by ribizli
 
Sorry about the late answer, but I was on a training last week.

About the issue above: my corrections work fine, but the locked files cannot be unlocked anymore regarding the topics I\'ve found about Jackrabbit. I deleted the nodes directly from the database as a 50% solution (because the same file name cannot be used in the folder).

I\'ll collect all still opened questions and post them in an affected topic later.

Thanks.
 #3454  by pejbx
 
Are you all saying that there is no way to cancel a checkout on a file. When the user logs in for the file that says it is checked out, the icon in the bottom left corner says there are zero files checked out for this user.

We can not cancel checkout, delete or upload and overwrite the checked out file, WHAT CAN WE DO?
thanks,

PJ
 #3463  by pavila
 
The lock token seems to be lost. You have to perform some low-level modifications in the repository to recover the lost token. Not an easy or recommended task if you don't have a good backup before it.
 #3464  by pejbx
 
We are experienced Linux programmers, can you supply instructions to perform the low level tasks you refer to.

Also, how does this happen and how can we prevent this in the future?

Thanks,

PJ
 #3481  by pavila
 
You have to get the lock node UUID, generate a new lock token and add it to the user session. Refer to Jackrabbit wiki list for more info.
 #4286  by arnk
 
Please can somebody help we - we have exactly the same problem with one of our most important files. The user checked it in OK, but at somepoint the network connection went down and now its in a locked state. As admin I can't unlock it - I am quite happy to force it back to a previous version if that was possible. I really need a solution for this thanks.

I would delete the lock file if I knew where to find it.

Alastair
 #4297  by pavila
 
You can generate a lock token invoking this method:
Code: Select all
com.openkm.util.JCRUtils.getLockToken(String id)
The "id" paramter is the locked document UUID. Once this lock token is generated, you should add this generated lock token to the user configuration. I mean, the user who make the lock. Before modify the user configuration, make sure the user is logged out.

Now log as okmAdmin and after that, go to http://localhost:8080/OpenKM/admin/repository_view.jsp. Now go to /okm:home/user_id/okm:config and edit the okm:lockTokens property. Add the previous generated.

Log as user_id and unlock the document.
 #4443  by arnk
 
Thanks for the help, but despite reading as much as I can find I still haven't figured out how to create the new token yet.
I assume that I need to write some Java to call com.openkm.util.JCRUtils.getLockToken(String id), compile it and then run it and get it to print out this new token. The rest of the instructions look OK. I have the id for the locked file. Have you got a script to create this token please?
Thanks
Al
 #4928  by arnk
 
I finally worked this out - apologies if this solution is not very elegant but its what worked for me on Windows with Java JDK 1.6 installed

1) Login as user who locked file and get the uuid of their locked document
2) Download the latest OpenKM 4.1 and extract the zip file to somewhere like C:\Users\Username\Files\OpenKM-4.1_JBoss-4.2.3.GA.zip
3) Go to C:\Users\Alastair\Files\OpenKM-4.1_JBoss-4.2.3.GA.zip\OpenKM-4.1_JBoss-4.2.3.GA\server\default\deploy and use 7-Zip to extract the OpenKM.war file into a new directory OpenKm
4) Open a cmd prompt (I used admin priviledges) and go to this directory
Code: Select all
cd C:\Users\Username\Files\OpenKM-4.1_JBoss-4.2.3.GA.zip\OpenKM-4.1_JBoss-4.2.3.GA\server\default\deploy\OpenKM\WEB-INF
5) Create a text file like this
Code: Select all
import es.git.openkm.util.JCRUtils;

public class GenerateId 
{
	public GenerateId() 
	{
		main(null);
	}

	public static void main(String[] args) 
	{
                // this is the uuid of the locked document
		String key = "9606a571-a177-49f3-a884-c41632a12345";
		String locktoken = JCRUtils.getLockToken(key);
		System.out.println(locktoken);
	}
}
6) Save this file as GenerateId.java in this directory
7) Type this at the cmd prompt
Code: Select all
set CLASSPATH=.;.\classes;.\lib\jcr-1.0.jar;.\lib\slf4j-api-1.5.3.jar;.\lib\slf4j-log4j12-1.5.3.jar;.\..\..\..\lib\log4j.jar
8) Compile the java program
Code: Select all
javac GenerateId.java
9) Run the java program
Code: Select all
java GenerateId
10) A UUID is created a bit like this
Code: Select all
9606a571-a177-49f3-a884-c41632a12345-6
11) Login as admin into OpenKM
12) Go to http://localhost:8080/OpenKM/repository_view.jsp (I am using version 3.0)
13) Click on the okm:home in the Childs section at the bottom
14) Click on the username (who has the locked file) in the Childs section at the bottom
15) Click on the okm:config in the Childs section at the bottom
16) Click on the edit link next to okm:lockTokens and paste in the UUID created in 10)
17) Logout as admin and login as the username with the locked file
18) Unlock the file

I hope this helps somebody else!

Al

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.