以下是我的代码片段:
public class CheckingUsers
{
public static void main(String[] args) throws NamingException, LoginException
{
String URL = "ldap://myhostURL:389";
String ldapServerSearchBase = "DC=abc,DC=xyz,DC=pqr";
String principal = "CN=myCN,OU=PEOPLE,DC=abc,DC=xyz,DC=pqr";
Hashtable<String, Object> env = new Hashtable<String, Object>();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, URL);
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, principal);
env.put(Context.SECURITY_CREDENTIALS, pswd);
DirContext ctx = new InitialDirContext(env);
System.out.println("connected");
System.out.println(ctx.getEnvironment());
// some stuff
ctx.close();
}
}
我是新手,我在执行代码时收到此消息。请帮忙
当我停止执行时,我收到以下消息: