1

I am trying to configure Spring Security in my simple application. Here is my configuration file, security.xml:

<beans:beans xmlns="http://www.springframework.org/schema/security"
    xmlns:b="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:jdbc="http://www.springframework.org/schema/jdbc"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
                        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                        http://www.springframework.org/schema/jdbc
                        http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd
                        http://www.springframework.org/schema/security
                        http://www.springframework.org/schema/security/spring-security-3.0.xsd">
    <http>
        <form-login login-page="/login/" authentication-failure-url="/fail/" />
        <logout logout-success-url="/" />
    </http>

    <authentication-manager>
        <authentication-provider user-service-ref='myUserDetailsService' />
    </authentication-manager>

    <b:bean id="myUserDetailsService" class="my.package.security.MyUserDataService" />
</beans:beans>

I got following errors with deploying:

The prefix "beans" for element "beans:beans" is not bound.

How can I fix this problem?

2 Answers 2

7

You're missing up the beans and b prefixes. You've declared the b prefix, and then used the beans one. You need to pick one and stick with it. For example, replace

xmlns:b="http://www.springframework.org/schema/beans" 

with

xmlns:beans="http://www.springframework.org/schema/beans" 

and then

<b:bean...

with

<beans:bean...
Sign up to request clarification or add additional context in comments.

Comments

0

You're declaring the namespace as b: and using it everywhere except the enclosing beans tag, in which you're using beans:beans instead of b:beans.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.