Git Product home page Git Product logo

Comments (4)

spring-projects-issues avatar spring-projects-issues commented on April 30, 2024

Mark Paluch commented

The code in your ticket spring-boot#7670 references org.springframework.ldap.repository.config.EnableLdapRepositories and not org.springframework.data.ldap.repository.config.EnableLdapRepositories.

Spring LDAP contains repository inside of spring-ldap-core. We decided during the Ingalls release train to move LDAP repository support from Spring LDAP into Spring Data LDAP. You stumbled upon the symptoms of one the main reasons behind the change: Spring LDAP depends on Spring Data Commons but has a different release/change cycle that can easily lead to version incompatibilities. We made a series of non-obvious changes and none of them is released yet. We recently introduced a breaking change to Spring Data Commons that breaks Spring LDAP's repository support.

Long story short:

Add the following dependency:

<dependency>
	<groupId>org.springframework.data</groupId>
	<artifactId>spring-data-ldap</artifactId>
</dependency>

and use org.springframework.data.ldap.repository.config.EnableLdapRepositories instead of org.springframework.ldap.repository.config.EnableLdapRepositories.

from spring-data-ldap.

spring-projects-issues avatar spring-projects-issues commented on April 30, 2024

Guan Wang commented

I guess I may nee to clarify a bit since I put some codes for submitting the issue on github.

Here is the code that could triggered the issue I reported at here:

@Configuration
@EnableLdapRepositories(basePackages="com.example", ldapTemplateRef = "ldapTemplate4Author")
public class ldapConfig1 {
	private String url;
	private String base;
	private String userDN;
	private String password;
	public ldapConfig1(){}
	@Autowired
	public ldapConfig1(Environment envfoo) {
		this.url = envfoo.getProperty("ldap.author.url");
		this.base = envfoo.getProperty("ldap.author.base");
		this.userDN = envfoo.getProperty("ldap.author.userdn");
		this.password = envfoo.getProperty("ldap.author.password");
	}
	
	@Bean(name = "ldapContextSource4Author")
	public LdapContextSource contextSource() {
		LdapContextSource ctx = new LdapContextSource();
		ctx.setUrl(this.url);
		ctx.setBase(this.base);
		ctx.setUserDn(this.userDN);
		ctx.setPassword(this.password);
		return ctx;
	}
	@Bean(name = "ldapTemplate4Author")
	public LdapTemplate ldapTemplate() {
		return new LdapTemplate(contextSource());
	}
}

from spring-data-ldap.

spring-projects-issues avatar spring-projects-issues commented on April 30, 2024

Guan Wang commented

Hi Mark,

Thank you for the quick reply! My previous comment was posted before I noticed your reply.

I apologize if that makes you confused. I am testing my code now and will let you know how it goes.

Again, thank you for the guide!

from spring-data-ldap.

spring-projects-issues avatar spring-projects-issues commented on April 30, 2024

Guan Wang commented

Hi Mark,

By changing the import from ldap to data.ldap, the problem is solved and I am back in business!

Also, I'd like to point out: developers who's taking the same repository approach, will also have to change import of LdapRepository to:

org.springframework.data.ldap.repository.LdapRepository

Otherwise, you might experience another weird error message complaining missing proper property on ldap entity

from spring-data-ldap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.