View Full Version : Paged search results - Invalid cookie
Jan 17th, 2007, 07:21 AM
I am trying to search entries from OpenLdap in pages. I am getting following exception irrespective of the page size.
"Unable to communicate with LDAP server; nested exception is javax.naming.CommunicationException: [LDAP: error code 2 - paged results cookie is invalid]; remaining name ''
Also, the above exception occurs after succesfully retrieving 'n' pages where
'n' varies with every execution, also it varies with different page size.
What could be the possible problem??
Jan 17th, 2007, 11:58 AM
I really don't have any good idea about what might be causing this so I'm just guessing here, but might it be that you're looping past the end of the result (i.e. the cookie is null)?
Jan 18th, 2007, 08:42 AM
I checked for the cookie and it is not null..Also the search is incomplete..
for eg. In case of 1000 entries and 100 page size, the invalid cookie exception sometimes thrown after 3rd pass i.e. after searching for 300 entries and sometimes it goes beyond that and throws exception after 5th pass i.e. 500 entries..
Jan 22nd, 2007, 11:47 AM
Mattias, would it be possible to get some functioning sample code on how to properly use the paging functionality?
Jan 22nd, 2007, 11:54 AM
In the integration tests for OpenLDAP we do have some code samples for paged search results. You'll need to download the 'buildable' distribution zip, and the tests you are looking for will be located under spring-ldap/spring-ldap/src/itest-openldap.
Jan 22nd, 2007, 02:37 PM
Thanks. Have you done any testing along the lines that Usavla described? Results requiring hundreds of pages (or at least more than two). Another point to add is that Usavla has written some JNDI test code for paging that works fine (if you haven't guessed it we're working on the same project).
Any help you can give would be great since we're running out of ideas.
Jan 23rd, 2007, 12:52 AM
No, we have not run this against the amount of data you guys are talking about. It is interesting to hear that you have plain JNDI code that seems to be working - it would be interesting to see the code; in order to make an educated guess we'd need to see the code you're using against Spring LDAP as well.
Jan 23rd, 2007, 01:44 AM
Just did some random searching on 'paged result invalid cookie' and came up with the following:
Doesn't this look a little bit like the problems you're having?
Powered by vBulletin® Version 4.2.1 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.