Le 17/03/15 05:43, Kiran Ayyagari a écrit :
> On Tue, Mar 17, 2015 at 2:03 AM, David Cheney <[email protected]>
> wrote:
>
>> Hi,
>>
>> I've been trying to set up master/slave replication with the latest release
>> of Directory Server.
>> I'm using Directory Studio to configure replication by adding a consumer on
>> the slave using the admin credentials for the master.
>>
>> From the logs it appears that the slave is contacting the master and
>> attempting to replicate, but the master throws a null pointer exception
>> while attempting to produce a result set:
>>
>> I have just tested it using the latest trunk(-M20) and didn't see this
> can you provide us with bit more information,
>
> is this happening during first time after configuring replication? or
> during the subsequent restart?
> what search filter are you using in the replication configuration?
I'm afraid, considering the error, that the problem is not with the
replication, but with the database being broken :
private void readResults( LdapSession session, SearchRequest req,
LdapResult ldapResult,
Cursor<Entry> cursor, long sizeLimit, ReplicaEventLog replicaLog
) throws Exception
{
long count = 0;
while ( ( count < sizeLimit ) && cursor.next() )
{
...
Entry entry = cursor.get();
sendSearchResultEntry( session, req, entry,
SyncStateTypeEnum.ADD );
...
private void sendSearchResultEntry( LdapSession session,
SearchRequest req, Entry entry,
SyncStateTypeEnum syncStateType ) throws Exception
{
Attribute uuid = entry.get( SchemaConstants.ENTRY_UUID_AT
); // Line 754, where we get a NPE
...
So entry is null there, and entry is directly pull from a cursor, which
is created in :
private SearchResultDone doSimpleSearch( LdapSession session,
SearchRequest req, ReplicaEventLog replicaLog )
throws Exception
{
...
Cursor<Entry> cursor = session.getCoreSession().search( req );
...
// A normal search
// Check that we have a cursor or not.
// No cursor : do a search.
Cursor<Entry> cursor = session.getCoreSession().search( req );
// Position the cursor at the beginning
cursor.beforeFirst();
...
readResults( session, req, ldapResult, cursor, sizeLimit,
replicaLog );