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) {
e.printStackTrace();
}
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(AbstractAtomPubService.java:487)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.post(AbstractAtomPubService.java:629)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.ObjectServiceImpl.createFolder(ObjectServiceImpl.java:158)
at org.apache.chemistry.opencmis.client.runtime.SessionImpl.createFolder(SessionImpl.java:814)
at org.apache.chemistry.opencmis.client.runtime.FolderImpl.createFolder(FolderImpl.java:136)
at org.apache.chemistry.opencmis.client.runtime.FolderImpl.createFolder(FolderImpl.java:479)
at com.gl.main.SampleClient.createDocument(SampleClient.java:137)
at com.gl.main.SampleClient.main(SampleClient.java:38)
Please let me know if I any thing is not correct or any thing is missing.
Thanks in advance!
can you provide all of your catalina.out?
Thanks you Markus It was a silly mistake by seeing log I have seen license was expired.
wrong:
Map<String, String> props = new HashMap<String, String>();
correct:
Map<String, Object> props = new HashMap<String, Object>();
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.