cancel
Showing results for 
Search instead for 
Did you mean: 

Exception in 1.2.0 API

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

I am developing one application using Alfresco Android SDK. Before I was using Alfresco Android 1.1.0 SDK and it was working fine. Today when I upgraded the api to alfresco-android-sdk-1.2.0 it started throwing exception about class Definition Not Found.

Below is the exception.
<strong>java.lang.NoClassDefFoundError: org.alfresco.mobile.android.api.services.impl.AbstractSiteServiceImpl</strong>


<strong>Full StackTrace</strong><br />
08-07 13:20:00.031: D/dalvikvm(15271): VFY: dead code 0x0005-0035 in Lorg/alfresco/mobile/android/api/services/impl/onpremise/OnPremiseSiteServiceImpl;.parseData (Ljava/lang/String;Ljava/util/MapSmiley WinkLorg/alfresco/mobile/android/api/model/Site;
08-07 13:20:00.031: W/dalvikvm(15271):  <strong>Unable to resolve superclass of </strong> Lorg/alfresco/mobile/android/api/services/impl/AbstractSiteServiceImpl$1; (403)
08-07 13:20:00.031: W/dalvikvm(15271):  <strong>Link of class </strong> 'Lorg/alfresco/mobile/android/api/services/impl/AbstractSiteServiceImpl$1;'  <strong>failed </strong>
08-07 13:20:00.031: E/dalvikvm(15271): <strong> Could not find class  </strong>'org.alfresco.mobile.android.api.services.impl.AbstractSiteServiceImpl$1', referenced from method org.alfresco.mobile.android.api.services.impl.AbstractSiteServiceImpl.<init>
08-07 13:20:00.031: W/dalvikvm(15271): VFY: unable to resolve new-instance 861 (Lorg/alfresco/mobile/android/api/services/impl/AbstractSiteServiceImpl$1Smiley Wink in Lorg/alfresco/mobile/android/api/services/impl/AbstractSiteServiceImpl;
08-07 13:20:00.031: D/dalvikvm(15271): VFY: replacing opcode 0x22 at 0x0003
08-07 13:20:00.031: D/dalvikvm(15271): VFY: dead code 0x0005-000c in Lorg/alfresco/mobile/android/api/services/impl/AbstractSiteServiceImpl;.<init> (Lorg/alfresco/mobile/android/api/session/AlfrescoSessionSmiley WinkV
08-07 13:20:00.039: W/dalvikvm(15271): VFY: unable to resolve virtual method 3038: Landroid/util/LruCache;.size ()I
08-07 13:20:00.039: D/dalvikvm(15271): VFY: replacing opcode 0x6e at 0x0006
08-07 13:20:00.039: D/dalvikvm(15271): VFY: dead code 0x0009-0014 in Lorg/alfresco/mobile/android/api/services/impl/AbstractSiteServiceImpl;.initExtraPropertiesCache ()V
08-07 13:20:00.039: W/dalvikvm(15271): Unable to resolve superclass of Lorg/alfresco/mobile/android/api/services/impl/AbstractSiteServiceImpl$2; (403)
08-07 13:20:00.039: W/dalvikvm(15271): Link of class 'Lorg/alfresco/mobile/android/api/services/impl/AbstractSiteServiceImpl$2;' failed
08-07 13:20:00.039: E/dalvikvm(15271): Could not find class 'org.alfresco.mobile.android.api.services.impl.AbstractSiteServiceImpl$2', referenced from method org.alfresco.mobile.android.api.services.impl.AbstractSiteServiceImpl.clear
08-07 13:20:00.039: W/dalvikvm(15271): VFY: unable to resolve new-instance 862 (Lorg/alfresco/mobile/android/api/services/impl/AbstractSiteServiceImpl$2Smiley Wink in Lorg/alfresco/mobile/android/api/services/impl/AbstractSiteServiceImpl;
08-07 13:20:00.039: D/dalvikvm(15271): VFY: replacing opcode 0x22 at 0x0004
08-07 13:20:00.039: W/dalvikvm(15271): VFY: unable to resolve virtual method 3035: Landroid/util/LruCache;.evictAll ()V
08-07 13:20:00.039: D/dalvikvm(15271): VFY: replacing opcode 0x6e at 0x000f
08-07 13:20:00.039: D/dalvikvm(15271): VFY: dead code 0x0006-000c in Lorg/alfresco/mobile/android/api/services/impl/AbstractSiteServiceImpl;.clear ()V
08-07 13:20:00.039: D/dalvikvm(15271): VFY: dead code 0x0012-0012 in Lorg/alfresco/mobile/android/api/services/impl/AbstractSiteServiceImpl;.clear ()V
08-07 13:20:00.046: W/dalvikvm(15271): VFY: unable to resolve virtual method 3036: Landroid/util/LruCache;.get (Ljava/lang/ObjectSmiley WinkLjava/lang/Object;
08-07 13:20:00.046: D/dalvikvm(15271): VFY: replacing opcode 0x6e at 0x0006
08-07 13:20:00.046: D/dalvikvm(15271): VFY: dead code 0x0009-001b in Lorg/alfresco/mobile/android/api/services/impl/AbstractSiteServiceImpl;.refresh (Lorg/alfresco/mobile/android/api/model/SiteSmiley WinkLorg/alfresco/mobile/android/api/model/Site;
08-07 13:20:00.046: W/dalvikvm(15271): VFY: unable to resolve virtual method 3037: Landroid/util/LruCache;.put (Ljava/lang/Object;Ljava/lang/ObjectSmiley WinkLjava/lang/Object;
08-07 13:20:00.046: D/dalvikvm(15271): VFY: replacing opcode 0x6e at 0x002e
08-07 13:20:00.046: W/dalvikvm(15271): VFY: unable to resolve virtual method 3037: Landroid/util/LruCache;.put (Ljava/lang/Object;Ljava/lang/ObjectSmiley WinkLjava/lang/Object;
08-07 13:20:00.046: D/dalvikvm(15271): VFY: replacing opcode 0x6e at 0x0056
08-07 13:20:00.054: W/dalvikvm(15271): VFY: unable to resolve virtual method 3037: Landroid/util/LruCache;.put (Ljava/lang/Object;Ljava/lang/ObjectSmiley WinkLjava/lang/Object;
08-07 13:20:00.054: D/dalvikvm(15271): VFY: replacing opcode 0x6e at 0x0076
08-07 13:20:00.054: D/dalvikvm(15271): VFY: dead code 0x0031-003a in Lorg/alfresco/mobile/android/api/services/impl/AbstractSiteServiceImpl;.retrieveExtraProperties (Ljava/util/List;Ljava/util/List;Ljava/util/ListSmiley WinkV
08-07 13:20:00.054: D/dalvikvm(15271): VFY: dead code 0x0059-005e in Lorg/alfresco/mobile/android/api/services/impl/AbstractSiteServiceImpl;.retrieveExtraProperties (Ljava/util/List;Ljava/util/List;Ljava/util/ListSmiley WinkV
08-07 13:20:00.054: D/dalvikvm(15271): VFY: dead code 0x0079-0079 in Lorg/alfresco/mobile/android/api/services/impl/AbstractSiteServiceImpl;.retrieveExtraProperties (Ljava/util/List;Ljava/util/List;Ljava/util/ListSmiley WinkV
08-07 13:20:00.054: W/dalvikvm(15271): VFY: unable to resolve virtual method 3036: Landroid/util/LruCache;.get (Ljava/lang/ObjectSmiley WinkLjava/lang/Object;
08-07 13:20:00.054: D/dalvikvm(15271): VFY: replacing opcode 0x6e at 0x0002
08-07 13:20:00.054: D/dalvikvm(15271): VFY: dead code 0x0005-001b in Lorg/alfresco/mobile/android/api/services/impl/AbstractSiteServiceImpl;.updateExtraPropertyCache (Ljava/lang/String;ZZZ)V
08-07 13:20:00.054: W/System.err(15271): <strong>java.lang.NoClassDefFoundError: org.alfresco.mobile.android.api.services.impl.AbstractSiteServiceImpl$1</strong>
08-07 13:20:00.062: W/System.err(15271):    at org.alfresco.mobile.android.api.services.impl.AbstractSiteServiceImpl.<init>(AbstractSiteServiceImpl.java:424)
08-07 13:20:00.062: W/System.err(15271):    at org.alfresco.mobile.android.api.services.impl.onpremise.OnPremiseSiteServiceImpl.<init>(OnPremiseSiteServiceImpl.java:83)
08-07 13:20:00.062: W/System.err(15271):    at org.alfresco.mobile.android.api.services.impl.onpremise.OnPremiseServiceRegistry.getSiteService(OnPremiseServiceRegistry.java:60)
08-07 13:20:00.062: W/System.err(15271):    at com.sign.android.alfresco.ManageSitesActivity$ManageSitesAsync.getSiteList(ManageSitesActivity.java:172)
08-07 13:20:00.062: W/System.err(15271):    at com.sign.android.alfresco.ManageSitesActivity$ManageSitesAsync.doInBackground(ManageSitesActivity.java:163)
08-07 13:20:00.062: W/System.err(15271):    at com.sign.android.alfresco.ManageSitesActivity$ManageSitesAsync.doInBackground(ManageSitesActivity.java:1)
08-07 13:20:00.070: W/System.err(15271):    at android.os.AsyncTask$2.call(AsyncTask.java:185)
08-07 13:20:00.070: W/System.err(15271):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
08-07 13:20:00.070: W/System.err(15271):    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
08-07 13:20:00.070: W/System.err(15271):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
08-07 13:20:00.070: W/System.err(15271):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
08-07 13:20:00.070: W/System.err(15271):    at java.lang.Thread.run(Thread.java:1019)
08-07 13:20:00.070: D/AndroidRuntime(15271): Shutting down VM
8 REPLIES 8

jm_pascal
Star Contributor
Star Contributor
Hello,

How do you include the SDK inside your project ? with maven or with the binaries from developer.alfresco.com or compilation from source code ?

Thanks in advance.

Hi,

I just copied the jars from the downloaded SDK and put into my project lib and set it into class path. Please see the attached file for more details.

Thank you!

Are you able to create a session object inside your code ?
Does this stackTrace happens only when you request the siteService ?
What's the context when this error happens ?

Could you clean your project and check all your classpath is correct.

FYI I just create a simple project with the binaries and have no compilation error.

Hi Pascal,

The exception comes when I try to get the SiteService from ServiceRegistry. At the below line.

SiteService siteService = serviceRegistry.getSiteService();

Please help

Thank you!

I am still having this issue. I cleaned the project and I tried again. But no change condition. I also put the old libraries that was working fine but now they are also giving the same error 😞

jm_pascal
Star Contributor
Star Contributor
Could you post the code which doesn't work and the context ?
Where did you create the session object ? is it in the same activity as you create it ? in another one ?

Hi jm.pascal,

Every other calls to the alfresco are working fine. It shows error on the following line.

// Error line no 172
<java>SiteService siteService = serviceRegistry.getSiteService();</java>


Exception:
09-16 11:20:20.851: D/dalvikvm(14696): VFY: dead code 0x0005-001b in Lorg/alfresco/mobile/android/api/services/impl/AbstractSiteServiceImpl;.updateExtraPropertyCache (Ljava/lang/String;ZZZ)V
09-16 11:20:20.851: W/System.err(14696): java.lang.NoClassDefFoundError: org.alfresco.mobile.android.api.services.impl.AbstractSiteServiceImpl$1
09-16 11:20:20.867: W/System.err(14696):    at org.alfresco.mobile.android.api.services.impl.AbstractSiteServiceImpl.<init>(AbstractSiteServiceImpl.java:424)
09-16 11:20:20.867: W/System.err(14696):    at org.alfresco.mobile.android.api.services.impl.onpremise.OnPremiseSiteServiceImpl.<init>(OnPremiseSiteServiceImpl.java:83)
09-16 11:20:20.867: W/System.err(14696):    at org.alfresco.mobile.android.api.services.impl.onpremise.OnPremiseServiceRegistry.getSiteService(OnPremiseServiceRegistry.java:60)
09-16 11:20:20.867: W/System.err(14696):    at com.sign.android.alfresco.ManageSitesActivity$ManageSitesAsync.getSiteList(<strong>ManageSitesActivity.java:172</strong>)
09-16 11:20:20.867: W/System.err(14696):    at com.sign.android.alfresco.ManageSitesActivity$ManageSitesAsync.doInBackground(ManageSitesActivity.java:162)
09-16 11:20:20.867: W/System.err(14696):    at com.sign.android.alfresco.ManageSitesActivity$ManageSitesAsync.doInBackground(ManageSitesActivity.java:1)
09-16 11:20:20.867: W/System.err(14696):    at android.os.AsyncTask$2.call(AsyncTask.java:185)
09-16 11:20:20.867: W/System.err(14696):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
09-16 11:20:20.867: W/System.err(14696):    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
09-16 11:20:20.867: W/System.err(14696):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
09-16 11:20:20.867: W/System.err(14696):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
09-16 11:20:20.867: W/System.err(14696):    at java.lang.Thread.run(Thread.java:1019)

f_luis01
Champ in-the-making
Champ in-the-making