AnsweredAssumed Answered

Exception thrown while trying to grab a reference to the folder

Question asked by amitabhb74 on Jan 2, 2017
Latest reply on Jan 3, 2017 by amitabhb74


As i am trying to work through the sample code as provided in alfresco-developer-series-tutorials by Jeff Potts. I am facing a problem while creating content programmatically. This is occurring at the line where i am trying to grab a reference to the folder where we want to create the content.


public Document createTestDoc(String docName, String contentType) {
        Session session = getSession();
        Folder folder = (Folder) session.getObjectByPath("/" + getFolderName());




In the argument expected by the sample application I have tried to pass the default folder "SomeCo" as mentioned in the tutorial as well as some named folders as I see in the Alfresco ProjectLibrary but each time following exception is getting thrown -

Exception in thread "main" org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException: Object not found: /SomeCo
    at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(
    at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.getObjectInternal(
    at org.apache.chemistry.opencmis.client.bindings.spi.atompub.ObjectServiceImpl.getObjectByPath(
    at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getObjectByPath(
    at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getObjectByPath(
    at com.someco.cmis.examples.CMISExampleBase.createTestDoc(
    at com.someco.cmis.examples.SomeCoCMISDataCreator.create(
    at com.someco.cmis.examples.SomeCoCMISDataCreator.main(