I am new to XMPP, using Smack on Android. I started to look into XEP-313 to pull message archives from Open Fire (v4.0.2) to Android client. Was very pleased to see the recent efforts to add this to Smack 4.2 beta, so I switched from v4.1.7 to v4.2 beta (smack-nightly-SNAPSHOT-4.3-2016-08-04), however I am unable to pull message archives from Open Fire (with Monitoring plugin 1.5.4). As you’ll see in verbose details below I was able to get it partially working with code change. My question boils down to which namespace is correct: Smack and XEP-313 (mam:1), or Open Fire (mam:0)?
Using Smack DEBUG flag, I found that Smack’s new MAM Manager code is using xmlns='urn:xmpp:mam:1 e.g.
SENT (0): urn:xmpp:mam:12016-08-07T03:18:00.222+00:00</i q>
but Open Fire seems to be reporting supported feature of e.g.
RECV (0):
As a result the Smack MamManager.isSupportedByServer() is returning false, and an attempt to queryArchive() fails with an error 503 from Open Fire e.g.
urn:xmpp:mam:12016-08-07T03:18:00.222+00:00
For a quick test, I modified my local smack-experimental-4.2.0-beta3-SNAPSHOT.jar to use xmlns=‘urn:xmpp:mam:0’ e.g.
urn:xmpp:mam:02016-08-07T02:33:01.041+00:00</i q>
With this change, I was able to get delayed/forwarded messages sent back from Open Fire to my Smack client, followed by the FIN message. However, minor side issue, during processing of these messages I get these errors as well…
E/xceptionLoggingCallback﹕ Smack message parsing exception. Content: ‘8c1ba7cf-e539-4fcb-b364-c6d346a877d9’
-
java.lang.IllegalArgumentException: Namespace must not be null or empty*
-
at org.jivesoftware.smack.util.StringUtils.requireNotNullOrEmpty(StringUtils.java: 426)*
-
at org.jivesoftware.smack.packet.StandardExtensionElement.<init>(StandardExtension Element.java:69)*
-
at org.jivesoftware.smack.packet.StandardExtensionElement.<init>(StandardExtension Element.java:43)*
-
at org.jivesoftware.smack.packet.StandardExtensionElement$Builder.build(StandardEx tensionElement.java:218)*
-
at org.jivesoftware.smack.parsing.StandardExtensionElementProvider.parse(StandardE xtensionElementProvider.java:96)*
AND
-
java.lang.ClassCastException: org.jivesoftware.smack.packet.EmptyResultIQ cannot be cast to org.jivesoftware.smackx.mam.element.MamFinIQ*
-
at org.jivesoftware.smackx.mam.MamManager.queryArchive(MamManager.java:396)*
-
at org.jivesoftware.smackx.mam.MamManager.queryArchive(MamManager.java:232)*
-
at org.jivesoftware.smackx.mam.MamManager.queryArchiveWithStartDate(MamManage.java :178)*