[
https://issues.apache.org/jira/browse/DIR-293?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Emmanuel Lecharny resolved DIR-293.
-----------------------------------
Resolution: Not A Problem
Assignee: Emmanuel Lecharny (was: Alex Karasulu)
First, as you don(t check the response when you do an add, you don't see that
the entry you try to inject is incorrect :
MessageType : ADD_RESPONSE
Message ID : 2
Add Response
Ldap Result
Result code : (OBJECT_CLASS_VIOLATION) objectClassViolation
Matched Dn : ''
Diagnostic message : 'OBJECT_CLASS_VIOLATION: failed for
MessageType : ADD_REQUEST
Message ID : 2
Add Request :
Entry
dn[n]: cn=userLogin,ou=system
objectClass: person
objectClass: top
cn: userLogin
: ERR_279 Required attributes [sn(2.5.4.4)] not found within entry
cn=userLogin,ou=system'
Your entry is missing the sn attributeType.
Then, you still try to iterate on the cursor, but it has no entry in it, so you
get the CURSOR error.
That's plain normal.
Also you should iterate like this :
Iterator<Entry> iterator = cr.iterator();
while ( iterator.hasNext() )
{
Entry r = iterator.next();
assertEquals( "User finded search " + i, "cn=" + userCN + "," +
ROOT_FOR_USERS, r.getDn().getNormName() );
}
or even better :
while ( cr.next() )
{
Entry r = cursor.get();
...
}
> ERR_02002_FAILURE_ON_UNDERLYING_CURSOR when searching a just added entry
> ------------------------------------------------------------------------
>
> Key: DIR-293
> URL: https://issues.apache.org/jira/browse/DIR-293
> Project: Directory
> Issue Type: Bug
> Reporter: Florent ANDRE
> Assignee: Emmanuel Lecharny
> Attachments: DIR-293_unit-test.patch
>
>
> Hi Directory !
> When adding an entry and search for it just after, I get
> ERR_02002_FAILURE_ON_UNDERLYING_CURSOR Failure on underlying Cursor
> In my code I sometimes got it on the first search, and sometimes on the
> second or third.
> In the attached unit test, seems to be always on the first.
> Do I do something wrong here ?
> ++
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira