Reputation: 6979
I was trying to integrating Spring security into my existing project. The tools that I am using are:
In spring configuration, I have this:
<beans:beans xmlns="http://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="/messagePost.htm*" access="ROLE_USER"/>
</http>
<authentication-provider>
<user-service>
<user name="user1" password="1111" authorities="ROLE_USER"/>
</user-service>
</authentication-provider>
</beans:beans>
But there is an error on this spring configuration:
May I know how to resolve this issue?
Upvotes: 3
Views: 5650
Reputation: 3666
MaKe these changes
<?xml version="1.0" encoding="UTF-8"?>
<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="/messagePost.htm*" access="ROLE_USER"/>
</http>
<authentication-manager>
<authentication-provider>
<user-service>
<user name="user1" password="1111" authorities="ROLE_USER"/>
</user-service>
</authentication-provider>
</authentication-manager>
</beans:beans>
I have done the following changes
"http://springframework.org/schema/security"
to "http://www.springframework.org/schema/security"
(added www :D)<authentication-provider>
namespace inside a <authentication-manager>
namespace.Upvotes: 8