1、在使用eclipse构建基于maven的spring工程时,报下面的错误,如下所示:
1 Multiple annotations found at this line: 2 - cvc-elt.1: Cannot find the declaration of element 'beans'. 3 - schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/beans/spring-beans-3.2.xsd', because 1) could not find the 4 document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
具体内容,如下所示:
错误原因,是因为我在maven pom.xml 中依赖的spring的版本和配置不匹配导致的。
此时,将bean.xml里面的schema引用由3.2改成4.0然后clean一下,刷新项目即可;