[英]Failed to read schema document 'http://www.springframework.org/schema/beans/spring-beans-3.2.3.xsd'
[英]Failed to read schema document 'http://www.springframework.org/schema/beans/spring- beans-4.0.xsd'?
當我使用3月2日的eclipse在我自己的電腦上創建我的項目時,我沒有問題,但是當我將eclipse從我的PC移動到桌面時,我在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安全性的版本號。 也許你的筆記本電腦有一個舊版本緩存,他們從他們的網站刪除無版本的。
這個應該工作: http : //www.springframework.org/schema/security/spring-security-4.1.xsd
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.