(1)这个错误是由于xml文件第一行多了一空行。
解决方法: 删除xml文件后的空行。
错误信息:
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 2 in XML document from class path resource [beans.xml] is invalid; nested exception is org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.
(2) 这个错误是由于缺少了对 beans.ml 文件中的元素 beans 的描述信息。
解决方法: 百度(Google)一下,增加关于 beans 的描述信息。
错误信息:
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 2 in XML document from class path resource [ beans.xml ] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'beans'.