cancel
Showing results for 
Search instead for 
Did you mean: 

CmisObjectNotFoundException: Not Found

mcasanket
Champ on-the-rise
Champ on-the-rise
Hi All,

I have developed one app using <strong>alfresco android sdk 1.3.1.</strong>

This app was running fine but suddenly it started throwing exception like <strong>CmisObjectNotFoundException: Not Found…</strong>

Sometimes it starts working automatically when I am in different LAN connection.


The alfresco is installed on local machine…
I am using Android studio and emulator for development.. however I am not able to connect through mobile too….
I am connecting to the alfresco using IP address as below…
<strong>this.session = RepositorySession.connect("http://192.168.43.73:8080/alfresco", username, password);</strong>
However the below line works fine..
<strong>String urlStr = url +"service/api/login?u=" +username +"&pw=" +password;</strong>

One more question I am having is, why I am not able to connect alfresco using localhost instead of IP address…?

<strong>Exception:</strong>

06-07 05:32:31.670    2225-2237/com.sign.alfdroid.app E/AndroidRuntime﹕ FATAL EXCEPTION: AsyncTask #1
    java.lang.RuntimeException: An error occured while executing doInBackground()
            at android.os.AsyncTask$3.done(AsyncTask.java:299)
     Caused by: org.alfresco.mobile.android.api.exceptions.AlfrescoSessionException: org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException: Not Found
            at org.alfresco.mobile.android.api.session.impl.AbstractAlfrescoSessionImpl.createSession(AbstractAlfrescoSessionImpl.java:460)
            at org.alfresco.mobile.android.api.session.impl.RepositorySessionImpl.authenticate(RepositorySessionImpl.java:93)
            at android.os.AsyncTask$2.call(AsyncTask.java:287)
     Caused by: <strong>org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException: Not Found</strong>
            at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(AbstractAtomPubService.java:474)
            at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.read(AbstractAtomPubService.java:621)
            at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.getRepositoriesInternal(AbstractAtomPubService.java:787)
4 REPLIES 4

jm_pascal
Star Contributor
Star Contributor
Aloah,

The localhost refers to the device on which the code is running, in this case the emulator and not your computer where Alfresco Server is installed.
If you want to refer to the computer which is running the Android simulator, use the IP address 10.0.2.2 instead. You can read more from here.

About the CmisObjectNotFoundException I think it might come from a network disconnection from your emulator.
Sometimes emulator have bad habits to disconnect intempestively from networks… which can cause this exception.
Check the network with opening a browser for example and try to go to the alfresco share interface.
If you can't it's surely a network issue.

If it's not the case, do you encounter this issue only during session creation or also when executing other part of your code ?

Hope it helps.

mcasanket
Champ on-the-rise
Champ on-the-rise
Thanks for your reply jm.pascal

The exception comes when I try to create a session…


Thanks!

jm_pascal
Star Contributor
Star Contributor
What's the version number of your Alfresco Repository ?

Thanks pascal,

Your first reply helped me and I solved the problem. As you told there could be problem with network and it was so…

I forgot to put Internet permission in my mobile app and that is why it was not getting connected….
Thanks a lot…