JNDI Ldap Class Not Found
I am using JNDI Ldap to connect to an LDAP server in a Maven project.
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.LdapCtxFactory");
It fails at this line because it cannot find this class. I originally added the dependency from the ma开发者_Go百科in maven repository but then had to manually download it and install it into maven from the Java website. The jar containing com.sun.jndi.LdapCtxFactory is definitely within the build path but it still throws a Class Not Found exception. Has anyone seen anything similar or know how to resolve?
Thanks
You've got the class name wrong. It is com.sun.jndi.ldap.LdapCtxFactory.
First verify if the file exist in the rt.jar file
If not, verify the following answer provided in here:
com.sun.jndi.ldap.LdapCtxFactory : class not found in servlet
精彩评论