01-02-2017 06:37 AM
Hi,
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(AbstractAtomPubService.java:473)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.read(AbstractAtomPubService.java:619)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.getObjectInternal(AbstractAtomPubService.java:842)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.ObjectServiceImpl.getObjectByPath(ObjectServiceImpl.java:628)
at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getObjectByPath(SessionImpl.java:554)
at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getObjectByPath(SessionImpl.java:532)
at com.someco.cmis.examples.CMISExampleBase.createTestDoc(CMISExampleBase.java:93)
at com.someco.cmis.examples.SomeCoCMISDataCreator.create(SomeCoCMISDataCreator.java:28)
at com.someco.cmis.examples.SomeCoCMISDataCreator.main(SomeCoCMISDataCreator.java:24)
01-02-2017 10:59 PM
When you say, under Documents, where exactly you are creating the folder? What I am saying is - click on Repository on top header and create a folder in it and test.
Hope this helps.
01-02-2017 07:16 AM
For a simple and quick test, create a folder under Repository. Use it's name while running the code and see if it works for you or not.
Hope this helps.
01-02-2017 10:27 PM
Thanks for replying. I have tried this by creating folder under Documents
but I have been getting same exception.
Regards
Amitabh
01-02-2017 10:59 PM
When you say, under Documents, where exactly you are creating the folder? What I am saying is - click on Repository on top header and create a folder in it and test.
Hope this helps.
01-03-2017 01:07 AM
Many thanks for the input, this has solved my problem. Earlier I was trying
to create a folder within a document library for a sample site that I
created. However many thanks for your guidance.
Regards
Amitabh
Explore our Alfresco products with the links below. Use labels to filter content by product module.