title: Issue during lookup method of spring ldapTemplate
body: <p>I am using ldapTemplate of Spring. In my ldaputility.java i am doing like this:</p>
  
  <pre><code>public Object findUser(String username) {
  System.out.println("inside find USer with username : "+username);
  Object object=ldapTemplate.lookup("uid=xyz,cn=users,o=companyName", 
  new AttributesMapper&lt;Object&gt;()//GETTING ERROR AT THIS LINE
  {
  
      @Override
      public User mapFromAttributes(Attributes attrs) throws NamingException {
          User user = new User();
      user.setFullName((String)attrs.get("cn").get());
      user.setLastName((String)attrs.get("sn").get());
      user.setPassword((String)attrs.get("password").get());
  
      return user;
      }
      });
      return object;
      }
  </code></pre>
  
  <p>in my ldif i am doing something like this:</p>
  
  <pre><code>dn: o=companyName
  objectclass: domain
  objectclass: top
  
  dn: cn=users,o=companyName
  objectclass: container
  objectclass: top
  cn: users
  
  dn: cn=groups,o=companyName
  objectclass: top
  objectclass: container
  cn: groups
  
  dn: uid=xyz,cn=users,o=companyName
  objectclass: top
  objectclass: person
  objectclass: organizationalPerson
  objectclass: inetOrgPerson
  uid: xyz
  userpassword: xyz123
  sn: xyz
  givenName: xyz
  cn: xyz abc
  </code></pre>
  
  <p>When controle comes on ldapTemplate.lookup() , i am getting following error </p>
  
  <pre><code>    org.springframework.ldap.InvalidNameException: uid=xyz,cn=users,o=companyName: [LDAP: error code 34 - Invalid DN Syntax]; 
  nested exception is javax.naming.InvalidNameException: uid=xyz,cn=users,o=companyName: [LDAP: error code 34 - Invalid DN Syntax]; 
  remaining name 'uid=xyz,cn=users,o=companyName
  </code></pre>
  
  <p>Searched a lot but could not able to resolve this. Someone please help me on this.</p>