org.xml.sax.SAXParseException: Content is not allowed in trailing section.
来源:互联网 发布:怎么把mysql删除干净 编辑:程序博客网 时间:2024/06/03 05:03
<个人总结,仅作参考!>
The exception as following :
[Fatal Error] server.msdk.perf.all.xml:192:1: Content is not allowed in trailing section.
org.xml.sax.SAXParseException: Content is not allowed in trailing section.
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
...
...
当出现这个问题的时候,check 一下要parse的文件,看这个文件是否正确,一般情况下这个文件是有问题的,特别是这个文件如果是通过代码生成的,请查看这个文件的正确性,可能这个文件的最后多了一个空格,或者在文件的结尾处出现不正确的标签。
Addition:
在使用java stream读写文件的时候,如果采用的是每次从inputStream中read 一个有固定大小的byte array时,这时候在
byte[] array = new byte[1024];
BufferedInputStream buffInput = new BufferedInputStream(inputStream);
FileOutputStream fileOS = new FileOutputStream(targetFile);
BufferedOutputStream buffOS = new BufferedOutputStream(fileOS);
int word = 0;
while ((word = buffInput.read(array)) != -1){
buffOS.write(array);
}
这样可能导致在最后一次read到array中不足1024的时候,前一次read的byte同样会出现在byte[]中,所以最好采用
BufferedInputStream buffInput = new BufferedInputStream(inputStream);
FileOutputStream fileOS = new FileOutputStream(targetFile);
BufferedOutputStream buffOS = new BufferedOutputStream(fileOS);
int word = 0;
while ((word = buffInput.read()) != -1){
buffOS.write(word);
}
- org.xml.sax.SAXParseException: Content is not allowed in trailing section.
- org.xml.sax.SAXParseException: Content is not allowed in trailing section
- org.xml.sax.SAXParseException: Content is not allowed in prolog.
- org.xml.sax.SAXParseException: Content is not allowed in prolog
- org.xml.sax.SAXParseException: Content is not allowed in prolog
- org.xml.sax.SAXParseException: Content is not allowed in prolog.
- org.xml.sax.SAXParseException: Content is not allowed in prolog.
- org.xml.sax.SAXParseException: Content is not allowed in prolog.
- sax解析xml运行出现错误org.xml.sax.SAXParseException: Content is not allowed in prolog.
- sax解析xml运行出现错误org.xml.sax.SAXParseException: Content is not allowed in prolog
- sax错误:org.xml.sax.SAXParseException: Content is not allowed in prolog解决
- sax错误:org.xml.sax.SAXParseException: Content is not allowed in prolog 终极解决
- sax错误:org.xml.sax.SAXParseException: Content is not allowed in prolog解决
- sax错误:org.xml.sax.SAXParseException: Content is not allowed in prolog解决
- sax错误:org.xml.sax.SAXParseException: Content is not allowed in prolog
- sax错误:org.xml.sax.SAXParseException: Content is not allowed in prolog解决
- XML :org.xml.sax.SAXParseException: Content is not allowed in prolog
- SAX解析xml:SAXParseException: Content is not allowed in prolog
- Combobox出现System.Data.DataRowView的原因,以及指定ValueMember的时机问题
- Android的源代码结构
- linux opensips配置
- 小白的Ubuntu9.04配置命令宝典
- 用Spring写系统日志(AOP技术)
- org.xml.sax.SAXParseException: Content is not allowed in trailing section.
- Ubuntu7.04使用中遇到的问题及从网上搜集的解决办法(截止2007-11-3日) 收藏
- linux下时间有关的函数和结构体
- Software Testing: Theory on Defect Detection
- ubuntu安装介绍
- linux svn常用命令
- php 常用类总汇
- 大洋蛋...不再想了...倒数356....
- Eclipse快捷键大全(转载)