Multiple annotations found at this line: 解决办法

2,205 阅读1分钟

Multiple annotations found at this line:

  • schema_reference.4: Failed to read schema document 'www.springframework.org/schema/bean… 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操作,问题解决

导入项目后出现Multiple annotations found at this line 的问题(jdk不一致)