cancel
Showing results for 
Search instead for 
Did you mean: 

org.xml.sax.SAXParseException: Illegal character at end of document, <

Former Member
0 Kudos

<SOAP-ENV:Body>

<main>

<child>

<string>jfgkjfkjgkNEHA_MITT0497 0000041001000000050 </string>

<string>jhjhjkkjjkNEHA_MITT0498 0000041001000000050 </string>

<string>jhjhjkkjjkNEHA_MITT0498 0000041001000000050 </string>

<string>jhjhjkkjjkNEHA_MITT0498 0000041001000000050 </string>

</child>

</main>

</SOAP-ENV:Body>

Hi,

Am reading the above xml file using the org.w3c.dom.*;

fstNmElmntLst = doc.getElementsByTagName("string");

If I run 668 records at a time it runs fine but above that it throws below error

org.xml.sax.SAXParseException: Illegal character at end of document, &#x3c;.

Can you please help me out for this problem

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

ravindra_bollapalli2
Active Contributor
0 Kudos

hi neha,

check this link along with code for further details

http://www.java2s.com/Code/JavaAPI/org.w3c.dom/DocumentgetElementsByTagNameStringtagname.htm

let me know u need any further calrifications

bvr

Former Member
0 Kudos

It didn't help me out Thanks

ServletInputStream input = request.getInputStream();

DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();

DocumentBuilder db = dbf.newDocumentBuilder();

Document doc = db.parse(input);

doc.getDocumentElement().normalize();

Am using above code to parse xml file

it gives problem If I run more then 1000 records

Document doc = db.parse(input);//this line throws below exception because of stackoverflow

line org.xml.sax.SAXParseException: Illegal character at end of document,

former_member192434
Active Contributor
0 Kudos

Hi Neha,

Make sure that your XML file does not contain any sort of especial Charchater.......try to test that xml file into browser..and see its running properly or not.

Thanks

AB