cancel
Showing results for 
Search instead for 
Did you mean: 

[Android] CMIS connection exception

sbalajis
Champ in-the-making
Champ in-the-making
Hi, I am currently developing an android app using OpenCMIS to download files from alfresco hosted on the AWS. I am trying to do concurrent downloads. Say, One one tab, I click a button to download a file. When the download is happening , I go to another tab and click an image view to download it and display it on the server. This works fine on a normal WIFI connection(around 2mbps) but when I try to do the above activities from the app on a mobile connection(2G/3G) connection, I get the following error. I am not sure if this is due to a slow internet connection. If so is there a work around? Is there a better way to do concurrent activities in a single session.

Please let me know if the information provided is insufficient. Thanks for your help.
I attached a log file showing the error, but was not displayed in the preview. So I pasted the chunk of the error here.

The code that is causing error:

Folder folder = (Folder)o;                     
String folderName = folder.getName();
Log.d(TAG,folderName);
ItemIterable<CmisObject>photos = folder.getChildren();
if (photos.getTotalNumItems() > 0) 
   for (CmisObject p : photos){
   if (p.getBaseTypeId().equals(BaseTypeId.CMIS_DOCUMENT)){
   Document photo = (Document) p;
   String photoName = photo.getName();
   Log.d(TAG,photoName);
   ImageFolder imageFolder = new ImageFolder(folderName," ",photoName,,getContext());

Following is the error message


05-20 20:00:35.971: E/AndroidRuntime(22862): FATAL EXCEPTION: AsyncTask #5
05-20 20:00:35.971: E/AndroidRuntime(22862): java.lang.RuntimeException: An error occured while executing doInBackground()
05-20 20:00:35.971: E/AndroidRuntime(22862):    at android.os.AsyncTask$3.done(AsyncTask.java:278)
05-20 20:00:35.971: E/AndroidRuntime(22862):    at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
05-20 20:00:35.971: E/AndroidRuntime(22862):    at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
05-20 20:00:35.971: E/AndroidRuntime(22862):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
05-20 20:00:35.971: E/AndroidRuntime(22862):    at java.util.concurrent.FutureTask.run(FutureTask.java:137)
05-20 20:00:35.971: E/AndroidRuntime(22862):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
05-20 20:00:35.971: E/AndroidRuntime(22862):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
05-20 20:00:35.971: E/AndroidRuntime(22862):    at java.lang.Thread.run(Thread.java:856)
05-20 20:00:35.971: E/AndroidRuntime(22862): Caused by: org.apache.chemistry.opencmis.commons.exceptions.CmisConnectionException: Cannot access http://ec2-54-234-102-147.compute-1.amazonaws.com/alfresco/cmisatom/8a3a243e-0430-499d-9908-f794b6af...: null
05-20 20:00:35.971: E/AndroidRuntime(22862):    at org.apache.chemistry.opencmis.client.bindings.spi.http.HttpUtils.invoke(HttpUtils.java:224)
05-20 20:00:35.971: E/AndroidRuntime(22862):    at org.apache.chemistry.opencmis.client.bindings.spi.http.HttpUtils.invokeGET(HttpUtils.java:66)
05-20 20:00:35.971: E/AndroidRuntime(22862):    at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.read(AbstractAtomPubService.java:544)
05-20 20:00:35.971: E/AndroidRuntime(22862):    at org.apache.chemistry.opencmis.client.bindings.spi.atompub.NavigationServiceImpl.getChildren(NavigationServiceImpl.java:88)
05-20 20:00:35.971: E/AndroidRuntime(22862):    at org.apache.chemistry.opencmis.client.runtime.FolderImpl$2.fetchPage(FolderImpl.java:259)
05-20 20:00:35.971: E/AndroidRuntime(22862):    at org.apache.chemistry.opencmis.client.runtime.util.AbstractIterator.getCurrentPage(AbstractIterator.java:132)
05-20 20:00:35.971: E/AndroidRuntime(22862):    at org.apache.chemistry.opencmis.client.runtime.util.AbstractIterator.getTotalNumItems(AbstractIterator.java:70)
05-20 20:00:35.971: E/AndroidRuntime(22862):    at org.apache.chemistry.opencmis.client.runtime.util.AbstractIterable.getTotalNumItems(AbstractIterable.java:94)
05-20 20:00:35.971: E/AndroidRuntime(22862):    at com.jfwApp.services.DownloadImageFolders$1DownloadImageFolderTask.doInBackground(DownloadImageFolders.java:102)
05-20 20:00:35.971: E/AndroidRuntime(22862):    at com.jfwApp.services.DownloadImageFolders$1DownloadImageFolderTask.doInBackground(DownloadImageFolders.java:1)
05-20 20:00:35.971: E/AndroidRuntime(22862):    at android.os.AsyncTask$2.call(AsyncTask.java:264)
05-20 20:00:35.971: E/AndroidRuntime(22862):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
05-20 20:00:35.971: E/AndroidRuntime(22862):    … 4 more
05-20 20:00:35.971: E/AndroidRuntime(22862): Caused by: java.io.EOFException
05-20 20:00:35.971: E/AndroidRuntime(22862):    at libcore.io.Streams.readAsciiLine(Streams.java:203)
05-20 20:00:35.971: E/AndroidRuntime(22862):    at libcore.net.http.HttpEngine.readResponseHeaders(HttpEngine.java:544)
05-20 20:00:35.971: E/AndroidRuntime(22862):    at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:784)
05-20 20:00:35.971: E/AndroidRuntime(22862):    at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:274)
05-20 20:00:35.971: E/AndroidRuntime(22862):    at libcore.net.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:479)
05-20 20:00:35.971: E/AndroidRuntime(22862):    at org.apache.chemistry.opencmis.client.bindings.spi.http.HttpUtils.invoke(HttpUtils.java:204)
05-20 20:00:35.971: E/AndroidRuntime(22862):    … 15 more
05-20 20:00:43.561: D/OpenGLRenderer(22862): Flushing caches (mode 0)
05-20 20:00:43.591: D/memalloc(22862): /dev/pmem: Unmapping buffer base:0x53585000 size:7188480 offset:5652480
05-20 20:00:43.591: D/memalloc(22862): /dev/pmem: Unmapping buffer base:0x54580000 size:11796480 offset:10260480
05-20 20:00:43.591: D/memalloc(22862): /dev/pmem: Unmapping buffer base:0x550c0000 size:13332480 offset:11796480
05-20 20:00:43.791: D/OpenGLRenderer(22862): Flushing caches (mode 2)
5 REPLIES 5

jm_pascal
Star Contributor
Star Contributor
Aloah,

What version of opencmis do you use ?

Related to your log it seems the url is malformated. It terminated with an ":" character instead of nothing.


sbalajis
Champ in-the-making
Champ in-the-making
Hi Pascal, Thanks for your time.
I used opencmis for android client version 0.8.0. The URL was generated by the CMIS. Not sure what went wrong there.

Thanks

Could you try with this version 0.8.0-alfresco-patched or eventually with the latest one from apache chemistry  CI

sbalajis
Champ in-the-making
Champ in-the-making
Thank You very much for your help. I will try with the latest from apache chemistry CI and will update how it worked.

sbalajis
Champ in-the-making
Champ in-the-making
Hi, I tried with the latest version of the opencmis android client but I am having the same problem. Again, it works with a tablet connected to WIFI but it is giving problem on a mobile phone on a 2G/3G connection.Please let me know if you would need any other details. Thanks.