alfrescoalfresco-shareopencmisapache-chemistry

Alfresco: Failed to create directory


I have created a simple example to create document in alfresco using apache chemistry. I was working fine and able to create document. But when I restart my machine and alfresco server then now same program giving me error-

org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException: 06220002 Failed to create directory for file storage: /home/alfresco/alfresco-community/alf_data/contentstore/2016/7/22/16/57 at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(AbstractAtomPubService.java:523) at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.post(AbstractAtomPubService.java:717) at org.apache.chemistry.opencmis.client.bindings.spi.atompub.ObjectServiceImpl.createDocument(ObjectServiceImpl.java:122) at org.apache.chemistry.opencmis.client.runtime.SessionImpl.createDocument(SessionImpl.java:1165) at org.apache.chemistry.opencmis.client.runtime.FolderImpl.createDocument(FolderImpl.java:77) at org.apache.chemistry.opencmis.client.runtime.FolderImpl.createDocument(FolderImpl.java:460) at com.bizruntime.alfresco.cmis.upload.CreateDocument.createDocumentInAlfrescoRepository(CreateDocument.java:81) at com.bizruntime.alfresco.cmis.upload.CreateDocumentTest.testCreateDocInAlfrescoRepository(CreateDocumentTest.java:16) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

please someone help.


Solution

  • I guess you have an issue with file permissions on your host! To verify the issue you will need to upload/create a document in alfresco using the share interface, if you were not successful, this means my doubts are right: The system user running your tomcat instance does not have the right to write to alf_data directory.

    Possible reasons : System mis-configuration, You are running alfresco service with a different user ....

    Candidate solution :

    1. Detect which user should be running alfresco (probably the owner of /home/alfresco) You can find it out by running this :

      root@alfhost$>ls -la /home/alfresco
      
    2. Assuming that the username is alfresco, run this script with root account on your host :

      root@alfhost$>chown alfresco /home/alfresco -R
      
    3. Restart your service using that same account