LDAP Directory exception: Unbalanced parenthesis; remaining name

Lisa Evans November 17, 2013

Here is the error:

org.springframework.ldap.InvalidSearchFilterException: Unbalanced parenthesis; nested exception is javax.naming.directory.InvalidSearchFilterException: Unbalanced parenthesis; remaining name 'DC=xx,DC=xx,DC=xx'

The exception is on the base DN which is DC=xx,DC=xx,DC=xx.

There are no parenthesis in the base DN at all.

The object filter that I have is formatted correctly:

(&(objectClass=user)(userPrincipalName=*)(!sAMAccountName=*-*))

The group filter that I have is formatted correctly:
(&(objectClass=group)(|(cn=xx)(cn=xy)))

There are no other LDAP strings in the settings.

1 answer

1 accepted

3 votes
Answer accepted
Tiago Comasseto
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 18, 2013

Hi Lisa,

The problem is related to the filter: (&(objectClass=user)(userPrincipalName=*)(!sAMAccountName=*-*))

More specifically the exclamation mark ("!") in front of the sAMAccountName attribute.

You may try this other filter:

(&(objectClass=user)(userPrincipalName=*)(!(sAMAccountName=*-*)))

Cheers

Suggest an answer

Log in or Sign up to answer