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)
Solved! Go to Solution.
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.
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.
Thanks for replying. I have tried this by creating folder under Documents
but I have been getting same exception.
Regards
Amitabh
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.
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
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.