java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.String

Atlassian JIRA | Janet Albion [Atlassian] | 7 years ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    Hi, From the following documentation: http://confluence.atlassian.com/display/JIRA03x/Changing+Custom+Field+Types bq.When moving back from a multi select list a select list, you have to make sure that only one item is selected for each multi select list. I think you should change this sentence above to: When moving back from Multi Select List to a Select List, you have to remove the default value of the Multi Select. In addition to that, please make sure that no issue that has multiple Multi Select List values. Otherwise, the issue will have no Select List value after conversion. The following error will occured during issue creation if the Multi Select List has default value before conversion: {noformat} ... java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.String at com.atlassian.jira.issue.customfields.impl.StringCFType.getObjectFromDbValue(StringCFType.java:25) ... {noformat} The solution for this error is to delete the default value of the Multi Select List by hacking the database directly: {noformat} delete from genericconfiguration where ID=<value_of_your_multi_select_default_value>; {noformat} If you are not sure which ID, you could do a select query and look for the XMLVALUE column where you can spot the default value: {noformat} select * from genericconfiguration; {noformat} Restart your JIRA for the changes to take effect. Do not hesitate to let me know if you need more description. Cheers, Janet

    Atlassian JIRA | 7 years ago | Janet Albion [Atlassian]
    java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.String
  2. 0

    Hi, From the following documentation: http://confluence.atlassian.com/display/JIRA03x/Changing+Custom+Field+Types bq.When moving back from a multi select list a select list, you have to make sure that only one item is selected for each multi select list. I think you should change this sentence above to: When moving back from Multi Select List to a Select List, you have to remove the default value of the Multi Select. In addition to that, please make sure that no issue that has multiple Multi Select List values. Otherwise, the issue will have no Select List value after conversion. The following error will occured during issue creation if the Multi Select List has default value before conversion: {noformat} ... java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.String at com.atlassian.jira.issue.customfields.impl.StringCFType.getObjectFromDbValue(StringCFType.java:25) ... {noformat} The solution for this error is to delete the default value of the Multi Select List by hacking the database directly: {noformat} delete from genericconfiguration where ID=<value_of_your_multi_select_default_value>; {noformat} If you are not sure which ID, you could do a select query and look for the XMLVALUE column where you can spot the default value: {noformat} select * from genericconfiguration; {noformat} Restart your JIRA for the changes to take effect. Do not hesitate to let me know if you need more description. Cheers, Janet

    Atlassian JIRA | 7 years ago | Janet Albion [Atlassian]
    java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.String

    Root Cause Analysis

    1. java.lang.ClassCastException

      java.util.ArrayList cannot be cast to java.lang.String

      at com.atlassian.jira.issue.customfields.impl.StringCFType.getObjectFromDbValue()
    2. com.atlassian.jira
      StringCFType.getObjectFromDbValue
      1. com.atlassian.jira.issue.customfields.impl.StringCFType.getObjectFromDbValue(StringCFType.java:25)
      1 frame