Create issue fail with 500 page exception in the log
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
JIRA will fail to create an issue, with no error present in the GUI.
Trying to edit the default value of a Multi Select Custom Field throws a
java.lang.ClassCastException
.
The following appears in the atlassian-jira.log
:
1
2
3
4
5
6
2012-06-21 12:11:28,320 http-9800-9 ERROR [500ErrorPage.jsp] Exception caught in 500 page java.lang.Long cannot be cast to java.util.Collection
java.lang.ClassCastException: java.lang.Long cannot be cast to java.util.Collection
at com.atlassian.jira.issue.customfields.impl.MultiSelectCFType.getDefaultValue(MultiSelectCFType.java:163)
at com.atlassian.jira.issue.customfields.impl.MultiSelectCFType.getDefaultValue(MultiSelectCFType.java:71)
at com.atlassian.jira.issue.fields.CustomFieldImpl.populateDefaults(CustomFieldImpl.java:554)
at com.atlassian.jira.web.action.issue.IssueCreationHelperBeanImpl.validateCreateIssueFields(IssueCreationHelperBeanImpl.java:102)
Cause
The default value of the Multi Select Custom Field is not migrated to a correct format in the database
Workaround
Always back up your data before making any database modifications. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.
Search for the incorrect value:
Expand to see MySQL instructions
1
SELECT * FROM genericconfiguration where DATAKEY IN (SELECT b.id FROM customfield a, fieldconfiguration b where b.FIELDID=INSERT('customfield_',13,5,a.id) AND CUSTOMFIELDTYPEKEY like '%multiselect%');
Expand to see PostgreSQL instructions
1
SELECT * FROM genericconfiguration where datakey IN (SELECT CAST (b.id AS CHAR (10)) FROM customfield a, fieldconfiguration b where b.FIELDID=CONCAT('customfield_',a.id) AND CUSTOMFIELDTYPEKEY like '%multiselect%');
Expand to see MSSQL instructions
1
SELECT * FROM <database_scheme>.genericconfiguration where DATAKEY IN (SELECT b.id FROM <database_scheme>.customfield a, <database_scheme>.fieldconfiguration b where b.FIELDID=('customfield_'+STR(a.id,5,0)) AND a.CUSTOMFIELDTYPEKEY like '%multiselect%');
ℹ️ For other DBMS, the SQL will need to be written appropriately from the above queries. Please consult with your DBA for the appropriate syntax.
From the results above, search for the data that does not have the following format:
1 2 3 4
<list> <long>10100</long> <long>10102</long> </list>
Shutdown JIRA.
Edit the database entry:
1 2 3
UPDATE genericconfiguration SET XMLVALUE='<list> <long>10009</long> </list>' WHERE ID=<from_step_2_id>;
ℹ️The value <long>...</long> varies according to the database.
Restart JIRA.
Test that the error has been resolved. If not, roll back the database to its backed up state immediately.
Was this helpful?