在项目加载的时候出现:Multiple annotations found at this line:

在eclipse中进行项目的maven的springMVC配置,其初我的xml的文件头如图:

结果运行项目的时候并不会报错。其功能一切正常,但是在项目的上老是出现错误提示,于是想解决他,把鼠标放在出现错误的地方提示如下:

Multiple annotations found at this line:
    - cvc-elt.1: Cannot find the declaration of element 'beans'.
    - schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/beans/spring-beans.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>.

出现错误的地方如图所示:

出现错误的原因:

maven pom.xml中依赖的spring的版本和配置不匹配导致的;

解决办法:

然后project-clean-选中项目-clean就OK了

猜你喜欢

转载自blog.csdn.net/weixin_41152613/article/details/82767449
今日推荐