Workaround for: Unable to unlock resources, because root folder is locked

From OpenCms Wiki
Jump to: navigation, search

Problem

I changed properties of the vfs root folder "/" with the source search feature. Now all resources are locked and I am not able to unlock them - even as Admin user. I get the following error message:

The following resources were not unlocked:
Error unlocking resource "/shared/" by current user "Admin" - Unable to unlock "/shared/", the lock is inherited from a parent folder.
Error unlocking resource "/sites/" by current user "Admin" - Unable to unlock "/sites/", the lock is inherited from a parent folder.
Error unlocking resource "/system/" by current user "Admin" - Unable to unlock "/system/", the lock is inherited from a parent folder. 

Solution (Workaround)

If someone ever has that problem, create a JSP in the VFS put in the following code, save it and call (click) it:

<%@page session="false" buffer="none" import="org.opencms.jsp.CmsJspActionElement" %>
<%
CmsJspActionElement jsp=new CmsJspActionElement(pageContext,request,response);
jsp.getCmsObject().unlockResource("/");
%>

Taken from https://github.com/alkacon/opencms-core/issues/367

This happened in OpenCms 9.5.2

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox