Announcement Announcement Module
Collapse
No announcement yet.
NameNotFoundException when I switch from LdapContextSource to PoolingContextSource Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • NameNotFoundException when I switch from LdapContextSource to PoolingContextSource

    My searches start throwing NameNotFoundException when I switch from LdapContextSource to PoolingContextSource, can someone help?

    Exception:
    ServiceInvocationError:org.springframework.ldap.Na meNotFoundException: [LDAP: error code 32 - No Such Object]; nested exception is javax.naming.NameNotFoundException: [LDAP: error code 32 - No Such Object];


    Code:
    result = ldapTemplate.search(base.toString(), andFilter.encode(), SearchControls.OBJECT_SCOPE, new String[] { "cn", "imCountry", "preferredLanguage", "preferredDeliveryMethod", "telephonenumber", "mail","imCompanyID" }, new AttributesMapper()

    Configuration that works:

    <beans:bean id="contextSourceTarget"
    class="org.springframework.ldap.core.support.LdapC ontextSource">
    <beansroperty name="url" value="ldap://spogtamldap-ro:389" />
    <beansroperty name="userDn"
    value="uid=tcserver-ro,ou=applications,dc=ironmountain,dc=com" />
    <beansroperty name="password" value="${TAM.LDAP.password}" />
    <property name="dirObjectFactory" value="org.springframework.ldap.core.support.Defau ltDirObjectFactory" />
    <property name="pooled" value="false" />
    </beans:bean>


    <beans:bean id="tamLdapTemplate" class="org.springframework.ldap.core.LdapTemplate" >
    <beans:constructor-arg ref="contextSourceTarget" />
    </beans:bean>


    Configuration that throws javax.naming.NameNotFoundException

    <beans:bean id="contextSourceTarget"
    class="org.springframework.ldap.core.support.LdapC ontextSource">
    <beansroperty name="url" value="ldap://spogtamldap-ro:389" />
    <beansroperty name="userDn"
    value="uid=tcserver-ro,ou=applications,dc=ironmountain,dc=com" />
    <beansroperty name="password" value="${TAM.LDAP.password}" />
    <property name="dirObjectFactory" value="org.springframework.ldap.core.support.Defau ltDirObjectFactory" />
    <property name="pooled" value="false" />
    </beans:bean>

    <beans:bean id="contextSourcePooled" class="org.springframework.ldap.pool.factory.Pooli ngContextSource">
    <beansroperty name="contextSource" ref="contextSourceTarget" />
    <property name="dirContextValidator" ref="dirContextValidator"/>
    <beansroperty name="maxActive" value="200" />
    <beansroperty name="maxIdle" value="200" />
    <beansroperty name="minIdle" value="10" />
    <property name="testOnBorrow" value="true"/>
    <property name="testWhileIdle" value="true"/>
    </beans:bean>

    <beans:bean id="tamLdapTemplate" class="org.springframework.ldap.core.LdapTemplate" >
    <beans:constructor-arg ref=" contextSourcePooled " />
    </beans:bean>
    <bean id="dirContextValidator" class="org.springframework.ldap.pool.validation.De faultDirContextValidator" />
Working...
X