Spring security3 “You cannot use a spring-security-2.0.xsd schema”

后端 未结 3 926
-上瘾入骨i
-上瘾入骨i 2021-01-01 17:15

I keep getting...

    org.springframework.beans.factory.parsing.BeanDefinitionParsingException: 
Configuration problem: You cannot use a spring-security-2.0.         


        
相关标签:
3条回答
  • 2021-01-01 17:48

    you can just remove the version 3.1 from the spring-security.xml file

    0 讨论(0)
  • 2021-01-01 18:00

    @Rob Winch is absolutely right, there is example of updated spring-security.xml file:

    <beans:beans xmlns="http://www.springframework.org/schema/security"
        xmlns:beans="http://www.springframework.org/schema/beans" 
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
        http://www.springframework.org/schema/security
        http://www.springframework.org/schema/security/spring-security-3.1.xsd">
    
        <http auto-config="true">
            <intercept-url pattern="/welcome*" access="ROLE_USER" />
        </http>
    
        <authentication-manager>
            <authentication-provider>
                <user-service>
                    <user name="user" password="user" authorities="ROLE_USER" />
                </user-service>
            </authentication-provider>
        </authentication-manager>
    
    </beans:beans>
    

    Hope it helps.

    0 讨论(0)
  • 2021-01-01 18:07

    The schema you are pointing to is spring-security-3.1.xsd, but the pom.xml declares spring-security-config-3.0.1.RELEASE. You should update your version of Spring Security or downgrade the version of the spring security namespace. Note when changing versions ensure that all Spring versions match and all Spring Security versions match (this includes transitive dependencies) otherwise you will get strange errors.

    0 讨论(0)
提交回复
热议问题