-
Notifications
You must be signed in to change notification settings - Fork 40.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NullPointerException when not setting a Username for LdapAutoConfiguration #11691
Comments
@vdubus Is this a regression or are you also seeing this problem with Spring Boot 1.5? It feels a little wrong to me that we should automatically set |
I've raised spring-projects/spring-ldap#473 to see if Spring LDAP can fix the underlying problem. |
I don't think that it's a regression.
In fact, there is two problems. One is the The other is the impossibility to define the property |
Just in case someone else stumbles on this. The NPE is now fixed via #17861. Spring Boot will no longer set the |
Sos grande, me has salvado |
As of version 2.0.0.M7, when not setting any
username
property forLdapAutoConfiguration
, this cause anNullPointerException
to occur when attempting to connect to the LDAP server.This problem occur because in
org.springframework.ldap.core.support.AbstractContextSource
the default values ofuserDn
andpassword
are set to an empty string which is then replaced bynull
.Configuration example:
As a fix for this problem, I would suggest to set the
anonymousReadOnly
property totrue
whenusername
is an emptyString
ornull
.The text was updated successfully, but these errors were encountered: