Getting org.springframework.ldap.NameNotFoundException: [LDAP: error code 32 - Parent entry not found in the directory.];
Hi I am using Spring ldap for adding user in ldap.
I have specified the context source of LDAP in application context file....
<bean id="contextSource" class="org.springframework.ldap.core.support.LdapContextSource">
<property name="url" value="ldap://brm-devoid-01.brocade.com:389"/>
<property name="base" value="ou=Users,dc=external,dc=brocade,dc=com"/>
<property name="userDn" value="cn=oracladmin"/>
<property name="password" value="mypassword"/>
</bean>
<bean id="ldapTemplate" class="org.springframework.ldap.core.LdapTemplate" >
<constructor-arg ref="contextSource"/>
</bean>
<bean id="activation" class="com.brocade.webportal.registration.service.ActivationImpl">
<property name="ldapTemplate" ref="ldapTemplate"/>
</bean>
With these specification in place, I am able to read a user from LDAP successfully also I am able to list all the user from LDAP. But when I am trying to add a user using ldapTemplate.bind() then I am getting following exception:
org.springframework.ldap.NameNotFoundException: [LDAP: error code 32 - Parent entry not found in the directory.]; nested exception is javax.naming.NameNotFoundException: [LDAP: error code 32 - Parent entry not found in the directory.]; remaining name 'brusertype=End User,brsupportuser=N,brprofileupdateflag=N,brresetflag=N,brsegment=GUEST,brrelationshiptype=GENERAL,cn=Dinesh Narayanan,sn=Narayanan,givenname=Dinesh,userpassword=password1,uid=testingspringldap2@intrado.com'
at org.springframework.ldap.support.LdapUtils.convertLdapException(LdapUtils.java:174)
at org.springframework.开发者_C百科ldap.core.LdapTemplate.executeWithContext(LdapTemplate.java:810)
at org.springframework.ldap.core.LdapTemplate.executeReadWrite(LdapTemplate.java:802)
at org.springframework.ldap.core.LdapTemplate.bind(LdapTemplate.java:996)
at com.brocade.webportal.registration.service.ActivationImpl.activateUser(ActivationImpl.java:242)
Check out LDAP Error Codes
Looks like 32
means:
Indicates the target object cannot be found. This code is not returned on following operations: * Search operations that find the search base but cannot find any entries that match the search filter. * Bind operations.
精彩评论