1

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 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

3 Comments

Hi MuratOzkan, I removed the "spring-ldap-core" dependency as suggested and i still receive an error "Caused by: java.lang.ClassNotFoundException: org.springframework.security.ldap.search.LdapUserSearch"
What other dependencies you have?
MuratOzkan , The dependencies provided above were of the parent build.gradle , there are numerous other dependencies in the child module. I just added the above dependency to the child module build.gradle and it worked fine , thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.