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

[1496 byte] By [jrallisoa] at [2007-10-2 17:58:47]
# 1

Sorted it now.

I chaged the below line:

env.put(Context.SECURITY_PRINCIPAL, "cn=Administrator, ou=Users,o=TestDev.local");

to

env.put(Context.SECURITY_PRINCIPAL, "Administrator@TestDev.local");

Hope this helps other people.

Regards

Jamie

jrallisoa at 2007-7-13 19:17:42 > top of Java-index,Core,Core APIs...
# 2
Maybe try this link:Java Technology Forums - LDAP: error code 49 http://forum.java.sun.com/thread.jspa?messageID=4227692
Dave360a at 2007-7-13 19:17:42 > top of Java-index,Core,Core APIs...