directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kiran Ayyagari <kayyag...@apache.org>
Subject Re: PagedResultsDirContextProcessor failing
Date Tue, 09 Dec 2014 12:25:53 GMT
On Tue, Dec 9, 2014 at 5:38 PM, amit nanda <amitwip@gmail.com> wrote:

> Hi,
>
> I want to query around 100,000 records from Apache DS, thus i wanted to
> use PagedResultsDirContextProcessor to read in batches, but i am getting
> error on the second page read.
>
> org.springframework.ldap.OperationNotSupportedException: [LDAP: error code
> 53 - Invalid cookie for this PagedSearch request.]; nested exception is
> javax.naming.OperationNotSupportedException: [LDAP: error code 53 - Invalid
> cookie for this PagedSearch request.]; remaining name 'ou=system'
>
> looks like your cookie is missing

>
> Here is the sample code that i am using
>
> Set results = new HashSet();
> PagedResultsDirContextProcessor processor = new
> PagedResultsDirContextProcessor(10);
>
> final SearchControls searchControls = new SearchControls();
> searchControls.setSearchScope(SearchControls.SUBTREE_SCOPE);
> searchControls.setReturningAttributes(new String[]{"*"});
> searchControls.setReturningObjFlag(true);
>
> do {
> ESMAttributesMapper mapper = new ESMAttributesMapper();
> results.addAll(ldapTemplate.search("ou=system", "(objectClass=asoc-es)",
> searchControls, mapper, processor));
> processor = new PagedResultsDirContextProcessor(10, processor.getCookie());
> } while (processor.getCookie().getCookie() != null);
>
> i am using Spring LDAP for this.
>
> AFAIK none of us is familiar with Spring LDAP API, see if you can
reproduce this with
Apache Directory LDAP client API or with JNDI
If possible please attach it as a junit test.

>
> Thanks
> Amit
>



-- 
Kiran Ayyagari
http://keydap.com

Mime
View raw message