AnsweredAssumed Answered

Openfire and Smack: MXParser error with large PubSub nodes and data

Question asked by jpro on May 4, 2016

Hi, I am testing Openfire and Smack with large Pubsub nodes.

I have about 10,000 pubsub nodes in openfire server, and publishing message (some of messages are large messages, such as base64-encoded jpeg message like 100KB) with high speed to all nodes.

When we subscribe all nodes and get message from nodes, we got error message like.

 

java.lang.StringIndexOutOfBoundsException: String index out of range: -39

  at java.lang.String.<init>(String.java:196)

  at org.xmlpull.mxp1.MXParser.getText(MXParser.java:794)

  at org.jivesoftware.smack.util.PacketParserUtils.parseContentDepthWithRoundtrip(Pa cketParserUtils.java:501)

  at org.jivesoftware.smack.util.PacketParserUtils.parseContentDepth(PacketParserUti ls.java:430)

  at org.jivesoftware.smack.util.PacketParserUtils.parseContentDepth(PacketParserUti ls.java:402)

  at org.jivesoftware.smack.AbstractXMPPConnection.parseAndProcessStanza(AbstractXMP PConnection.java:958)

  at org.jivesoftware.smack.tcp.XMPPTCPConnection.access$500(XMPPTCPConnection.java: 140)

  at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPC onnection.java:997)

  at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$300(XMPPTCPCon nection.java:952)

  at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnecti on.java:967)

  at java.lang.Thread.run(Thread.java:745)

 

I read MXParser source code, and it seems that MXParser cannot parse well start tag "<" and end tag ">".

I also investigate received message by printing out message buffer which MXParser parses.

It seems that several received messages are sometimes mixing - within single <event> message, another message is getting in.

 

I'm very happy if anyone can give me any hints to solve this error..

Thank you.

Outcomes