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

    Ldap Search Problem

    bathirun
      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 ?

      Thanks,
      Bala
        • 1. Re: Ldap Search Problem
          EJP
          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.