`
yeshaoting
  • 浏览: 666918 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

[ERROR]Premature end of file

 
阅读更多

 

[ERROR]Premature end of file

 

原因:

解析xml文档时,文件已经从头读到了尾.

在解析前遍历输出xml文档内容.

 

解决办法:再重建对象.

 

说明:解析前调用InputStream.reset()方法,不报错,但是不能解决此问题.

Repositions this stream to the position at the time the mark method was last called on this input stream. 

 

 

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

at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)

at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)

at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)

at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)

at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)

at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)

at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)

at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)

at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)

at org.dom4j.io.SAXReader.read(SAXReader.java:465)

at org.dom4j.io.SAXReader.read(SAXReader.java:343)

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics