<Personal summary, for reference only!>
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)
...
...
When this problem occurs, check the parse file to check whether the file is correct. In general, this file is faulty, especially if the file is generated by code, check whether the file is correct. There may be an extra space at the end of the file or an incorrect tag at the end of the file.
Addition:
When using Java stream to read and write files, if you read a byte array with a fixed size from inputstream each time
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 );
}
This may cause less than 1024 of the last read to the array, the previous read bytes will also appear in the byte [], so it is best to use
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 );
}