'SelectIssueTypeSchemeForProject.doExecute' Error when Assigning an Issue Type Scheme to a Project Fails Due to Invalid Project Data
症状
When associating an issue type scheme to a project, a NullPointerException is thrown in log:
java.lang.NullPointerException
at java.util.ArrayList.<init>(ArrayList.java:131)
at org.apache.commons.collections.CollectionUtils.subtract(CollectionUtils.java:180)
at com.atlassian.jira.web.action.admin.issuetypes.pro.SelectIssueTypeSchemeForProject.doExecute(SelectIssueTypeSchemeForProject.java:167)
at webwork.action.ActionSupport.execute(ActionSupport.java:153)
at com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:54)
...
原因
The exception is thrown if there are any project(s) associated with that issue type scheme that do not exist in the in the JIRA instance. This problem can be caused if a project is not deleted completely due to a database connection failure.
回避策
- Jira をシャットダウンします。
- Run the below SQL queries in JIRA database to remove the association with the deleted project:
-- <issue type scheme name> should be replaced by the real issue type scheme name being used. delete from configurationcontext where fieldconfigscheme in (select id from fieldconfigscheme where fieldid='issuetype' and configname = '<issue type scheme name>') and project not in (select id from project);
- Jira を再起動します。
- Re-index JIRA
If this continues to occur with every single newly created project, this could mean that the defaults are incorrectly set - causing all new projects to be created without an issue type scheme. In this scenario you will need to repair the defaults first before creating any new projects. This can be done with the following steps:
- Jira をシャットダウンします。
- Run the below SQL queries in JIRA database to remove the association with the deleted project:
insert into configurationcontext values (10000, null, null, 'issuetype', 10000);
- Jira を再起動します。
- Re-index JIRA
Please note these steps assume you have not removed the JIRA default issue type scheme.