Question

I would like to search with sorted order in pagination. For same I am using VirtualListViewRequestControl. Seem like it is not working I tried all possible way. But still I am getting following error :-

INFO: level="INFO" threadID=37 threadName="Connection reader for connection 8 to 10.96.186.240:389" revision=15579 connectionID=8 connectedTo="10.96.186.240:389" readLDAPResult="SearchResult(resultCode=76 (virtual list view error), messageID=6, diagnosticMessage='00002040: SvcErr: DSID-031401ED, problem 5010 (UNAVAIL_EXTENSION), data 0 ’, entriesReturned=-1, referencesReturned=-1, responseControls={VirtualListViewResponseControl(targetPosition=0, contentCount=0, resultCode=60 (sort control missing))})"

Even before adding VirtualListViewRequestControl in search request I am specifically checking that is my Directory supporting virturalListViewControl or not with help RootDSE, the result is yes. Same example I tried with jndi which is working fine. In documentation unboundid say that They support it but seem like it is not working.

Here is some sample code

SearchRequest searchRequest = new SearchRequest("dc=mydomain,dc=com",
          SearchScope.SUB, Filter.createEqualityFilter("objectClass", "person"));

searchRequest.setControls(
            new ServerSideSortRequestControl(false, new SortKey("sn"),
                 new SortKey("givenName")),
            new VirtualListViewRequestControl(vlvOffset, 0, 9, vlvContentCount,
                 vlvContextID, true));

SearchResult searchResult = connection.search(searchRequest);

Can somebody help me solving this issues. Or please redirect me where I can find solution.

Was it helpful?

Solution

"Note that Active Directory supports only a single sort key."

ie (new ServerSideSortRequestControl(false, new SortKey("sn"), new SortKey("givenName")),

Can only have one SortKey. -jim

OTHER TIPS

The UnboundID LDAP SDK's support for the virtual list view control definitely works with other directory servers, so it's likely the case that something is unusual about the way that Active Directory (which I assume is the server you're using from the formatting of the error response) handles it.

The "sort control missing" part of the error response is odd because you're clearly providing the appropriate control in the request. Perhaps Active Directory doesn't like that the VLV request control is critical but the server-side sort request control is not. Have you tried changing the first argument of the ServerSideSortRequestControl constructor from false to true so that the sort control is marked critical?

If that doesn't solve the problem but the same request seems to work with JNDI, then it would be useful to see the exact traffic passing between the client and the server for JNDI versus the UnboundID LDAP SDK. You can get that by using the ldap-debugger tool provided with the UnboundID LDAP SDK. This creates a very simple LDAP proxy that you can configure to forward any requests it receives to a specified directory server, and then you point your LDAP client at the ldap-debugger tool instead of the real directory server. Then the ldap-debugger tool will print out detailed information about the exact LDAP request and response traffic that passes through it. If you do this for both requests from JNDI and the UnboundID LDAP SDK, this should help us see what the difference is and determine how to deal with it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top