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>(

  at org.xmlpull.mxp1.MXParser.getText(

  at org.jivesoftware.smack.util.PacketParserUtils.parseContentDepthWithRoundtrip(Pa

  at org.jivesoftware.smack.util.PacketParserUtils.parseContentDepth(PacketParserUti

  at org.jivesoftware.smack.util.PacketParserUtils.parseContentDepth(PacketParserUti

  at org.jivesoftware.smack.AbstractXMPPConnection.parseAndProcessStanza(AbstractXMP

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

  at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPC

  at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$300(XMPPTCPCon

  at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$



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.