You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by amit nanda <am...@gmail.com> on 2014/12/09 10:38:57 UTC

PagedResultsDirContextProcessor failing

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'


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.


Thanks
Amit

Re: PagedResultsDirContextProcessor failing

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 09/12/14 10:38, amit nanda a écrit :
> 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'
>
>
> 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.

What version of ApacheDS are you using ?

Can you set logs on the server ?



Re: PagedResultsDirContextProcessor failing

Posted by Kiran Ayyagari <ka...@apache.org>.
On Tue, Dec 9, 2014 at 5:38 PM, amit nanda <am...@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