Saturday, May 16, 2009

Stax parser's hard to solve problem

I ran into some sort of serious issues with stax parser(woodstox implementation) in the recent time. You might have also encounter the problem with woodstox.

WstxEOFException: unexpected EOF prolog row[0,1]...

According to the document, this would happen when the TCP connection is broken when the stream is being read. because of this, the XML read was not successful. But this was not in my case. My connection to http server never end. then what's the problem? what went wrong?

It took more than five hours to resolve. When the stream is received from the http connection, one of my API reads the header information of the stream and then pass the stream for further parsing, when it uses the same stream (half read by other opeartion) for parsing the rest of the response, it failed. when i reset the stream, it went very well.

So please be sure that your input stream is reset before you parse every time.

No comments:

Post a Comment