Я использую Spring 3.1, и я делаю LDAP в первый раз.Spring Security 3.1 и Right Jars
Вот мой * -security.xml:
<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.0.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="/welcome*" access="ROLE_USER" />
<form-login login-page="/login" default-target-url="/welcome"
authentication-failure-url="/loginfailed" />
<logout logout-success-url="/logout" />
</http>
<ldap-server url = "ldap://ldap-east.abc.acme.org:636/o=acme.org" />
<authentication-manager>
<ldap-authentication-provider user-dn-pattern="uid={0},ou=people"/>
</authentication-manager>
</beans:beans>
Я начал с этим банки, связанные с безопасностью в моем Lib:
spring-security-ldap-3.1.0.RELEASE.jar
spring-security-config-3.1.0.RELEASE.jar
spring-security-core-3.1.0.RELEASE.jar
spring-security-taglibs-3.1.0.RELEASE.jar
spring-security-web-3.1.0.RELEASE.jar
И я получил сообщение об ошибке:
org.springframework.context.ApplicationContextException: Не удалось найти: org.springframework.ldap.core.support.BaseLdapPathCo ntextSource.
Если вы используете LDAP с Spring Security, , пожалуйста, убедитесь, что вы включили файл приложения spring-ldap в приложение; вложенной исключение составляет java.lang.ClassNotFoundException: org.springframework.ldap.core.support.BaseLdapPathContextSource
Итак, я добавил еще банки, чтобы импровизировать быть этот набор файлов безопасности:
spring-ldap-core-1.3.1.RELEASE.jar
spring-ldap-core-tiger-1.3.1.RELEASE.jar
spring-security-ldap-3.1.0.RELEASE.jar
spring-security-config-3.1.0.RELEASE.jar
spring-security-core-3.1.0.RELEASE.jar
spring-security-taglibs-3.1.0.RELEASE.jar
spring-security-web-3.1.0.RELEASE.jar
это заставило меня глубже даже больше сообщений об ошибках:
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'org.springframework.security.filterChains':
Cannot resolve reference to bean 'org.springframework.security.web.DefaultSecurityFilterChain#0'
while setting bean property 'sourceList' with key [0];
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'org.springframework.security.web.DefaultSecurityFilterChain#0':
Cannot resolve reference to bean 'org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#0'
while setting constructor argument with key [2];
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#0':
Cannot resolve reference to bean 'org.springframework.security.authentication.ProviderManager#0' w
hile setting bean property 'authenticationManager';
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'org.springframework.security.authentication.ProviderManager#0':
Cannot resolve reference to bean 'org.springframework.security.config.authentication.AuthenticationManagerFactoryBean#0'
while setting constructor argument; nested exception is
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'org.springframework.security.config.authentication.AuthenticationManagerFactoryBean#0':
FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'org.springframework.security.authenticationManager':
Cannot resolve reference to bean 'org.springframework.security.ldap.authentication.LdapAuthenticationProvider#0'
while setting constructor argument with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'org.springframework.security.ldap.authentication.LdapAuthenticationProvider#0':
Cannot create inner bean '(inner bean)' of type [org.springframework.security.ldap.authentication.BindAuthenticator]
while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name '(inner bean)#17': Cannot resolve reference to bean 'org.springframework.security.securityContextSource'
while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'org.springframework.security.securityContextSource':
Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException:
Could not instantiate bean class [org.springframework.security.ldap.DefaultSpringSecurityContextSource]:
Constructor threw exception; nested exception is java.lang.NoClassDefFoundE
Я ловила на много вещей, обучение Maven не в моем списке, но я не Там еще нет. Любые советы по получению правильных микшерных баннеров для базовой аутентификации LDAP с помощью Spring 3.1?
Я попытался загрузить всю весну 3.1.1 dist, весь Spring LDAP 1.3.1 dist и весь Spring Security 3.1.0 dist. У меня есть все. Поэтому я не понимаю, как это проблема с зависимостью, FWIW.
org.springframework.ldap.core.support.BaseLdapPathContextSource находится внутри пружинной безопасности Ldap баночки. Возможно, это не проблема с jar, а classpath.Просмотрите свой путь к классам – jddsantaella
jddsantaella, как бы это была проблема с classpath? Все упомянутые баночки были в моем каталоге war/WEB-INF/lib. Благодарю. – Steve
Я попытался загрузить весь Spring 3.1.1 dist, весь Spring LDAP 1.3.1 dist и весь Spring Security 3.1.0 в мою войну/WEB-INF/lib. У меня есть все. Поэтому я не понимаю, как это проблема с зависимостью, FWIW. – Steve