cancel
Showing results for 
Search instead for 
Did you mean: 

when downloading a document from repository getting internal error

nareshvy
Champ in-the-making
Champ in-the-making

Hi, Im Using alfresco community 5 

my project config are : java 8,wildfly 8 ,

so will cmis will work on it, because i was trying since two days .i unable success on download any specific document . here follow some my code

String fileName = "abcd.docx";
String authURI = "http://127.0.0.1:8090/alfresco/service/api/login";
String username = "user1";
String password = "user1";
HttpUtils httpUtils = new HttpUtils();
String authTicket = ConstantsTemp.EMPTY;
try {
authTicket = httpUtils.getAuthTicket(authURI, username, password);
String url = "http://127.0.0.1:8090/alfresco/download/direct?path=/app:company_home/st:testuserone/cm:documentLibr..."
+ fileName + "?alf_ticket=" + authTicket;

System.out.println(url);
HttpClient client = new HttpClient();
GetMethod metodoGet = new GetMethod(url);
int status = client.executeMethod(metodoGet);
System.out.println(status);
byte[] file = metodoGet.getResponseBody();

metodoGet.releaseConnection();

} catch (Exception e) {

}

error : 

500
Internal Server Error

Folder not found: /st:testuserone (in workspace://SpacesStore/329bbf25-9ebb-4f47-845c-ddb16dd15852)

commons-httpclient-3.1.jar

commons-io-2.4.jar

and let me know can possible to retrieve list of file(link to download) from any one directory(folder)

15 REPLIES 15

nareshvy
Champ in-the-making
Champ in-the-making

no use , it also getting same issue org/apache/chemistry/opencmis/client/api/TransientCmisObject

kaynezhang
World-Class Innovator
World-Class Innovator

Which version of  alfresco-opencmis-extension are you using ,TransientCmisObject is not used any more. You need to use the latest 1.0 version of alfresco-opencmis-extension 

kaynezhang
World-Class Innovator
World-Class Innovator

Or you can try to remove

params.put(SessionParameter.OBJECT_FACTORY_CLASS,
"org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl");

from my exmple code.

nareshvy
Champ in-the-making
Champ in-the-making

thank you, now i getting input stream object  but how to send browser for download the stream oject

kaynezhang
World-Class Innovator
World-Class Innovator

The easiest way is to download the content  into a temp folder under real path your webapp .

and redirect your request to that file.

nareshvy
Champ in-the-making
Champ in-the-making

i am getting like this http://127.0.01:8090/alfresco/api/-default-/public/cmis/versions/1.1/atom/content/vRegCoSS-DAM.docx?...  please send the sample code for redirecting..