[opencms-dev] getting exception while creating folder in OPencms

Raj Malhotra rajvinder.forummails at gmail.com
Thu Sep 11 16:28:31 CEST 2008


Hi
I am working  on OpenCms 6.2.3 .I am trying to create a folder in OPencms
using java API call. but i am getting the following error.I manually deleted
the locks from CMS_EXCLUSIVE_LOCKS table but still i am getting this
exception .I am not getting why it its giving me the error.Piece of  code
which is throwing this error is :-

websiteEntityFolderPath = userSitesUnderNode + FOLDER_SEPARATOR +
modifiedWebsiteEntityName;

                if (!(cmsObj.existsResource(websiteEntityFolderPath,
CmsResourceFilter.IGNORE_EXPIRATION))) {
                cmsObj.createResource(websiteEntityFolderPath,
CmsResourceTypeFolder.RESOURCE_TYPE_ID);

                // Add folderName property to the newly created resources
                // -userfolder.
                CmsProperty websiteEnityFolderNameProp = new CmsProperty();
                websiteEnityFolderNameProp.setName(FOLDER_NAME);

websiteEnityFolderNameProp.setAutoCreatePropertyDefinition(true);

websiteEnityFolderNameProp.setValue(modifiedWebsiteEntityName,
CmsProperty.TYPE_INDIVIDUAL);
                cmsObj.lockResource(websiteEntityFolderPath);
                cmsObj.writePropertyObject(websiteEntityFolderPath,
websiteEnityFolderNameProp);


------
--
--


The exception is given below-
If somone has already met with such problem please point me where i am
wrong.


CmsException in creating WebsiteFolder
org.opencms.lock.CmsLockException: Error creating the resource
"/sites/default/Root/usersites/web/".
        at
org.opencms.lock.CmsLockException.createException(CmsLockException.java:78)
        at org.opencms.db.CmsDbContext.throwException(CmsDbContext.java:213)
        at org.opencms.db.CmsDbContext.report(CmsDbContext.java:197)
        at
org.opencms.db.CmsSecurityManager.createResource(CmsSecurityManager.java:1094)
        at
org.opencms.file.types.A_CmsResourceType.createResource(A_CmsResourceType.java:303)
        at
org.opencms.file.types.A_CmsResourceTypeFolderBase.createResource(A_CmsResourceTypeFolderBase.java:171)
        at org.opencms.file.CmsObject.createResource(CmsObject.java:621)
        at org.opencms.file.CmsObject.createResource(CmsObject.java:601)
        at
com.dorado.cmsserver.util.MyUtil.createWebsiteEntity(MyUtil.java:3195)
        at
com.dorado.cmsserver.processor.CmsGatewayRequestProcessor.createWebsiteEntity(CmsGatewayRequestProcessor.java:419)
        at
com.dorado.cmsserver.servlet.CmsGatewayServlet.processRequest(CmsGatewayServlet.java:326)
        at
com.dorado.cmsserver.servlet.CmsGatewayServlet.doPost(CmsGatewayServlet.java:359)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
        at
weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
        at
weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
        at
weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:272)
        at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
        at
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
        at
org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:164)
        at
org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141)
        at
org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90)
        at
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:406)
        at
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
        at
com.dorado.cmsserver.servlet.CmsGatewayFilter.doFilter(CmsGatewayFilter.java:39)
        at
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
        at
com.dorado.cmsserver.servlet.SiteHandlerFilter.doFilter(SiteHandlerFilter.java:70)
        at
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
        at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3151)
        at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
        at
weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1973)
        at
weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1880)
        at
weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1310)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:179)
Caused by: org.opencms.lock.CmsLockException: Resource
"/sites/default/Root/usersites/web/" is already locked by another user.
        at
org.opencms.lock.CmsLockManager.addResource(CmsLockManager.java:184)
        at
org.opencms.db.CmsDriverManager.lockResource(CmsDriverManager.java:4001)
        at
org.opencms.db.CmsDriverManager.createResource(CmsDriverManager.java:1703)
        at
org.opencms.db.CmsDriverManager.createResource(CmsDriverManager.java:1785)
        at
org.opencms.db.CmsSecurityManager.createResource(CmsSecurityManager.java:1092)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20080911/358935bf/attachment.htm>


More information about the opencms-dev mailing list