我正在尝试使用Spring 2.5版本开发Spring安全应用程序。在安全配置文件中出现错误。
这是我的身份验证管理器声明:
<authentication-manager alias="authenticationManager">
<authentication-provider >
<user-service>
<user name="user" password="user" authorities="ROLE_USER" />
</user-service>
</authentication-provider>
</authentication-manager>
我遇到以下错误: org.xml.sax.SAXParseException:cvc-complex-type.2.1:元素'authentication-manager'必须没有字符或元素信息项[children],因为类型的内容类型为空..
这是我的security.xml文件:
<?xml version="1.0" encoding="windows-1252" ?>
<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-2.5.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-2.0.xsd">
<http auto-config="true">
<intercept-url pattern="/index*" access="ROLE_USER" />
</http>
<authentication-manager alias="authenticationManager">
<authentication-provider >
<user-service>
<user name="user" password="user" authorities="ROLE_USER" />
</user-service>
</authentication-provider>
</authentication-manager>
</beans:beans>