sexta-feira, 27 de fevereiro de 2015

Sizelimit Exceeded OpenLDAP

Veja a versão em português

Hello my friends,

Today I had this problem in my Java project when I tried do a search in OpenLDAP:
2015-02-26 16:44:04,875 ERROR [] Sizelimit Exceeded
LDAPException: Sizelimit Exceeded (4) Sizelimit Exceeded

LDAPException: Matched DN:
at com.novell.ldap.LDAPResponse.getResultException(Unknown Source)
at com.novell.ldap.LDAPResponse.chkResultCode(Unknown Source)
at Source)

It happens because the OpenLDAP had 1500 users... and the default sizelimit in my Java client was 1000.

Changing the parameter sizelimit at slapd.conf in OpenLDAP doesn't solve the problem.

To solve this I used the class com.novell.ldap.LDAPSearchConstraints like this:
LDAPSearchConstraints ldsc = new LDAPSearchConstraints();
ldsc.setMaxResults(0);, searchScope, searchFilter, new String[] {}, false, ldsc);
Setting the MaxResults with 0 (zero) the sizelimit becomes unlimited.

Best Regards,
Adriano Schmidt

Nenhum comentário:

Postar um comentário