1
votes

I am getting the below two errors even after having the below dependencies in build.gradle :

compile group: 'org.springframework.ldap', name: 'spring-ldap-core', version: '2.3.1.RELEASE'
compile group: 'org.springframework.security', name: 'spring-security-ldap', version: '4.0.4.RELEASE'

Caused by: java.lang.ClassNotFoundException: org.springframework.ldap.core.ContextSource at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 26 common frames omitted

or

Caused by: java.lang.ClassNotFoundException: org.springframework.security.ldap.search.LdapUserSearch at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 26 common frames omitted

Can you please help me with this error , is there a versioning conflict between the dependencies here ?

1

1 Answers

1
votes

This indeed looks like a versioning conflict. According to MVNRepository, spring-security-ldap 4.0.4.RELEASE depends on spring-ldap-core 2.0.2.RELEASE version.

I think you can safely remove the dependency for spring-ldap-core and see that resolves your problem.

While you're at it, you may think about upgrading to a later version too.