Announcement Announcement Module
Collapse
No announcement yet.
Paged search results - Invalid cookie Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Paged search results - Invalid cookie

    Hi,

    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??

    Thanks

  • #2
    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)?

    Comment


    • #3
      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..

      Comment


      • #4
        Mattias, would it be possible to get some functioning sample code on how to properly use the paging functionality?

        Comment


        • #5
          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.

          Comment


          • #6
            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.

            Scott

            Comment


            • #7
              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.

              Comment


              • #8
                Just did some random searching on 'paged result invalid cookie' and came up with the following:
                http://www.openldap.org/lists/openld.../msg00100.html

                Doesn't this look a little bit like the problems you're having?

                Comment

                Working...
                X