I am using the latest *smack-experimental:4.2.0-beta3-SNAPSHOT *
and my server (prosody 0.10, implementing the MAM module (Originally mam:0 namespace)), I edited it to fit in the new mam:1 namespace and some other tweaks…
And I of course also stripped the archive message to only the body (so I’m not sure if that has anything to the with the error).
Please [disregard the acknowledgement packet] - not marked in bold.
Here is my Code:
try {
MamManager.MamQueryResult mamQueryResult = mamManager.queryArchive(2);
} catch (XMPPException.XMPPErrorException e) {
e.printStackTrace();
} catch (SmackException.NotLoggedInException e) {
e.printStackTrace();
} catch (SmackException.NotConnectedException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
} catch (SmackException.NoResponseException e) {
e.printStackTrace();
}
SMACK sent this (to the server) [relevant info in bold]:
D/SMACK: SENT (0):
*** ***
*** ***
*** 2***
*** ***
*** ***
SMACK received this (from the server):
D/SMACK: RECV (0):
** **
** **
** fdsdf**
** **
** **
*** ***
*** ***
*** stop***
*** ***
*** ***
*** ***
*** ***
*** 702878b8-2d93-4a51-adaa-2a49f20eb544***
*** 9.8813129168249e-324***
*** 40f9cb2d-3bb2-493a-b89b-bb258f7deb38***
*** ***
*** ***
And then the error comes after (which force-closed my APP)
E/AndroidRuntime: FATAL EXCEPTION:main
-
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.queryArchive(MamManager.java:109)*
Looking at the error, I am having a feeling the first packet received has something to do with it… so I went with the latest 0.5 revision which replaced the parent element with instead of :http://xmpp.org/extensions/diff/api/xep/0313/diff/0.3/vs/0.5#query-limit
So instead of the result arriving first, it arrives last after all the messages have been completed:
SMACK Received (from server):
D/SMACK: RECV (0):
*** ***
*** ***
*** fdsdf***
*** ***
*** ***
*** ***
*** ***
*** stop***
*** ***
*** ***
*** ***
*** ***
*** 702878b8-2d93-4a51-adaa-2a49f20eb544***
*** 9.8813129168249e-324***
*** 40f9cb2d-3bb2-493a-b89b-bb258f7deb38***
*** ***
*** ***
But Connection closed immediately after the message (with Invalid Int at the count):
AbstractXMPPConnection: Connection XMPPTCPConnection[admin@myServer.com/LG-D855@g3_global_com@LGE] (0) closed with error
java.lang.NumberFormatException: **Invalid int: "9.8813129168249e-324"**
at java.lang.Integer.invalidInt(Integer.java:138)
at java.lang.Integer.parse(Integer.java:410)
at java.lang.Integer.parseInt(Integer.java:367)
at java.lang.Integer.parseInt(Integer.java:334)
at java.lang.Integer.valueOf(Integer.java:525)
at org.jivesoftware.smack.util.ParserUtils.getIntegerFromNextText(ParserUtils.java :153)
at org.jivesoftware.smackx.rsm.provider.RSMSetProvider.parse(RSMSetProvider.java:5 6)
at org.jivesoftware.smackx.rsm.provider.RSMSetProvider.parse(RSMSetProvider.java:2 7)
at org.jivesoftware.smack.provider.Provider.parse(Provider.java:31)
at org.jivesoftware.smackx.mam.provider.MamFinIQProvider.parse(MamFinIQProvider.ja va:48)
at org.jivesoftware.smackx.mam.provider.MamFinIQProvider.parse(MamFinIQProvider.ja va:34)
at org.jivesoftware.smack.provider.Provider.parse(Provider.java:31)
at org.jivesoftware.smack.util.PacketParserUtils.parseIQ(PacketParserUtils.java:63 1)
at org.jivesoftware.smack.util.PacketParserUtils.parseStanza(PacketParserUtils.jav a:151)
at org.jivesoftware.smack.AbstractXMPPConnection.parseAndProcessStanza(AbstractXMP PConnection.java:981)
at org.jivesoftware.smack.tcp.XMPPTCPConnection.access$500(XMPPTCPConnection.java: 146)
at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPC onnection.java:1005)
at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$300(XMPPTCPCon nection.java:960)
at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnecti on.java:975)
at java.lang.Thread.run(Thread.java:818)
Is this because of the “index=’?’” missing at the element or something else? Please Help…Thank you.