xml解析错误:UTFDataFormatException: invalid byte 2 of 2
程序员文章站
2022-05-27 11:43:23
...
xml等配置文件行首的编码(?xml version=1.0 encoding=gb2312?)不能去除,会导致xml解析错误. Caused by: java.io.UTFDataFormatException: invalid byte 2 of 2-byte UTF-8 sequence (0xfd) at org.apache.xerces.impl.io.UTF8Reader.invalidByte(UTF8Reader.
xml等配置文件行首的编码()不能去除,会导致xml解析错误.Caused by: java.io.UTFDataFormatException: invalid byte 2 of 2-byte UTF-8 sequence (0xfd)
at org.apache.xerces.impl.io.UTF8Reader.invalidByte(UTF8Reader.java:678)
at org.apache.xerces.impl.io.UTF8Reader.read(UTF8Reader.java:355)
at org.apache.xerces.impl.XMLEntityManager$EntityScanner.load(XMLEntityManager.java:3186)
at org.apache.xerces.impl.XMLEntityManager$EntityScanner.scanData(XMLEntityManager.java:2625)
at org.apache.xerces.impl.XMLScanner.scanComment(XMLScanner.java:657)
启动脚本加上-Xbootclasspath即可使用循环获取jar:
for jar in ${WORK_HOME}/lib/*.jar; do
LIBPATH="$LIBPATH:$jar"
done
CLASS_PATH=${WORK_HOME}/config:$LIBPATH
nohup java -Dtarget=$PNAME -Duser.home=$USER_HOME
-Xbootclasspath/p:${LIB}/xercesImpl.jar:${LIB}/xercesSamples.jar
:${LIB}/xmlParserAPIs.jar -cp ${CLASS_PATH} XXXMain >> ${WORK_HOME}/log/main.log`date +%m%d` 2>&1 &
推荐阅读
-
php解析xml提示Invalid byte 1 of 1-byte UTF-8 sequence错误的处理方法
-
php解析xml提示Invalid byte 1 of 1-byte UTF-8 sequence错误的处理方法_php技巧
-
php解析xml提示Invalid byte 1 of 1-byte UTF-8 sequence错误的处理方法_PHP教程
-
xml解析错误:UTFDataFormatException: invalid byte 2 of 2
-
php解析xml提示Invalid byte 1 of 1-byte UTF-8 sequence错误的处理方法_php技巧
-
php解析xml提示Invalid byte 1 of 1-byte UTF-8 sequence错误的处理方法
-
xml解析错误:UTFDataFormatException: invalid byte 2 of 2
-
php解析xml提示Invalid byte 1 of 1-byte UTF-8 sequence错误的处理方法
-
php解析xml提示Invalid byte 1 of 1-byte UTF-8 sequence错误的处理方法_PHP教程
-
php解析xml提示Invalid byte 1 of 1-byte UTF-8 sequence错误的处理方法