title: Spring's LdapTemplate search: PartialResultException: Unprocessed Continuation Reference(s); remaining name '/'
body: <p>I add users through LDAP for a certain application, made with spring.</p>
  
  <p>While this works for most of the cases, in some cases, it does not work...</p>
  
  <p>The retrieve the users I use: </p>
  
  <pre><code>public class LdapUserServiceImpl implements ILdapUserService {
  
      @Override
      public List&lt;LdapUserVO&gt; getUserNamesByQuery(String query) {
          return ldapTemplate.search(
              query().countLimit(15)
                      .where("objectClass").is("user")
                      .and("sAMAccountName").isPresent()
                      .and(query()
                              .where("sAMAccountName").like("*" + query + "*")
                              .or("sAMAccountName").is(query)
                              .or("displayName").like("*" + query + "*")
                              .or("displayName").is(query))
              ,
              new AttributesMapper&lt;LdapUserVO&gt;() {
                  public LdapUserVO mapFromAttributes(Attributes attrs) throws NamingException {
                      LdapUserVO ldapUser = new LdapUserVO();
                      Attribute attr = attrs.get(ldapUserSearch);
                      if (attr != null &amp;&amp; attr.get() != null) {
                          ldapUser.setUserName(attr.get().toString());
                      }
                      attr = attrs.get("displayName");
                      if (attr != null &amp;&amp; attr.get() != null) {
                          ldapUser.setDisplayName(attr.get().toString());
                      }
                      return ldapUser;
                  }
              });
      }
  }
  </code></pre>
  
  <p>So this works in most of the cases, but sometimes I get the following error:</p>
  
  <pre><code>unprocessed continuation reference(s); remaining name "/"
  </code></pre>
  
  <p>I've searched a lot about this, and I explicitly set</p>
  
  <pre><code>DefaultSpringSecurityContextSource ctxSrc = new DefaultSpringSecurityContextSource(ldapUrl);
  ctxSrc.setReferral("follow");
  </code></pre>
  
  <p>Some more info:</p>
  
  <ul>
  <li>Search-query "admin_a" works, but "admin_ah" does not</li>
  <li>Spring version is 4.2.5.RELEASE</li>
  <li>Spring ldap-core version is 2.0.2.RELEASE</li>
  </ul>
  
  <p>I think it strange that the remaining name is the root directory... Does someone has any ideas how to fix this, or even where to start looking?</p>
  
  <p>Thanks in advance!</p>