users@glassfish.java.net

LdapNamingEnumeration.hasMoreElements throws null exception during load tes

From: <glassfish_at_javadesktop.org>
Date: Mon, 31 Mar 2008 14:51:27 PST

When I run a load test, I get below exception almost 20% of the times.
I tried both of these function "hasMore" and "hasMoreElements" but no difference. I would appreciate you help.

java.lang.NullPointerException
        at com.sun.jndi.ldap.LdapCtx.getSearchReply(LdapCtx.java:1882)
        at com.sun.jndi.ldap.LdapNamingEnumeration.getNextBatch(LdapNamingEnumeration.java:111)
        at com.sun.jndi.ldap.LdapNamingEnumeration.hasMoreImpl(LdapNamingEnumeration.java:198)
        at com.sun.jndi.ldap.LdapNamingEnumeration.hasMore(LdapNamingEnumeration.java:171)
        at com.sun.jndi.ldap.LdapNamingEnumeration.hasMoreElements(LdapNamingEnumeration.java:98)

Here is my source code:
NamingEnumeration ne = ldap.search("", filter, controls);
if(ne == null || !ne.hasMoreElements()) {
                return false;
}
 while (ne.hasMoreElements()) {
                SearchResult searchResult = (SearchResult) ne.nextElement();
}
[Message sent by forum member 'rinku24' (rinku24)]

http://forums.java.net/jive/thread.jspa?messageID=266929