Spring security Spring Security中的身份验证管理器错误
我正在尝试用spring 2.5版本开发spring安全应用程序。我在安全配置文件中遇到错误 以下是我的身份验证管理器声明:Spring security Spring Security中的身份验证管理器错误,spring-security,Spring Security,我正在尝试用spring 2.5版本开发spring安全应用程序。我在安全配置文件中遇到错误 以下是我的身份验证管理器声明: <authentication-manager alias="authenticationManager"> <authentication-provider > <user-service> <user name="user" password="user" authorities="ROLE_USER"
<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复杂类型。2.1:元素“authentication manager”必须没有字符或元素信息项[子项],因为该类型的内容类型为空
这是我的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>
您可以发布您的安全xml文件吗?您好,我也发布了安全xml文件。请告诉我您是否有任何解决方案。我不确定这种语法(身份验证提供程序
作为身份验证管理器
)是否适用于您的Spring安全版本。您可以切换到Spring Security 3.1吗?