Multiple annotations found at this line: - cvc-elt.1: Cannot find the declaration of element 'b

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>.

具体内容,如下所示:

Multiple annotations found at this line: - cvc-elt.1: Cannot find the declaration of element 'b

错误原因,是因为我在maven pom.xml 中依赖的spring的版本和配置不匹配导致的。 

Multiple annotations found at this line: - cvc-elt.1: Cannot find the declaration of element 'b

此时,将bean.xml里面的schema引用由3.2改成4.0然后clean一下,刷新项目即可;

Multiple annotations found at this line: - cvc-elt.1: Cannot find the declaration of element 'b

 

上一篇:关于没有过滤target的.class文件产生的BUG


下一篇:当集合元素为空时,for循环体内不会执行!所以get集合元素的属性 , 自然也不会抛 空指针异常;