Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

org.jdom.JDOMException: Error on line -1: Premature end of file.  RSS feed

 
lalitha prasad
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am getting the following Exception while building the XML Document from String.

org.jdom.JDOMException: Error on line -1: Premature end of file.
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:300)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:650)

The code is like this :

try{
SAXBuilder builder=new SAXBuilder();
doc=builder.build(new StringReader(xml_Content.trim()));
}catch(JDOMException e){
e.printStackTrace();
System.out.println("..............error while building the XML--Document "+e.getCause()+"-"+e.getMessage());
}


Here xml_Content is String Object.What might be the reason.

anybody knows please help me,

Thanks in Advance,
LALITH
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like either xml_Content is null or improperly formatted. Have you checked the contents of xml_Content?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!