I'm trying various ways to integrate acegi security with spring-ws.
I've managed to use plain text and hashed password with memory and dao.
Now I'm trying to work on Ldap. Since LdapAuthenticationProvider is a provider (rather than a userDetailsService) I'm only trying to get it work with plain text passwords.
I declare ldapAuthProvider in my applicationContext.xml as follows:
which has 2 constructor arguments, and the constuctor from the java looks like this:Code:<bean id="ldapAuthProvider" class="org.acegisecurity.providers.ldap.LdapAuthenticationProvider" > <constructor-arg index="0"> <bean class="org.acegisecurity.providers.ldap.authenticator.BindAuthenticator"> <constructor-arg><ref local="initialDirContextFactory" /> </constructor-arg> <property name="userSearch" ref="userSearch" /> </bean> </constructor-arg> <constructor-arg index="1"> <bean class="org.acegisecurity.providers.ldap.populator.DefaultLdapAuthoritiesPopulator"> <constructor-arg> <ref local="initialDirContextFactory" /> </constructor-arg> <constructor-arg> <value>CN=Groups,DC=utdtest,DC=com</value> </constructor-arg> <property name="groupRoleAttribute"> <value>cn</value></property> </bean> </constructor-arg> </bean>
So it seems that bean instantiation should work, however I get the error:Code:public LdapAuthenticationProvider(LdapAuthenticator authenticator, LdapAuthoritiesPopulator authoritiesPopulator) { this.setAuthenticator(authenticator); this.setAuthoritiesPopulator(authoritiesPopulator); }
...
Caused by:
org.springframework.beans.BeanInstantiationExcepti on: Could not instantiate bean class [org.acegisecurity.providers.ldap.LdapAuthenticatio nProvider]: No default constructor found; nested exception is java.lang.NoSuchMethodException: org.acegisecurity.providers.ldap.LdapAuthenticatio nProvider.<init>()
Caused by:
java.lang.NoSuchMethodException: org.acegisecurity.providers.ldap.LdapAuthenticatio nProvider.<init>()
at java.lang.Class.getConstructor0(Class.java:2647)
at java.lang.Class.getDeclaredConstructor(Class.java: 1953)
at org.springframework.beans.BeanUtils.instantiateCla ss(BeanUtils.java:148)
...
any idea why? I'm not sure if this is an acegi issue, spring-ws, or something I'm doing wrong - any advice?
I'm posting this to both the acegi and spring-ws forums.
Thanks for any help.


Reply With Quote