您的位置:首页 > 编程语言 > Java开发

spring+maven 报错 Multiple annotations found at this line: 解决办法

2017-02-21 21:22 579 查看
Multiple annotations found at this line:
- schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/beans/
spring-beans-3.1.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root 
element of the document is not <xsd:schema>.

- cvc-elt.1: Cannot find the declaration of element 'beans'.

如上,在使用eclipse构建基于maven的springmvc 工程时,报上面的错误

如下为spring的配置:

  


经百度和搜索,发现原来是因为我在maven pom.xml 中依赖的spring的版本和配置不匹配导致的。

我在pom.xml中使用的是

<spring.version>4.0.9.RELEASE</spring.version> 

使用的是 4.0 版本的,但是上面是3.1版本的

把上面截图中的spring配置改为4.0 ,同时做一次clean操作,问题解决



内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: