Hi,
I am trying to access Ldap directory in a plugin which creates a new schedule job , for that I added the small logic as
Hashtable<String, String> env = new Hashtable<String, String>();
//env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put("java.naming.factory.initial", "com.sun.jndi.ldap.LdapCtxFactory");in public void execute(Map<String, Object> jobDataMap) {...} method.
I built it and deployed it successfully but I got an exception when the job is executed.
The exception is:
javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.jndi.ldap.LdapCtxFactory [Root exception is java.lang.ClassNotFoundException: com.sun.jndi.ldap.LdapCtxFactory]
.
.
.
Caused by: java.lang.ClassNotFoundException: com.sun.jndi.ldap.LdapCtxFactory
Does this class is not available though it is a sun api class? Please suggest an alternative way to connect to ldap.
Thanks.