Jon,
Which version were you using? Check LDAPConnection.java, looking for SDKVersion.
If you downloaded tar/zip file from web page, likely you got an old version 4.1f.
Get the latest one from cvs, version 4.17f, there are some minor fix in getCount.
Please file a bug if you experience problems with latest JDK.


Thanks,
-ey

Jon Roberts wrote:

I have finally traced my problem (see below), and found a new issue in the process. The original bug was all me: (I'd forgotten) I was doing an initial check to determing the cardinality of entries that match a search (0, 1, or more). In that preliminary search, I used a limit of 2, so I was only getting two entries. No exception is thrown, so there is no way to tell that I exceeded this sizelimit unless I cycle through the results. However, before that my code does cheerfully try to sort a results set of many with only two actual entries, and with referrals involved this error is the result. Even though this doesn't happen with direct queries, I accept it's unquestionably my own stupid fault.

The new issue came with the fix. If I have a match and try to use LDAPSearchResults.getCount() to find out how many entries, as a referral I only always get "1", even with setBatchSize(0) on the search constraints. Of course, sorting clears this up before a getCount() call, but obviously that isn't an option if a limit is involved. I see code in the getCount() method to handle referrals appropriately, but it doesn't seem to be happening. Since I am assuming server sizelimits can cause the same behavior, this could be a bigger problem. Hopefully, this helps. I'll be happy to submit a bug if advised.

Jon Roberts
www.mentata.com

> Jon Roberts wrote:
>> I am using the Mozilla/Netscape Java Director SDK v4.1. I attempt to
>> set a connection to follow referrals with:
>>
>> LDAPSearchConstraints cons = anon_conn.getSearchConstraints();
>> cons.setReferrals(true);
>> anon_conn.setSearchConstraints(cons);
>>
>> No referral exception (good), but I get:
>>
>> 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. Is there a restriction against sorting
>> referred results? Can I get this working in some other way?







Reply via email to