java.lang.NullPointerException While Accessing Notifications Tab of Projects
Symptoms
When administrators tries to access the notifications tab on the Project Administration page, a java.lang.NullPointerException is thrown.
The following appears in the atlassian-jira.log
:
2012-10-12 22:09:04,732 http-8081-4 ERROR [500ErrorPage.jsp] Exception caught in 500 page null
java.lang.NullPointerException
at com.atlassian.jira.projectconfig.contextproviders.ProjectNotificationContextProvider.getNotifications(ProjectNotificationContextProvider.java:189)
at com.atlassian.jira.projectconfig.contextproviders.ProjectNotificationContextProvider.getContextMap(ProjectNotificationContextProvider.java:105)
at com.atlassian.jira.plugin.webfragment.CacheableContextProviderDecorator.initContextMap(CacheableContextProviderDecorator.java:70)
...
The following may also be shown in newer versions of JIRA (6.3.x):
2014-12-19 18:54:19,723 http-bio-8075-exec-24 WARN localadmin 1134x1825x1 1r6d7mr 127.0.0.1 /plugins/servlet/project-config/CSON/notifications [com.atlassian.ozymandias.SafePluginPointAccess] Unable to run plugin code because of 'java.lang.NullPointerException - null'.
If you turn on DEBUG logging for the package com.atlassian.ozymandias
, you will see the following additional lines:
2014-12-19 18:54:19,723 http-bio-8075-exec-24 DEBUG localadmin 1134x1825x1 1r6d7mr 127.0.0.1 /plugins/servlet/project-config/CSON/notifications [com.atlassian.ozymandias.SafePluginPointAccess] Unable to run plugin code because of 'java.lang.NullPointerException - null'.
java.lang.NullPointerException
at com.atlassian.jira.projectconfig.contextproviders.ProjectNotificationContextProvider.getNotifications(ProjectNotificationContextProvider.java:176)
at com.atlassian.jira.projectconfig.contextproviders.ProjectNotificationContextProvider.getContextMap(ProjectNotificationContextProvider.java:102)
at com.atlassian.jira.plugin.webfragment.CacheableContextProviderDecorator.initContextMap(CacheableContextProviderDecorator.java:70)
at com.atlassian.jira.plugin.webfragment.CacheableContextProviderDecorator.getContextMap(CacheableContextProviderDecorator.java:46)
...
Cause
This error is caused by invalid entries for notifications (either groups or users) for the notification events in the notification scheme.
Resolution
Go to the Notification Schemes in JIRA Administration (Administration > Issues > Notification Schemes).
- Click on the Notification link for the scheme associated with the project.
- Check if there are empty entries (with just a 'Delete' link next to it).
For example, on the below image, if there are empty users/groups on "Issue Resolved" and "Issue Closed" events. - Remove these empty users/groups.
- Attempt to access the notification scheme of the problematic project.
- Go to Notification tab on Project (Administration > Project > Notification tab) to view the notification scheme, and see whether the problem is resolved.
- Perform a background re-index if empty users/groups/values are not presented