The processing instruction target matching "[xX][mM][lL]" is not allowed.
Exception:org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.apache
這個異常解釋爲:xml文件不能被解析,通常出現這樣的問題在於xml格式上,而且問題多出如今xml文件的頭部。我就是出現了這個問題。昨天還可 以正常運行的,今天來了就運行不了了,很奇怪,查看了下錯誤信息,找到了緣由。這是由於個人xml文件頭部有兩行空行,第三行纔開始寫spa
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd">
的。xml
總結:<?xml version="1.0" encoding="UTF-8"?>前面不要有任何其餘字符,如空格、回車、換行這些不然就會出現上面的異常。blog