gpt4 book ai didi

java - 无法读取架构文档 'http://www.springframework.org/schema/beans/spring- beans-4.0.xsd'?

转载 作者:太空宇宙 更新时间:2023-11-04 12:34:34 27 4
gpt4 key购买 nike

3 月 2 日,当我使用 eclipse 在自己的电脑上创建项目时,没有出现任何问题,但是当我将 eclipse 从电脑移动到桌面时,我在 security-config.xml 上收到一条错误消息:

错误消息:

Multiple annotations found at this line:
- cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'security:http'.
- Start tag of element <security:http>
- schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/security/spring-
security.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>.

我的 security-config.xml 文件是:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:security="http://www.springframework.org/schema/security"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security.xsd">

<security:http auto-config="true">
<security:form-login login-page="/app/main" default-target-url="/app/account" />
<security:logout logout-url="/app/logout" logout-success-url="/app/main" />
</security:http>

<security:authentication-manager>
<security:authentication-provider user-service-ref="userServices">
<security:password-encoder hash="md5" />
</security:authentication-provider>
</security:authentication-manager>

<bean id="daoAuthenticationProvider" class="org.springframework.security.authentication.dao.DaoAuthenticationProvider">
<property name="userDetailsService" ref="userServices" />
<property name="hideUserNotFoundExceptions" value="false" />
</bean>

<bean id="authenticationManager" class="org.springframework.security.authentication.ProviderManager">
<constructor-arg>
<ref bean="daoAuthenticationProvider" />
</constructor-arg>
</bean>

</beans>

有关我的笔记本电脑的更多详细信息,它运行良好

最佳答案

查看http://www.springframework.org/schema/security/

您可能只需要添加您正在使用的 Spring Security 的版本号。也许您的笔记本电脑缓存了旧版本,他们从网站上删除了无版本的版本。

这个应该可以工作: http://www.springframework.org/schema/security/spring-security-4.1.xsd

关于java - 无法读取架构文档 'http://www.springframework.org/schema/beans/spring- beans-4.0.xsd'?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37458228/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com