Good morning / afternoon,
I have a problem with LDAP connector, when I use it in my unit test no problem, but when it was called in a application server environment, it seems to have classpath issue, but this class is delivred with java 1.6.17 (version I use).
I use spring-ldap to initiate my connection.
public static LdapContextSource getLdapContextSource(final String url, final String base) throws Exception {
LdapContextSource ldapContextSource = new LdapContextSource();
ldapContextSource.setUrl(url);
ldapContextSource.setBase(base);
ldapContextSource.setPooled(true);
//ldapContextSource.setContextFactory(LdapCtxFactory.class);
ldapContextSource.afterPropertiesSet();
return ldapContextSource;
}
Here is the log :
2010-08-10 09:46:38,183 : StandardWrapperValve.invoke : Servlet.service() for servlet default threw exception
java.lang.ClassNotFoundException: com.sun.jndi.ldap.LdapCtxFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at org.ow2.easybeans.loader.EasyBeansClassLoader.findClass(EasyBeansClassLoader.java:134)
at java.lang.ClassLoader.loadClass(ClassLoader.java:303)
at org.ow2.easybeans.loader.EasyBeansClassLoader.loadClass(EasyBeansClassLoader.java:238)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at org.springframework.ldap.core.support.AbstractContextSource.class$(AbstractContextSource.java:67)
at org.springframework.ldap.core.support.AbstractContextSource.<clinit>(AbstractContextSource.java:67)
at org.zenithar.security.connectors.impl.ldap.LdapContextFactory.getLdapContextSource(LdapContextFactory.java:16)
Thanks for all. Regards.