So, I am trying to implement an LDAP connection in java…this requires the com.sun.jndi.ldap.LdapCtxFactory. Jarfinder shows that the LdapCtxFactory should be included in rt.jar, which to my understanding is the base of the java SDK. Eclipse can’t find it (I’m trying to import it).
I was having an issue similar to this earlier, but I resolved it by installing the jar which contains it……..now I’m super confused, since the jar it is contained in is the default jar?
Note this also is a part of an Android Project. Would that make a difference?
Edit
Where I’m using this package is the following:
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, ldapHost);
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, user + "@" + domain);
env.put(Context.SECURITY_CREDENTIALS, pass);
And then later on I create the Context using the hash table:
ctxGC = new InitialLdapContext(env, null);
So, since I don’t have the com.sun, I can’t provide that in the hash table. Do I even need that first line? I’m not entirely sure what it is for…
Android does not include the Web Services API from the JRE (i.e. javax.naming)
However, all the comments were very useful and informative, and are what eventually led me to find the core of the problem.
I needed to download another library, the UnboundId library.
http://www.unboundid.com/products/ldapsdk/