AnsweredAssumed Answered

smack4.1.4 in Android show "java.lang.NoClassDefFoundError: Failed resolution of: Ljavax/security/sasl/Sasl"

Question asked by cheng on Oct 29, 2015
Latest reply on Oct 30, 2015 by Flow

I use smack4.1.4 ,but have a problem,Sasl is in jdk, i don't know why.

Log is as follows

 

10-20 10:04:48.150 W/art( 7272): Unresolved exception class when finding catch block: javax.security.sasl.SaslException

10-20 10:04:48.150 W/System.err( 7272): java.lang.NoClassDefFoundError: Failed resolution of: Ljavax/security/sasl/Sasl;

10-20 10:04:48.150 W/System.err( 7272):     at org.jivesoftware.smack.sasl.javax.SASLJavaXMechanism.authenticateInternal(Unkno wn Source)

10-20 10:04:48.150 W/System.err( 7272):     at org.jivesoftware.smack.sasl.SASLMechanism.authenticate(Unknown Source)

10-20 10:04:48.150 W/System.err( 7272):     at org.jivesoftware.smack.SASLAuthentication.authenticate(Unknown Source)

10-20 10:04:48.150 W/System.err( 7272):     at org.jivesoftware.smack.tcp.XMPPTCPConnection.loginNonAnonymously(Unknown Source)

10-20 10:04:48.150 W/System.err( 7272):     at org.jivesoftware.smack.AbstractXMPPConnection.login(Unknown Source)

10-20 10:04:48.150 W/System.err( 7272):     at com.senyint.android.app.im.service.o.e(Unknown Source)

10-20 10:04:48.150 W/System.err( 7272):     at com.senyint.android.app.im.service.o$a.run(Unknown Source)

10-20 10:04:48.160 W/System.err( 7272): Caused by: java.lang.ClassNotFoundException: Didn't find class "javax.security.sasl.Sasl" on path: DexPathList[[zip file "/data/app/com.senyint.android.app-1/base.apk"],nativeLibraryDirectories=[/data /app/com.senyint.android.app-1/lib/arm, /system/lib, /vendor/lib, system/vendor/lib, system/vendor/lib/egl, system/lib/hw]]

10-20 10:04:48.160 W/System.err( 7272):     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)

10-20 10:04:48.160 W/System.err( 7272):     at java.lang.ClassLoader.loadClass(ClassLoader.java:511)

10-20 10:04:48.160 W/System.err( 7272):     at java.lang.ClassLoader.loadClass(ClassLoader.java:469)

10-20 10:04:48.160 W/System.err( 7272):     ... 7 more

10-20 10:04:48.160 W/System.err( 7272):     Suppressed: java.lang.ClassNotFoundException: javax.security.sasl.Sasl

10-20 10:04:48.160 W/System.err( 7272):  at java.lang.Class.classForName(Native Method)
10-20 10:04:48.160 W/System.err( 7272):  at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
10-20 10:04:48.160 W/System.err( 7272):  at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
10-20 10:04:48.160 W/System.err( 7272):  at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
10-20 10:04:48.160 W/System.err( 7272):  ... 8 more

10-20 10:04:48.160 W/System.err( 7272):     Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

 

Message was edited by: cheng the jar is follow: -libraryjars libs/smack-sasl-javax-4.1.4-SNAPSHOT.jar -libraryjars libs/jxmpp-core-0.4.1.jar -libraryjars libs/smack-experimental-4.1.4-SNAPSHOT.jar -libraryjars libs/smack-tcp-4.1.4-SNAPSHOT.jar -libraryjars libs/smack-im-4.1.4-SNAPSHOT.jar -libraryjars libs/smack-resolver-minidns-4.1.4-SNAPSHOT.jar -libraryjars libs/jxmpp-util-cache-0.4.1.jar -libraryjars libs/smack-resolver-dnsjava-4.1.4-SNAPSHOT.jar -libraryjars libs/smack-extensions-4.1.4-SNAPSHOT.jar -libraryjars libs/smack-android-4.1.4-SNAPSHOT.jar -libraryjars libs/smack-android-extensions-4.1.4-SNAPSHOT.jar -libraryjars libs/smack-sasl-provided-4.1.4-SNAPSHOT.jar -libraryjars libs/minidns-0.1.3.jar -libraryjars libs/smack-core-4.1.4-SNAPSHOT.jar

Outcomes