1 Reply Latest reply on May 10, 2012 6:37 AM by EJP

    Ldap Search Problem

      I am querying ldapserver to find some user details.

      I am getting following error:
      javax.naming.directory.InvalidSearchFilterException: Missing 'equals'; remaining name 'cn=abc,cn=groups,dc=oracle,dc=com'

      ldap connection happens but search fails.

      base name i used : cn=abc,cn=groups,dc=oracle,dc=com
      filter i used : (|(&(uniquemember=cn=firstname_lastname,L=ccode,DC=ORACLE,DC=COM)))

      i am using ldapsdk-4.1.jar for java ldap api

      In internet i saw similar code was working fine & failed when they changed the jar file/version.

      Has anyone faced similar problem ? can you guide me - how i can get it resolved ?

        • 1. Re: Ldap Search Problem
          It looks OK but it depends on what firstname_lastname and ccode really are. I would use the API where you supply the search argument separately, in case it needs escaping. If you really only have one condition you don't need the | or the & or the extra parentheses. So the filter becomes just (uniquemember={0}) and you supply the DN you are searching for as the zero ^th^ search argument.

          I've never had a problem with LDAP search filters in Java.