Skip to content
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 setUserDn is not set #473

Closed
philwebb opened this issue Jan 22, 2018 · 1 comment
Closed

NullPointerException when setUserDn is not set #473

philwebb opened this issue Jan 22, 2018 · 1 comment
Assignees
Milestone

Comments

@philwebb
Copy link
Member

This issue was originally raised with Spring Boot but I think it might an LDAP issue.

If the userDn is left unset on the ContextSource the following is logged:

Property 'userDn' not set - anonymous context will be used for read-write operations

However, later the following NPE is thrown:

java.lang.NullPointerException: null
	at java.util.Hashtable.put(Hashtable.java:460) ~[na:1.8.0_152]
	at org.springframework.ldap.core.support.SimpleDirContextAuthenticationStrategy.setupEnvironment(SimpleDirContextAuthenticationStrategy.java:42) ~[spring-ldap-core-2.3.2.RELEASE.jar:2.3.2.RELEASE]
	at org.springframework.ldap.core.support.AbstractContextSource.setupAuthenticatedEnvironment(AbstractContextSource.java:194) ~[spring-ldap-core-2.3.2.RELEASE.jar:2.3.2.RELEASE]
	at org.springframework.ldap.core.support.AbstractContextSource.getAuthenticatedEnv(AbstractContextSource.java:582) ~[spring-ldap-core-2.3.2.RELEASE.jar:2.3.2.RELEASE]
	at org.springframework.ldap.core.support.AbstractContextSource.doGetContext(AbstractContextSource.java:134) ~[spring-ldap-core-2.3.2.RELEASE.jar:2.3.2.RELEASE]
	at org.springframework.ldap.core.support.AbstractContextSource.getReadOnlyContext(AbstractContextSource.java:158) ~[spring-ldap-core-2.3.2.RELEASE.jar:2.3.2.RELEASE]
	at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:357) ~[spring-ldap-core-2.3.2.RELEASE.jar:2.3.2.RELEASE]
	at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:309) ~[spring-ldap-core-2.3.2.RELEASE.jar:2.3.2.RELEASE]
	at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:642) ~[spring-ldap-core-2.3.2.RELEASE.jar:2.3.2.RELEASE]
	at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:578) ~[spring-ldap-core-2.3.2.RELEASE.jar:2.3.2.RELEASE]
	at org.springframework.ldap.core.LdapTemplate.find(LdapTemplate.java:1840) ~[spring-ldap-core-2.3.2.RELEASE.jar:2.3.2.RELEASE]
	at org.springframework.ldap.core.LdapTemplate.find(LdapTemplate.java:1861) ~[spring-ldap-core-2.3.2.RELEASE.jar:2.3.2.RELEASE]
	at org.springframework.ldap.core.LdapTemplate.findOne(LdapTemplate.java:1869) ~[spring-ldap-core-2.3.2.RELEASE.jar:2.3.2.RELEASE]
	at org.springframework.data.ldap.repository.query.AbstractLdapRepositoryQuery.execute(AbstractLdapRepositoryQuery.java:70) ~[spring-data-ldap-2.0.2.RELEASE.jar:2.0.2.RELEASE]
	at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:597) ~[spring-data-commons-2.0.2.RELEASE.jar:2.0.2.RELEASE]
	at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:580) ~[spring-data-commons-2.0.2.RELEASE.jar:2.0.2.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) ~[spring-aop-5.0.2.RELEASE.jar:5.0.2.RELEASE]
	at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:59) ~[spring-data-commons-2.0.2.RELEASE.jar:2.0.2.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) ~[spring-aop-5.0.2.RELEASE.jar:5.0.2.RELEASE]
	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) ~[spring-aop-5.0.2.RELEASE.jar:5.0.2.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) ~[spring-aop-5.0.2.RELEASE.jar:5.0.2.RELEASE]
	at org.springframework.data.repository.core.support.SurroundingTransactionDetectorMethodInterceptor.invoke(SurroundingTransactionDetectorMethodInterceptor.java:61) ~[spring-data-commons-2.0.2.RELEASE.jar:2.0.2.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) ~[spring-aop-5.0.2.RELEASE.jar:5.0.2.RELEASE]
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) ~[spring-aop-5.0.2.RELEASE.jar:5.0.2.RELEASE]
	at com.sun.proxy.$Proxy78.findByLogin(Unknown Source) ~[na:na]
eddumelendez added a commit to eddumelendez/spring-ldap that referenced this issue Jan 23, 2018
@rwinch rwinch self-assigned this Jan 22, 2019
@rwinch rwinch added the bug label Jan 22, 2019
@rwinch rwinch added this to the 2.3.3 milestone Jan 22, 2019
plumpy added a commit to plumpy/clouddriver that referenced this issue May 10, 2019
We can reenable it once we upgrade to a version of spring-boot with the
fix for spring-projects/spring-ldap#473
plumpy added a commit to plumpy/clouddriver that referenced this issue May 10, 2019
We can reenable it once we upgrade to a version of spring-boot with the
fix for spring-projects/spring-ldap#473
plumpy added a commit to plumpy/gate that referenced this issue May 10, 2019
We can reenable it once we upgrade to a version of spring-boot with the
fix for spring-projects/spring-ldap#473
ezimanyi pushed a commit to spinnaker/gate that referenced this issue May 10, 2019
)

We can reenable it once we upgrade to a version of spring-boot with the
fix for spring-projects/spring-ldap#473
@JimHosken
Copy link

Is there an anticipated release date for the spring-ldap 2.3.3 release?

We use LDAP as an authenication provider and access it in a read-only / unauthenticated fashion. I have disabled the LDAP Health Indicator in spring boot as a workaround, but this is not an ideal path moving forward.

PascalSchumacher added a commit to PascalSchumacher/flowable-engine that referenced this issue Jun 10, 2019
…s/spring-ldap#473 which causes LDAP health check to fail:

java.lang.NullPointerException: null
	at java.util.Hashtable.put(Hashtable.java:460)
	at org.springframework.ldap.core.support.SimpleDirContextAuthenticationStrategy.setupEnvironment(SimpleDirContextAuthenticationStrategy.java:42)
PascalSchumacher added a commit to PascalSchumacher/flowable-engine that referenced this issue Jun 10, 2019
…s/spring-ldap#473 which causes LDAP health check to fail:

java.lang.NullPointerException: null
	at java.util.Hashtable.put(Hashtable.java:460)
	at org.springframework.ldap.core.support.SimpleDirContextAuthenticationStrategy.setupEnvironment(SimpleDirContextAuthenticationStrategy.java:42)
PascalSchumacher added a commit to PascalSchumacher/flowable-engine that referenced this issue Jun 19, 2019
…s/spring-ldap#473 which causes LDAP health check to fail:

java.lang.NullPointerException: null
	at java.util.Hashtable.put(Hashtable.java:460)
	at org.springframework.ldap.core.support.SimpleDirContextAuthenticationStrategy.setupEnvironment(SimpleDirContextAuthenticationStrategy.java:42)
PascalSchumacher added a commit to PascalSchumacher/flowable-engine that referenced this issue Jun 19, 2019
…s/spring-ldap#473 which causes LDAP health check to fail:

java.lang.NullPointerException: null
	at java.util.Hashtable.put(Hashtable.java:460)
	at org.springframework.ldap.core.support.SimpleDirContextAuthenticationStrategy.setupEnvironment(SimpleDirContextAuthenticationStrategy.java:42)
PascalSchumacher added a commit to PascalSchumacher/flowable-engine that referenced this issue Aug 6, 2019
…s/spring-ldap#473 which causes LDAP health check to fail:

java.lang.NullPointerException: null
	at java.util.Hashtable.put(Hashtable.java:460)
	at org.springframework.ldap.core.support.SimpleDirContextAuthenticationStrategy.setupEnvironment(SimpleDirContextAuthenticationStrategy.java:42)
PascalSchumacher added a commit to PascalSchumacher/flowable-engine that referenced this issue Aug 9, 2019
…s/spring-ldap#473 which causes LDAP health check to fail:

java.lang.NullPointerException: null
	at java.util.Hashtable.put(Hashtable.java:460)
	at org.springframework.ldap.core.support.SimpleDirContextAuthenticationStrategy.setupEnvironment(SimpleDirContextAuthenticationStrategy.java:42)
PascalSchumacher added a commit to PascalSchumacher/flowable-engine that referenced this issue Aug 9, 2019
…s/spring-ldap#473 which causes LDAP health check to fail:

java.lang.NullPointerException: null
	at java.util.Hashtable.put(Hashtable.java:460)
	at org.springframework.ldap.core.support.SimpleDirContextAuthenticationStrategy.setupEnvironment(SimpleDirContextAuthenticationStrategy.java:42)
PascalSchumacher added a commit to PascalSchumacher/flowable-engine that referenced this issue Sep 11, 2019
…s/spring-ldap#473 which causes LDAP health check to fail:

java.lang.NullPointerException: null
	at java.util.Hashtable.put(Hashtable.java:460)
	at org.springframework.ldap.core.support.SimpleDirContextAuthenticationStrategy.setupEnvironment(SimpleDirContextAuthenticationStrategy.java:42)
PascalSchumacher added a commit to PascalSchumacher/flowable-engine that referenced this issue Sep 11, 2019
…s/spring-ldap#473 which causes LDAP health check to fail:

java.lang.NullPointerException: null
	at java.util.Hashtable.put(Hashtable.java:460)
	at org.springframework.ldap.core.support.SimpleDirContextAuthenticationStrategy.setupEnvironment(SimpleDirContextAuthenticationStrategy.java:42)
PascalSchumacher added a commit to PascalSchumacher/flowable-engine that referenced this issue Sep 11, 2019
…s/spring-ldap#473 which causes LDAP health check to fail:

java.lang.NullPointerException: null
	at java.util.Hashtable.put(Hashtable.java:460)
	at org.springframework.ldap.core.support.SimpleDirContextAuthenticationStrategy.setupEnvironment(SimpleDirContextAuthenticationStrategy.java:42)
PascalSchumacher added a commit to PascalSchumacher/flowable-engine that referenced this issue Sep 11, 2019
…s/spring-ldap#473 which causes LDAP health check to fail:

java.lang.NullPointerException: null
	at java.util.Hashtable.put(Hashtable.java:460)
	at org.springframework.ldap.core.support.SimpleDirContextAuthenticationStrategy.setupEnvironment(SimpleDirContextAuthenticationStrategy.java:42)
PascalSchumacher added a commit to PascalSchumacher/flowable-engine that referenced this issue Sep 13, 2019
…s/spring-ldap#473 which causes LDAP health check to fail:

java.lang.NullPointerException: null
	at java.util.Hashtable.put(Hashtable.java:460)
	at org.springframework.ldap.core.support.SimpleDirContextAuthenticationStrategy.setupEnvironment(SimpleDirContextAuthenticationStrategy.java:42)
PascalSchumacher added a commit to PascalSchumacher/flowable-engine that referenced this issue Sep 25, 2019
…s/spring-ldap#473 which causes LDAP health check to fail:

java.lang.NullPointerException: null
	at java.util.Hashtable.put(Hashtable.java:460)
	at org.springframework.ldap.core.support.SimpleDirContextAuthenticationStrategy.setupEnvironment(SimpleDirContextAuthenticationStrategy.java:42)
PascalSchumacher added a commit to PascalSchumacher/flowable-engine that referenced this issue Oct 1, 2019
…s/spring-ldap#473 which causes LDAP health check to fail:

java.lang.NullPointerException: null
	at java.util.Hashtable.put(Hashtable.java:460)
	at org.springframework.ldap.core.support.SimpleDirContextAuthenticationStrategy.setupEnvironment(SimpleDirContextAuthenticationStrategy.java:42)
PascalSchumacher added a commit to PascalSchumacher/flowable-engine that referenced this issue Oct 1, 2019
…s/spring-ldap#473 which causes LDAP health check to fail:

java.lang.NullPointerException: null
	at java.util.Hashtable.put(Hashtable.java:460)
	at org.springframework.ldap.core.support.SimpleDirContextAuthenticationStrategy.setupEnvironment(SimpleDirContextAuthenticationStrategy.java:42)
PascalSchumacher added a commit to PascalSchumacher/flowable-engine that referenced this issue Oct 1, 2019
…s/spring-ldap#473 which causes LDAP health check to fail:

java.lang.NullPointerException: null
	at java.util.Hashtable.put(Hashtable.java:460)
	at org.springframework.ldap.core.support.SimpleDirContextAuthenticationStrategy.setupEnvironment(SimpleDirContextAuthenticationStrategy.java:42)
PascalSchumacher added a commit to PascalSchumacher/flowable-engine that referenced this issue Oct 3, 2019
…s/spring-ldap#473 which causes LDAP health check to fail:

java.lang.NullPointerException: null
	at java.util.Hashtable.put(Hashtable.java:460)
	at org.springframework.ldap.core.support.SimpleDirContextAuthenticationStrategy.setupEnvironment(SimpleDirContextAuthenticationStrategy.java:42)
PascalSchumacher added a commit to PascalSchumacher/flowable-engine that referenced this issue Oct 17, 2019
…s/spring-ldap#473 which causes LDAP health check to fail:

java.lang.NullPointerException: null
	at java.util.Hashtable.put(Hashtable.java:460)
	at org.springframework.ldap.core.support.SimpleDirContextAuthenticationStrategy.setupEnvironment(SimpleDirContextAuthenticationStrategy.java:42)
PascalSchumacher added a commit to PascalSchumacher/flowable-engine that referenced this issue Nov 11, 2019
…s/spring-ldap#473 which causes LDAP health check to fail:

java.lang.NullPointerException: null
	at java.util.Hashtable.put(Hashtable.java:460)
	at org.springframework.ldap.core.support.SimpleDirContextAuthenticationStrategy.setupEnvironment(SimpleDirContextAuthenticationStrategy.java:42)
PascalSchumacher added a commit to PascalSchumacher/flowable-engine that referenced this issue Nov 11, 2019
…s/spring-ldap#473 which causes LDAP health check to fail:

java.lang.NullPointerException: null
	at java.util.Hashtable.put(Hashtable.java:460)
	at org.springframework.ldap.core.support.SimpleDirContextAuthenticationStrategy.setupEnvironment(SimpleDirContextAuthenticationStrategy.java:42)
PascalSchumacher added a commit to PascalSchumacher/flowable-engine that referenced this issue Nov 16, 2019
…s/spring-ldap#473 which causes LDAP health check to fail:

java.lang.NullPointerException: null
	at java.util.Hashtable.put(Hashtable.java:460)
	at org.springframework.ldap.core.support.SimpleDirContextAuthenticationStrategy.setupEnvironment(SimpleDirContextAuthenticationStrategy.java:42)
PascalSchumacher added a commit to PascalSchumacher/flowable-engine that referenced this issue Nov 16, 2019
…s/spring-ldap#473 which causes LDAP health check to fail:

java.lang.NullPointerException: null
	at java.util.Hashtable.put(Hashtable.java:460)
	at org.springframework.ldap.core.support.SimpleDirContextAuthenticationStrategy.setupEnvironment(SimpleDirContextAuthenticationStrategy.java:42)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants