Unable to View Screens in Project Administration Due to java.lang.NullPointerException

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

  1. After an upgrade, clicking the Screens Tab under Administration >> Projects for every project will cause the stack trace below:

    java.lang.NullPointerException
    	at com.atlassian.jira.issue.fields.screen.issuetype.DefaultProjectIssueTypeScreenSchemeHelper.getProjectsForFieldScreenSchemes(DefaultProjectIssueTypeScreenSchemeHelper.java:71)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    
  2. Clicking on the affected project via Administration >> Issues >> Screens >> Issue Type Screen Schemes will caused another stack trace:

    java.lang.NullPointerException
    	at com.atlassian.jira.projectconfig.contextproviders.ScreensSummaryPanelContextProvider.getScreenSchemes(ScreensSummaryPanelContextProvider.java:75)
    	at com.atlassian.jira.projectconfig.contextproviders.ScreensSummaryPanelContextProvider.getContextMap(ScreensSummaryPanelContextProvider.java:62)
    	at com.atlassian.jira.plugin.webfragment.CacheableContextProviderDecorator.initContextMap(CacheableContextProviderDecorator.java:70)
    	at com.atlassian.jira.plugin.webfragment.CacheableContextProviderDecorator.getContextMap(CacheableContextProviderDecorator.java:46)
    
  3. Accessing a specific few projects result in:

    java.lang.NullPointerException
    	at com.atlassian.jira.projectconfig.contextproviders.ScreensSummaryPanelContextProvider$SimpleIssueTypeScreenScheme.<init>(ScreensSummaryPanelContextProvider.java:217)
    	at com.atlassian.jira.projectconfig.contextproviders.ScreensSummaryPanelContextProvider.getContextMap(ScreensSummaryPanelContextProvider.java:59)
    	at com.atlassian.jira.plugin.webfragment.CacheableContextProviderDecorator.initContextMap(CacheableContextProviderDecorator.java:70)
    	at com.atlassian.jira.plugin.webfragment.CacheableContextProviderDecorator.getContextMap(CacheableContextProviderDecorator.java:46)
    
  4. As a secondary effect, it's possible that some projects cannot be deleted. See Unable to Delete a Project due to java.lang.NullPointerException to correct these. 

Cause

The project has no Issue Type Screen Scheme associated . This is reproducible as described in  JRA-26570 - Getting issue details... STATUS . While the primary reasons for that bug is corrected, there are chances that this error can happen in later versions of JIRA as explained at  JRA-27324 - Getting issue details... STATUS .

Workaround

Unable to render {include} The included page could not be found.

METHOD 1: For projects that do not contain data and is no longer needed

  1. Locate the problematic projects:

    SELECT * FROM project WHERE id NOT IN (SELECT source_node_id FROM nodeassociation WHERE sink_node_entity = 'IssueTypeScreenScheme');
  2. Delete the problematic project(s) that were the result of step 1. Note that you may experience a secondary NullPointerException, in which case, follow the instructions in Unable to Delete a Project due to java.lang.NullPointerException.

METHOD 2: For projects that contain data

  1. Locate the Issue Type Screen association with query below:

    SELECT id from project where id not in (select source_node_id from nodeassociation where sink_node_entity = 'IssueTypeScreenScheme');

    (info) Note the results, they'll be used below.

  2. For each id gathered above, insert a dummy Issue Type Screen Scheme into the database:

    INSERT into nodeassociation VALUES ('<id from above>','Project',1,'IssueTypeScreenScheme','ProjectScheme',NULL);
  3. Visit the project page. You should be able to access the culprit project, and all the Screens pages from project administration.

METHOD 3: Only try this when method 2 is not working

  1. If the user is still unable to access the project even after the INSERT query has been executed, update the nodeassociation with this query :

    UPDATE nodeassociation set SINK_NODE_ID=<ID of scheme> where SOURCE_NODE_ID=<id of project> and SINK_NODE_ENTITY='IssueTypeScreenScheme';
  2. Restart JIRA.
  3. Visit the project page. You should be able to access the culprit project, and all the Screens pages from project administration.

Resolution

Upgrade to JIRA 5.0.1. See  JRA-26570 - Getting issue details... STATUS .

Last modified on Mar 30, 2016

Was this helpful?

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