Confluence throws NullPointerException when logging in with LDAP user

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

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.

1 2 3 4 5 6 7 8 9 10 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:

    1 <userSearchFilter>objectclass=inetOrgPerson</userSearchFilter>

    Instead, try:

    1 <userSearchFilter>(objectclass=inetOrgPerson)</userSearchFilter>

Alternatively: this can also happen if using the third-party User Security Management Plugin. Disable this plugin as a test.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.