AnsweredAssumed Answered

Upload document using cmis is not working

Question asked by fouada on Jan 18, 2017
Latest reply on Jan 20, 2017 by progaman

Hi All,

I am trying to upload a document using below code and it is giving runtime exception.


private static void createDocument(Folder target, String newDocName) {
Map<String, String> props = new HashMap<String, String>();
props.put(PropertyIds.OBJECT_TYPE_ID, "cmis:document");
props.put(PropertyIds.NAME, newDocName);
System.out.println("This is a test document: " + newDocName);
String content = "aegif Mind Share Leader Generating New Paradigms by aegif corporation.";
byte[] buf = null;
try {
buf = content.getBytes("UTF-8");
} catch (UnsupportedEncodingException e) {
ByteArrayInputStream input = new ByteArrayInputStream(buf);
ContentStream contentStream = session.getObjectFactory()
.createContentStream(newDocName, buf.length,
"text/plain; charset=UTF-8", input);
target.createDocument(props, contentStream, VersioningState.MAJOR);


Below Exeption is coming:-


Exception in thread "main" org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException: Internal Server Error
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.ObjectServiceImpl.createFolder(
at org.apache.chemistry.opencmis.client.runtime.SessionImpl.createFolder(
at org.apache.chemistry.opencmis.client.runtime.FolderImpl.createFolder(
at org.apache.chemistry.opencmis.client.runtime.FolderImpl.createFolder(


Please let me know if I any thing is not correct or any thing is missing.


Thanks in advance!