Maven项目中,spring配置文件集体报错,时好时坏。随便贴上一处错误:
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-4.2.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>.
尝试过在eclipse上添加约束,也查看约束网址的有效性,统统不管用。
最后仔细检查报错的约束附近错的有何规律,结果这个错误真的让我吐血,纠结了我两天的错误。
存在空格没对齐。
一行存在两个约束,第二个约束换行,保证对其无空格。
错误都没了,这种低级的错误,真的很费解,尤其是之前这个错误被忽略了,不知道为什么这两天就出现了,估计是这两天的完成的项目使用到了这些约束吧。