Create issue fail with 500 page exception in the log

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

  1. JIRA will fail to create an issue, with no error present in the GUI.
  2. 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:

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 performing any modifications to the database. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.

 

  1. Search for the incorrect value:

    Expand to see MySQL instructions
    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
    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
    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%');

     

    (info) For other DBMS, the SQL will need to be written appropriately from the above queries. Please consult with your DBA for the appropriate syntax.

  2. From the results above, search for the data that does not have the following format:

    <list>
      <long>10100</long>
      <long>10102</long>
    </list>
  3. Shutdown JIRA.
  4. Edit the database entry:

    UPDATE genericconfiguration SET XMLVALUE='<list>
    <long>10009</long>
    </list>' WHERE ID=<from_step_2_id>;

    (info) The value <long>...</long> varies according to the database.

  5. Restart JIRA.
  6. Test that the error has been resolved. If not, roll back the database to its backed up state immediately.
Last modified on Mar 30, 2016

Was this helpful?

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