powered by Jive Software

Receiving java.lang.AbstractMethodError exception when calling Base64.encodeToString

Hey Folks,

Was wondering if I could get a hand here…I receiving the following runtime exception:

java.lang.AbstractMethodError: org.jivesoftware.smack.util.stringencoder.java7.Java7Base64Encoder.encodeToString([B)Ljava/lang/String;

I believe this might be the result of a dependencies ordering issue. I’m trying to instrument an existing Java application to emit notifications. In this environment I get this exception when attempting to register a SASL mechanism. This stated, I took my smack based coded and turned it into a standalone app and had no such issues. The smack related dependencies as defined in the build.gradle files are identical and in the same order. The only difference is that when instrumenting the existing application there are a number of other dependencies. Here’s the build.gradle fragment with the dependencies:

implementation group: ‘org.igniterealtime.smack’, name: ‘smack-java7’, version: ‘4.4.0-beta2’

implementation group: ‘org.igniterealtime.smack’, name: ‘smack-tcp’, version: ‘4.4.2’

implementation group: ‘org.igniterealtime.smack’, name: ‘smack-im’, version: ‘4.4.2’

implementation group: ‘org.igniterealtime.smack’, name: ‘smack-xmlparser’, version: ‘4.4.2’

implementation group: ‘org.igniterealtime.smack’, name: ‘smack-xmlparser-xpp3’, version: ‘4.4.2’

implementation group: ‘xpp3’, name: ‘xpp3’, version: ‘1.1.4c’

runtimeOnly group: ‘org.igniterealtime.smack’, name: ‘smack-xmlparser-stax’, version: ‘4.4.2’

implementation group: ‘org.igniterealtime.smack’, name: ‘smack-resolver-javax’, version: ‘4.4.2’

implementation group: ‘org.igniterealtime.smack’, name: ‘smack-sasl-provided’, version: ‘4.4.2’

implementation group: ‘org.igniterealtime.smack’, name: ‘smack-extensions’, version: ‘4.4.2’

Would greatly appreciate any help, I’ve spent quite a bit of time trying to resolve this issue w/o any luck.

Best regards,

Dave

Any reason why you mix different versions of Smack?

It seems on mvnFor smack-java7, the on mvnrepository.org that the latest build for smack-java7 is 4.4.0-beta2 (there isn’t a 4.4.2 build out there). I tried changing the version to 4.4.2 in my build.gradle file and got a unresolved file error.

I believe that smack-java7 got replaced by smack-java8, although Smack 4.4 Readme and Upgrade Guide · igniterealtime/Smack Wiki · GitHub confusingly refers to both.

I also tried it with the java8 lib, the unresolved file error went away but the AbstractMethodError exception still exists.

Is some kind of code optimization/obfuscation tool like ProGuard invovled in your build process? That smells like a broken code transformation. Java7Base64Encoder is not an abstract class.

You should remove these. XPP is not required on Java SE. And -xmlparser-stax and -resolver-javax are automatically pulled in by smack-java8.

This topic was automatically closed 62 days after the last reply. New replies are no longer allowed.