Thanks so much for the response. Sorry to take so long to get back to this issue, but I had set it aside.

Erh-Yuan Tsai wrote:
Please refer doc of LDAPSearchConstraints for setReferrals,
an LDAPRebind or LDAPBind interface has to be implemented.

I was under the mistaken impression that this was not necessary for anonymous connections. However, everything is now in place


LDAPRebind rebind = new LDAPRebind() {
  public LDAPRebindAuth getRebindAuthentication(String host, int port) {
    return new LDAPRebindAuth("", "");
  }
};
LDAPSearchConstraints cons = anon_conn.getSearchConstraints();
cons.setReferrals(true);
cons.setRebindProc(rebind);
anon_conn.setSearchConstraints(cons);

but I'm still having the same problem. Referrals work great for one or two entries, but the referred to server is responding with an LDAP error code of 4 (Size limit exceeeded) for any filter matching more than 2 entries. This is surely the root cause of the error message I'm getting:

>> java.lang.ArrayStoreException
>>     at java.lang.System.arraycopy(Native Method)
>>     at java.util.Vector.copyInto(Vector.java:162)
>>     at netscape.ldap.LDAPSearchResults.sort(LDAPSearchResults.java:300)
>>
>> when I attempt to sort.

The sizelimit for the server is explicitly set to 1000, and a query returns more than three entries without a hitch when I either use something besides the Mozilla LDAP SDK to follow the referrals or query the referred to server directly.

Is there any chance the referral connection is setting this limit? Can I fix it somehow?

More information on my setup is at:

http://www.openldap.org/lists/openldap-software/200307/msg00203.html

Jon Roberts
www.mentata.com




Reply via email to