org.xml.sax.SAXParseException: schema_reference.4: 无法读取架构文档 'http://www.springframework.org/schema/beans/spring-beans.xsd'

org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/beans/spring-beans.xsd'

我在尝试执行 spring 批处理时遇到以下错误

2021-10-07T13:10:19,229 [main] WARN  XmlBeanDefinitionReader: Ignored XML validation warning
org.xml.sax.SAXParseException: 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>.
        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203) ~[?:1.8.0_265]

我又试了一次运行,它被执行了,但是我想确保上面的错误不会重复。

这是什么原因造成的?我该如何永久解决这个问题。

网络问题,因为错误将 502 作为根本原因,这是错误的网关。 XSD 文件已添加到 spring 的 jars 中,因此无需上网即可找到它

https://qnatech.wordpress.com/2012/08/21/how-to-resolve-spring-xsd-schema-error-schema_reference-4-failed-to-read-schema-document/