AnsweredAssumed Answered

[Android] CMIS connection exception

Question asked by sbalajis on May 20, 2013
Latest reply on May 23, 2013 by jm.pascal
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-f794b6af4d02/children?id=workspace%3A%2F%2FSpacesStore%2F9e75bfb9-7fbf-477d-b23e-79f40f8fbd51&includeAllowableActions=true&includeRelationships=none&renditionFilter=cmis%3Anone&includePathSegment=true&maxItems=100&skipCount=0: 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)

Outcomes