title: Groovy LDAP search request
body: <p>I'm trying to implement Groovy LDAP (<a href="http://directory.apache.org/api/groovy-ldap.html" rel="nofollow">http://directory.apache.org/api/groovy-ldap.html</a>) in our Grails Application.</p>
  
  <p>My Code is</p>
  
  <pre><code>    def ldap = new LDAP('ldap://server:389/dc=organization,dc=com', 'cn=Administrator,cn=users,dc=organization,dc=com', 'password')
  
      def results = ldap.search('(objectClass=*)', 'dc=organization,dc=com', SearchScope.ONE )
      println " ${results.size} entries found ".center(40,'-')
      for (entry in results) {
          println entry.dn
      }
  </code></pre>
  
  <p>And as a result I always get the following exception:</p>
  
  <pre><code>ERROR errors.GrailsExceptionResolver  - NameNotFoundException occurred when processing request: [GET] /app/directory/index
  [LDAP: error code 32 - 0000208D: NameErr: DSID-03100213, problem 2001 (NO_OBJECT), data 0, best match of:
  'DC=organization,DC=com'
  ]. 
  </code></pre>
  
  <p>the same happens if I use the read operation from the documentation</p>
  
  <pre><code>ldap.read('cn=Administrator,cn=users,dc=organization,dc=com'')
  </code></pre>
  
  <p>How can I solve this issue?</p>