Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

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

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sounds like either xml_Content is null or improperly formatted. Have you checked the contents of xml_Content?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic