somewhere in the code ...
String configFilename;
somewhere inside JFrame
MyLdapContext ldapContext = new MyLdapContext(configFilename);
...it throws exception!
somwhere inside the main class of a dummy class:
MyLdapContext ldapContext = new MyLdapContext(configFilename);
...it works!
inside MyLdapContext class:
private InitialLdapContext context;
public MyLdapContext(configFilename){
Hashtable env = new Hashtable();
LdapEnvBean ldapEnv = new LdapEnvBean(configFilename).load();
env.put(InitialLdapContext.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put(InitialLdapContext.REFERRAL, "follow");
env.put(InitialLdapContext.PROVIDER_URL, url);
env.put(InitialLdapContext.SECURITY_PRINCIPAL, ldapEnv.getUsername());
env.put(InitialLdapContext.SECURITY_CREDENTIALS, ldapEnv.getPassword());
this.userDefaultPassword = ldapEnv.getUserPassword();
context = new InitialLdapContext(env, null);
}
[ May 31, 2008: Message edited by: chubi shuki ]
[ May 31, 2008: Message edited by: chubi shuki ]