我正在尝试在启动嵌入式 ldap 服务器的 Tomcat 7 上启动应用程序。
那是我的security-config.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:security="http://www.springframework.org/schema/security"
xmlns:context="http://www.springframework.org/schema/context"
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/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd">
<context:property-placeholder location="file:///${catalina.home}/webapps/test.properties"
ignore-unresolvable="true" />
<!--<security:ldap-server id="ldapBPS" url="${ldap.url}" manager-dn="${ldap.managerDN}" manager-password="${ldap.managerPass}"-->
<!--root="${ldap.root}" />-->
<security:ldap-server id="ldapLocal" ldif="classpath:test-ldap.ldif" root="test" />
<security:authentication-manager>
<security:ldap-authentication-provider
user-search-filter="${ldap.conf.userSearchFilter}"
user-search-base="${ldap.conf.confuserSearchBase}"
group-search-filter="${ldap.conf.groupSearchFilter}"
group-search-base="${ldap.conf.groupSearchBase}"
group-role-attribute="${ldap.conf.groupRoleAttr}"
role-prefix="${ldap.conf.rolePrefix}">
</security:ldap-authentication-provider>
</security:authentication-manager>
</beans>
就 Spring 而言,这里是 Maven 依赖项:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.ldap</groupId>
<artifactId>spring-ldap-core</artifactId>
<version>1.3.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-ldap</artifactId>
<version>${springframework.version}</version>
</dependency>
使用此配置,我在 Tomcat 启动期间收到以下错误:
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 17 in XML document from class path resource [META-INF/spring/mifid/mifid-security.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'security:ldap-server'.
任何想法该错误的根源在哪里?
先感谢您。