directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wu, James C." <James.C...@disney.com>
Subject what cause InvalidCursonPositionException?
Date Thu, 18 Apr 2013 18:42:58 GMT
Hi Guys,

I am trying to query an attribute of a DN in my customerized authenticator that overrides
the SimpleAuthenticator.  The following is the code.

                SearchRequest searchRequest = new SearchRequestImpl();
                Dn dn = new Dn(maxUidDN);
                searchRequest.setBase(dn);
                searchRequest.addAttributes("uidNumber");
                DirectoryService service = getDirectoryService();
                CoreSession session = service.getAdminSession();
                EntryFilteringCursor cursor = session.search(searchRequest);
                cursor.beforeFirst();
                cursor.next();
                Entry entry = cursor.get();

The DN is defined as follows:

                dn: uid=maxUidNumber,dc=example,dc=com
                objectClass: top
                objectClass: account
                objectClass: extensibleObject
                uidNumber: 1000

and maxUidDN is set to "uid=maxUidNumber,dc=example,dc=com"

I keep getting the InvalidCursonPositionException at the last line of the code. I am wondering
why the cursor position can be invalid. Can anyone give me some clue? Thanks.

James

Mime
View raw message