Confluence throws NullPointerException when logging in with LDAP user

Still need help?

The Atlassian Community is here for you.

Ask the community

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:

  1. 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.
  2. Navigate to Confluence Admin > User Directories and Edit your LDAP user directory
  3. Under User Schema settings, check that the User Search Filter is enclosed in parenthesis. For example:
    1. Good: (objectclass=inetOrgPerson)
    2. Bad: objectclass=inetOrgPerson
  4. Check Group Schema settings for a similar filter, and ensure that is enclosed as well.

If using Confluence 3.4 or lower:

  1. 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.

Last modified on Nov 5, 2018

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.