title: Getting org.springframework.ldap.NameNotFoundException: [LDAP: error code 32 - Parent entry not found in the directory.];
body: <p>Hi I am using Spring ldap for adding user in ldap.</p>
  
  <p>I have specified the context source of LDAP in application context file....</p>
  
  <pre><code>&lt;bean id="contextSource" class="org.springframework.ldap.core.support.LdapContextSource"&gt;
  &lt;property name="url" value="ldap://brm-devoid-01.brocade.com:389"/&gt;
  &lt;property name="base" value="ou=Users,dc=external,dc=brocade,dc=com"/&gt;
  &lt;property name="userDn" value="cn=oracladmin"/&gt;
  &lt;property name="password" value="mypassword"/&gt;
  &lt;/bean&gt;
  
  &lt;bean id="ldapTemplate" class="org.springframework.ldap.core.LdapTemplate" &gt;
  &lt;constructor-arg ref="contextSource"/&gt;
  &lt;/bean&gt;
  
  &lt;bean id="activation" class="com.brocade.webportal.registration.service.ActivationImpl"&gt;
  &lt;property name="ldapTemplate" ref="ldapTemplate"/&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>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:</p>
  
  <pre><code>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.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)
  </code></pre>