Announcement Announcement Module
No announcement yet.
constructor issues for LdapAuthenticationProvider. Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • constructor issues for LdapAuthenticationProvider.

    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:
    <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" />
      	<property name="userSearch" ref="userSearch" /> 
    	<constructor-arg index="1">
    	<bean class="org.acegisecurity.providers.ldap.populator.DefaultLdapAuthoritiesPopulator">
                  <ref local="initialDirContextFactory" />
    	<property name="groupRoleAttribute">
    which has 2 constructor arguments, and the constuctor from the java looks like this:
            public LdapAuthenticationProvider(LdapAuthenticator authenticator,
                  LdapAuthoritiesPopulator authoritiesPopulator) {
    So it seems that bean instantiation should work, however I get the error:
    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(
    at java.lang.Class.getDeclaredConstructor( 1953)
    at org.springframework.beans.BeanUtils.instantiateCla ss(

    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.

  • #2
    sorry for the post

    My problem was I had another bean declared with no arguments (even though I wasn't using it for anything, of course spring was trying to create it).
    Sorry for the post.