1.Error on line 2 of document : The processing instruction target matching "[xX][mM][lL]" is not allowed. Nested exception: The processing instruction target matching "[xX][mM][lL]" is not allowed.
产生原因:常见于XML报文解析,产生原因在要解析的XML报文头前面包含“空格”,也就是在“<?xml version="1.0" encoding="utf-8" ?>” 之前存在空格。排查很简单,在eclipse中新建一个XML文件,把你要解析的XML复制到新建的文件,eclipse会自动产生提示。
解决方法:删除空格或者程序trim()过滤。