From: "Michael Maier" <###@###.###>
Date: Fri, 15 Nov 2002 15:48:26 +0100
I think I found a bug concerning DirContext.
I use JNDI to connect to a Sun ONE Directory Server 5.1. My Java Version is
1.4.1 but I also tried it with 1.4.0 and 1.3.2. When I create lots of
DirContexts, sometimes Java just hangs after delivering some results. The
problem occurs only, when using DIGEST-MD5 as authentication type. When I
use simple authentication everything goes well.
I first thought it's a Problem with the server but when I looked at the
packages sent, I realized that the last package always is a result from the
server. I also tried if it becomes better when I close the connection using
ctx.close() but that does not help at all.
Florian
Here is the code I used for testing:
for (int i; i<20; i++)
{
Hashtable env = new Hashtable ();
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL,ldapPath);
env.put(Context.SECURITY_AUTHENTICATION, "DIGEST-MD5");
env.put(Context.SECURITY_PRINCIPAL,"dn:uid=aUser,ou=People,o=anOrganization"
);
env.put(Context.SECURITY_PROTOCOL, "ssl");
System.setProperty("javax.net.ssl.trustStore", "config/trustedCAs");
env.put(Context.SECURITY_CREDENTIALS,password);
try {
DirContext ctx = new InitialDirContext(env); // <---HANGS HERE
Attributes attrs =
ctx.getAttributes("uid=someUser,ou=People,o=anOrganization", attrIDs);
String entryid = (String) attrs.get("entryid").get();
}catch (NamingException e) {
System.err.println("Problem getting attribute:" +e);
}
}
-------------------------------
From: "Michael Maier" <###@###.###>
Date: Fri, 15 Nov 2002 17:22:41 +0100
SSL does not cause the problem, I can even use a not encrypted connection.
The problem is still the same. I also encountered that the problem is not
occuring always. I just tried it once again on two different computers. The
first is a Win2000 machine with about 1600MHz, on which the Directory server
itself runs. The second machine is a Win98 650MHz machine. On the first
machine I got between 1 and 4 result, then it hanged. On the second I also
had to increase the value to 20000 (!), after the 5194 successful responses
it hanged, too. Perhaps it is a speed problem?
-----Ursprungliche Nachricht-----
Von: Rosanna Lee [mailto:###@###.###
Gesendet: Freitag, 15. November 2002 16:35
An: ###@###.###
Cc: ###@###.###
Betreff: Re: Your Message Sent on Fri, 15 Nov 2002 15:48:26 +0100
I tried to reproduce the problem by using your test program but could not.
After increasing 20 to 200, the program still did not hang.
I noticed that you are using SSL, perhaps it is a problem related to that.
You can enable SSL tracing by setting the javax.net.debug system property
to 'all'.