Unable to sync with JIRA's User Directory due to NullPointerException Caused by the Jespa Plugin
Symptoms
Confluence is unable to sync with JIRA's user directory (synchronization fails at every attempt)
The following appears in the atlassian-confluence.log
:
2012-07-11 17:50:51,338 http-8080-22 ERROR [500ErrorPage.jsp] Exception caught in 500 page null
java.lang.NullPointerException
at com.atlassian.seraph.auth.DefaultAuthenticator.getUserFromBasicAuthentication(DefaultAuthenticator.java:550)
at com.atlassian.seraph.auth.DefaultAuthenticator.getUser(DefaultAuthenticator.java:336)
at org.techtime.jira.authenticators.JespaAuthenticator.getUser(JespaAuthenticator.java:102)
at com.atlassian.seraph.auth.AbstractAuthenticator.getUser(AbstractAuthenticator.java:45)
at org.techtime.jira.servlets.JespaFilter.getRemoteUser(JespaFilter.java:41)
at org.techtime.atlassian.authentication.AbstractJespaFilter.needsFiltering(AbstractJespaFilter.java:117)
at org.techtime.atlassian.authentication.AbstractJespaFilter.doFilter(AbstractJespaFilter.java:75)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:46)
at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:66)
at com.atlassian.crowd.plugin.rest.filter.BasicApplicationAuthenticationFilter.doFilter(BasicApplicationAuthenticationFilter.java:67)
Diagnosis
Either run this query in Confluence's Database:
SELECT * FROM cwd_directory_attribute;
Or obtain the Directory Configuration Summary from Confluence Admin >> User Directories >> Directory Configuration Summary
, and make sure that the JIRA directory's configuration is accurate (correct URL, application name, and password). If all of these is verified and true, and you get the stack trace as per above, with this class:
at org.techtime.jira.authenticators.JespaAuthenticator.getUser
Proceed to the resolution below.
Cause
The Jespa SSO plugin is expecting NTLM authentication, when Confluence attempts to authenticate to JIRA via Basic Auth, resulting in a NPE.
Resolution
- Disable the Jespa Plugin, by disabling the plugin in
JIRA Administration >> Plugins
Modify JIRA's
WEB-INF/classes/seraph-config.xml
and comment out this authenticator:<authenticator class="org.techtime.jira.authenticators.JespaAuthenticator"/>
Then uncomment the default JIRA authenticator:
<authenticator class="com.atlassian.jira.security.login.JiraSeraphAuthenticator"/>
- Restart JIRA