Announcement Announcement Module
No announcement yet.
PagedResultsRequestControl failing against AD Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • PagedResultsRequestControl failing against AD

    I'm tyring to use the Paged Results functionality against an AD environment and failing to be able to get the cookie after iterating over the first set of returned results.

    It appears after successfully retrieving and iterating over the returned results upto my set paged results size, the last call to results.hasMore() throws a PartialResultsException with a message of "Unprocessesed continuation reference"

    public void search(SearchExecutor se, NameClassPairCallbackHandler handler,
                DirContextProcessor processor) {
            DirContext ctx = contextSource.getReadOnlyContext();
            NamingEnumeration results = null;
            try {
                results = se.executeSearch(ctx);
                while (results.hasMore()) {
                    NameClassPair result = (NameClassPair);
            } catch (NameNotFoundException e) {
    This then causes the code to miss the processor.postProcess(ctx) line and a null cookie value is returned so no further retrieval of paged results can happen.

    So question is is this a bug or is it something to do with the way I have my AD environment configured or the way in which AD works?

    To check the Paged Results functionality was working I changed the call to
    which does not throw execptions; and the code then works as expected setting the cookie value each time. I'm not proposing this as a solution though as it obviously negates all the exception handling

  • #2
    This is definitely a bug. The exception handling should be changed to handle this particular exception, but still perform the postprocess.

    Could you please submit a JIRA issue for this?


    • #3
      Raised with an issue number of LDAP-26.

      In the meantime to continue with my testing I'll move the code to the finally block and wrap it in a try catch statement. However if anyone has a more elegant solution then let me know



      • #4
        Your solution is the best I can get on the net. It blends just fine in our works.