Comments (4)
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.
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.
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.
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)
- Add support for parametrized `@Query` HOT 3
- Introduce property for Jenkins user and Artifactory server details
- Upgrade to Spring LDAP 3.1.3
- Upgrade to Spring LDAP 3.2.1
- Upgrade to Maven Wrapper 3.9.6
- Upgrade to Maven Wrapper 3.9.6
- Upgrade to Maven Wrapper 3.9.6
- Release 3.1.8 (2023.0.8)
- Release 3.2.2 (2023.1.2)
- Extend license header copyright years to 2024
- Extend license header copyright years to 2024
- Extend license header copyright years to 2024
- Extend license header copyright years to 2024
- Release 3.1.9 (2023.0.9)
- Release 3.2.3 (2023.1.3)
- Upgrade to Spring LDAP 3.2.2
- Upgrade to Spring LDAP 3.1.4 HOT 1
- Release 3.1.10 (2023.0.10)
- Release 3.2.4 (2023.1.4)
- Release 3.3 M2 (2024.0.0)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-data-ldap.