NamingEnumeration answer = ctx.search(BASE_SEARCH, filter, constraints); System.out.println("ur search has been performed");
but I'm not able to make it up...can anyone tell me what is the problem with the code...and also plz tell me what all things should be in ldap...as I do not have any Idea of it.. It is giving exception: Exception is javax.naming.NamingException: [LDAP: error code 1 - 00000000 rr: DSID-0C090627, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, vece ]; remaining name ''
It looks fine at a quick glance. The error message basically means that you need an authenticated context to perform your search. Since Principal and Credentials are supplied (which should normally result in an authenticated Context) in the environment, this leads me to think that either of them is incorrect (i.e. invalid login).
One would expect to get an error message when creating the DirContext instance, but Active Directory has been known to be less than friendly when it comes to error messages.