Hi there,

I have an issue in getting the LDAP results sorted when sorting on more than one attribute.

Here is the snippet(below) of the code example. If I sort on just one of the "sn" or "givenName" attribute, the ldap result is sorted. However, if I provide both the attributes in the sort, the LDAP results gives NO result at all.

Would someone know why the LDAP is sorting on just one Active Directory attribute? Thanks in advance.

Thanks for your help.

context = new javax.naming.ldap.InitialLdapContext(env,null);
String[] sortOrder = {"cn", "givenName"};
context.setRequestControls(new javax.naming.ldap.Control[]{
new javax.naming.ldap.SortControl(sortOrder, javax.naming.ldap.Control.CRITICAL)