Confluence throws NullPointerException when logging in with LDAP user
Symptoms
A NullPointerException describes a broad category of errors where a value that Confluence is expecting cannot be found. The scope of this KB is specifically to address the following error that appears in the atlassian-confluence.log
. If you are getting a different stacktrace, it doesn't hurt to check the steps below anyway, but you may be running into a different problem.
java.lang.NullPointerException
at com.atlassian.confluence.user.ConfluenceLoginInterceptor.afterLogin(ConfluenceLoginInterceptor.java:34)
at com.atlassian.seraph.filter.PasswordBasedLoginFilter.login(PasswordBasedLoginFilter.java:60)
at com.atlassian.seraph.filter.BaseLoginFilter.doFilter(BaseLoginFilter.java:101)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at com.atlassian.confluence.util.ClusterHeaderFilter.doFilter(ClusterHeaderFilter.java:35)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at com.atlassian.johnson.filters.AbstractJohnsonFilter.doFilter(AbstractJohnsonFilter.java:72)
Causes and Resolutions
If using Confluence 3.5 or higher:
- Log in as a local Confluence administrator account. Follow Restore Passwords To Recover Admin User Rights if you need help locating one such account or resetting its password.
- Navigate to
Confluence Admin > User Directories
andEdit
your LDAP user directory - Under User Schema settings, check that the User Search Filter is enclosed in parenthesis. For example:
- Good:
(objectclass=inetOrgPerson)
- Bad:
objectclass=inetOrgPerson
- Good:
- Check Group Schema settings for a similar filter, and ensure that is enclosed as well.
If using Confluence 3.4 or lower:
On your filesystem, open up the file
<confluence_install>/confluence/WEB-INF/classes/atlassian-user.xml
and check that the search filters are enclosed in parenthesis. For example, this will not work:<userSearchFilter>objectclass=inetOrgPerson</userSearchFilter>
Instead, try:
<userSearchFilter>(objectclass=inetOrgPerson)</userSearchFilter>
Alternatively: this can also happen if using the third-party User Security Management Plugin. Disable this plugin as a test.