• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SAXParseException

 
Mani Raju
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually i am getting exception "org.xml.sax.SAXParseException: Premature end of file" while after reading xml file.
Sorry i too dont know whats the reason for that.
Can any one help to find the solution.
 
Paul Clapham
Sheriff
Posts: 21116
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That means the parser got to the end of the file without seeing the end of the XML document. That would mean the last part of the document is missing.
 
Mani Raju
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:That means the parser got to the end of the file without seeing the end of the XML document. That would mean the last part of the document is missing.


Thanks, but this file successfully read and parsing done in solaris but not in linux.
i mean, i used the same xml and same java code for reading the xml file in both solaris and linux. But i didnt face this error in solaris, i faced only in linux.
Are parsers varied from one java version another java version?
Are parsers depends upon apache version?

 
Mani Raju
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mani Raju wrote:
Paul Clapham wrote:That means the parser got to the end of the file without seeing the end of the XML document. That would mean the last part of the document is missing.


Thanks, but this file successfully read and parsing done in solaris but not in linux.
i mean, i used the same xml and same java code for reading the xml file in both solaris and linux. But i didnt face this error in solaris, i faced only in linux.
Are parsers varied from one java version another java version?
Are parsers depends upon apache version?

Is the process of parsers identifying end of xml file different from one jdk version to another version or one apache version to another version?
 
g tsuji
Ranch Hand
Posts: 666
3
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But i didnt face this error in solaris, i faced only in linux.

That would be symptomatic to bugs... A search on bug reports on "org.xml.sax.SAXParseException: Premature end of file" results in plenty of instances filed. One of them is this.
https://netbeans.org/bugzilla/show_bug.cgi?id=217431

But before jumping to conclusion and as a consequence awaiting an official fix doing nothing in the meantime, make some updates at least or to take notes on the difference being used in the two os platforms.
 
Mani Raju
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, i noted all the differences between linux and solaris.

This same code and xml files working correctly for the remaining modules except one module, because of this exception.

org.xml.sax.SAXParseException: Premature end of file.
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:208).

 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If this was my problem I would use the getColumnNumber() and getLineNumber() methods of SAXParseException to see where the parser thinks it hit end of file.

Bill
 
Mani Raju
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
William Brogden wrote:If this was my problem I would use the getColumnNumber() and getLineNumber() methods of SAXParseException to see where the parser thinks it hit end of file.

Bill

Thanks, i will try in this way. I mean i will use above mentioned methods to find where this exception raised.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic