Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Trouble using VirtualListViewControl

Thread Tools

Trouble using VirtualListViewControl

John Gordon
Posts: n/a
I'm writing a program to query an LDAP server and obtain a list of users.
The list can be quite large, so I need a way to request the results of
the search be returned in small chunks. Luckily, the server I will be
using supports the VirtualListViewControl class, which does just that.
(The server does not support PagedResultsControl.)

However, I cannot get it to work. The following code fragment without
a VirtualListViewControl works correctly:

env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldaps://");
env.put(Context.SECURITY_PRINCIPAL, "cn=Fred Smith");
env.put(Context.SECURITY_CREDENTIALS, "sekrit");
LdapContext ctx = new InitialLdapContext(env, null);
SearchControls ctrl = new SearchControls();
NamingEnumeration<SearchResult> request ="","username=joe",ctrl);

However, if I add a VirtualListViewControl before the call, I
get an error:

Control[] ctxControls = new Control[]
{new VirtualListViewControl(0, 10, 0, 9, Control.CRITICAL)};

The error I get is javax.naming.NamingException: [LDAP: error code 60 - VLV Control]; remaining name ''

I've tried numerous web searches, but there don't seem to be many practical
examples of using a VirtualListViewControl.

Anyone have any advice?

John Gordon "... What with you being his parents and all, Removed) I think that you could be trusted not to shaft
him." -- Robert Chang,

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Trouble using a Printer on a Wireless Home Network =?Utf-8?B?TGVzbGllIFVuZGVyd29vZA==?= Wireless Networking 2 12-26-2007 07:52 AM
i have no trouble to send , ihave trouble reciving mail --any ideas John Penney Computer Support 4 08-29-2006 08:45 PM
Trouble using a hostname in the address field for the Radius client in IAS Ned Cisco 0 08-11-2005 02:59 PM
Trouble using the vbTab in string F. Algr°y ASP .Net 1 01-06-2004 01:39 AM
trouble with caching or caching the trouble Hypo ASP .Net 6 08-01-2003 07:11 AM