报错信息:org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/beans/spring-beans-4.0.xsd'
Caused by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'beans'.
报错原因:xsd配置的版本高于本地jar的版本,项目启动的时候,会去spring官网下载xsd文件进行xml语法验证,如果这个时候本地断网或者spring的服务挂了,那项目就启动不起来。
解决方案:
方案1:查看本地导入jar使用的xsd版本,配置相应的版本号,如图
方案2:直接去掉xsd的版本号,这样项目启动的时候会默认加载本地的xsd文件,这样不管哪边断网都不会有影响。