javax.naming.PartialResultException: Unprocessed Continuation Reference(s); remaining name

Hi All,

I am trying to use LDAP search but getting error as below.

javax.naming.PartialResultException: Unprocessed Continuation Reference(s); remaining name ‘dc=internal,dc=,dc=com’

Below is my code simple

LdapContext ctx=new InitialLdapContext(env,null);
SearchControls sc = new SearchControls(scope, countlim, timelim, attrs, retobj, deref);
NamingEnumeration ne = ctx.search(usersContainer, filter,sc);
while (ne.hasMore())
{
SearchResult sr = (SearchResult) ne.next();
//Other business Logic
}

On more debugging i can find that after processing last element from group it’s throwing error while trying to get in while loop.

For my filter criteria I have 6 member in group and in printing it’s printing upto 6 members data and then throwing that exception.

On some threads I can see , its asking to set <ignorePartialResultExcepton = true> but can’t get which methods need to pass the same.

Anyone can help on this.

Thanks
Baharul Islam

Hi All,

We are able to solve the issue by setting “Context.REFERRAL to follow” as suggested in the below link
[url]ldap - How to resolve javax.naming.PartialResultException? - Stack Overflow

But setting Referral value is increasing execution time. If anyone is having any other solutions please help on this.

Thanks
Baharul Islam

Have you tried using the services in pub.client.ldap folder under WmPublic package? especially pub.client.ldap:search?

The hint that you are providing will search in the referral as well and if your AD implementation has lot of records then it is going to take time to search through all those entries.