GeeCON Prague 2014*
The moose likes Servlets and the fly likes org.xml.sax.SAXParseException: Premature end of file. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "org.xml.sax.SAXParseException: Premature end of file. " Watch "org.xml.sax.SAXParseException: Premature end of file. " New topic
Author

org.xml.sax.SAXParseException: Premature end of file.

laxmikant upadhyay
Greenhorn

Joined: Aug 24, 2012
Posts: 14
hi,
i have a servlet which reads the inputstream as xml doc sent from httpclient. when i sent a single request from client it works fine
but when i sent the multiple request using for loop at a time it parse 1st inputstream successfully but throws SAXParseException: Premature end of file for other.

below is snapshot of my httpclient (using juit to test):
Vishal Shaw
Ranch Hand

Joined: Aug 09, 2012
Posts: 179
Hi,

Sorry I am in office so I could not go through your full code. But at a glance, I think the Thread.sleep() method should be moved after line 53, i.e. after the request has been processed by your Servlet.

Vishal.


Programming is about thinking, NOT coding
laxmikant upadhyay
Greenhorn

Joined: Aug 24, 2012
Posts: 14
Vishal Shaw wrote:Hi,

Sorry I am in office so I could not go through your full code. But at a glance, I think the Thread.sleep() method should be moved after line 53, i.e. after the request has been processed by your Servlet.

Vishal.


hi vishal,thanks for your reply.
But removal of Thread.sleep() does not make any difference. the exception is thrown @ line doc = db.parse(in); . i think problem is in client side while sending the multiple inputstream at a time but i am not sure where i am commiting mistake.
Vishal Shaw
Ranch Hand

Joined: Aug 09, 2012
Posts: 179
please check out this link.

Hope this helps
 
GeeCON Prague 2014
 
subject: org.xml.sax.SAXParseException: Premature end of file.