JNDI Connecting Problems
Hi There,
I am trying to connect to Active Directory in windows 2003 via LDAP for proof of principle before we go any further using JNDI.
I am having issues right from the start connecting to Acrtive directory.
My Server is called os2003 and the domain is TestDev.local. The
user is Administrator and password is password. I am logged onto the domain using a windows xp machine which i am trying to search active directory with java.
I keep getting javax.naming.AuthenticationException: [LDAP: error code 49 -
80090308: LdapErr: DSID-0C090334, comment: AcceptSecurityContext error, data
525, vece which after reading up I noticed is basically authentication
failed. I have tried changing all of this about but cant seem to get it to
work.
Any suggestions?
Hashtable env =new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL,"ldap://os2003:389/o=TestDev.local");
env.put(Context.SECURITY_AUTHENTICATION,"simple");
env.put(Context.SECURITY_PRINCIPAL,"cn=Administrator, ou=Users,o=TestDev.local");
env.put(Context.SECURITY_CREDENTIALS,"password");
DirContext ctx =new InitialDirContext(env);
Regards
Jamie

