我正在运行2.0.4.RELEASE版本的Spring Boot应用程序。
我正在使用spring xml进行配置。
我的应用通常可以正常运行,但是今天它停止运行,并出现以下错误:
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-04-04 14:51:50.503 ERROR [appName:main::] o.springframework.boot.SpringApplication - Application run failed
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 5 in XML document from file [C:\Users\user\git\app\target\classes\conf\app-security-spring.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 5; columnNumber: 104; cvc-elt.1: Cannot find the declaration of element 'beans'.
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:399)
app-security-spring.xml命名空间配置为
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:sec="http://www.springframework.org/schema/security"
xsi:schemaLocation="http://www.springframework.org/schema/security https://www.springframework.org/security/spring-security.xsd
http://www.springframework.org/schema/beans https://www.springframework.org/beans/spring-beans.xsd">
当尝试调用URL:“ https://www.springframework.org/beans/spring-beans.xsd”时,连接超时为522(尽管现在工作正常)
但是网址“ https://www.springframework.org/schema/beans/spring-beans.xsd”似乎可以正常工作。
所以我们转而使用它。
所以我的问题是: