java.lang.ClassCastException: java.util.Arrays$ArrayList

Atlassian JIRA | Chai Ying Chan [Atlassian] | 9 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

    If you try to import a CSV file like this and map the date field: {noformat} Summary,Desc,Date Created,Reporter,,, Test issue, Test issue desc, 21/01/1999 12:00:00, admin, , , {noformat} You'll get a stacktrace when navigating to Step 4 of 5 of the import wizard: {noformat} 2008-11-28 08:52:30,059 http-8090-Processor2 WARN [jira.imports.csv.CsvConfigBean] Unable to find date fields. Null being returned. java.lang.ClassCastException: java.util.Arrays$ArrayList cannot be cast to java.lang.String at com.atlassian.jira.imports.csv.CsvConfigBean.getDateFields(CsvConfigBean.java:527) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at webwork.util.InjectionUtils$DefaultInjectionImpl.invoke(InjectionUtils.java:61) at webwork.util.InjectionUtils.invoke(InjectionUtils.java:52) at webwork.util.ValueStack.findValue(ValueStack.java:346) at webwork.util.SimpleTest.test(SimpleTest.java:391) at webwork.util.ValueStack.test(ValueStack.java:129) at webwork.view.taglib.IfTag.doStartTag(IfTag.java:38) at org.apache.jsp.secure.admin.views.importers.csv.configdateuserdefaults_jsp._jspx_meth_webwork_if_0(configdateuserdefaults_jsp.java:538) at org.apache.jsp.secure.admin.views.importers.csv.configdateuserdefaults_jsp._jspx_meth_page_applyDecorator_0(configdateuserdefaults_jsp.java:182) at org.apache.jsp.secure.admin.views.importers.csv.configdateuserdefaults_jsp._jspService(configdateuserdefaults_jsp.jav ... {noformat} Also, on this step, the user should be prompted for the DateFormat, but it doesn't show up (see screenshot). This is because somehow the ,,, gets parsed as an array, and the getDateFields() method tries to cast entries to a String. Our importer code should handle this better, by either reporting an error or by mapping the empty header row fields correctly.

    Atlassian JIRA | 8 years ago | Andreas Knecht
    java.lang.ClassCastException: java.util.Arrays$ArrayList cannot be cast to java.lang.String
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  3. 0

    If you try to import a CSV file like this and map the date field: {noformat} Summary,Desc,Date Created,Reporter,,, Test issue, Test issue desc, 21/01/1999 12:00:00, admin, , , {noformat} You'll get a stacktrace when navigating to Step 4 of 5 of the import wizard: {noformat} 2008-11-28 08:52:30,059 http-8090-Processor2 WARN [jira.imports.csv.CsvConfigBean] Unable to find date fields. Null being returned. java.lang.ClassCastException: java.util.Arrays$ArrayList cannot be cast to java.lang.String at com.atlassian.jira.imports.csv.CsvConfigBean.getDateFields(CsvConfigBean.java:527) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at webwork.util.InjectionUtils$DefaultInjectionImpl.invoke(InjectionUtils.java:61) at webwork.util.InjectionUtils.invoke(InjectionUtils.java:52) at webwork.util.ValueStack.findValue(ValueStack.java:346) at webwork.util.SimpleTest.test(SimpleTest.java:391) at webwork.util.ValueStack.test(ValueStack.java:129) at webwork.view.taglib.IfTag.doStartTag(IfTag.java:38) at org.apache.jsp.secure.admin.views.importers.csv.configdateuserdefaults_jsp._jspx_meth_webwork_if_0(configdateuserdefaults_jsp.java:538) at org.apache.jsp.secure.admin.views.importers.csv.configdateuserdefaults_jsp._jspx_meth_page_applyDecorator_0(configdateuserdefaults_jsp.java:182) at org.apache.jsp.secure.admin.views.importers.csv.configdateuserdefaults_jsp._jspService(configdateuserdefaults_jsp.jav ... {noformat} Also, on this step, the user should be prompted for the DateFormat, but it doesn't show up (see screenshot). This is because somehow the ,,, gets parsed as an array, and the getDateFields() method tries to cast entries to a String. Our importer code should handle this better, by either reporting an error or by mapping the empty header row fields correctly.

    Atlassian JIRA | 8 years ago | Andreas Knecht
    java.lang.ClassCastException: java.util.Arrays$ArrayList cannot be cast to java.lang.String

    Root Cause Analysis

    1. java.lang.ClassCastException

      java.util.Arrays$ArrayList

      at com.atlassian.jira.imports.csv.CsvConfigBean.getDateFields()
    2. com.atlassian.jira
      CsvConfigBean.getDateFields
      1. com.atlassian.jira.imports.csv.CsvConfigBean.getDateFields(CsvConfigBean.java:527)
      1 frame
    3. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor286.invoke(Unknown Source)
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      3. java.lang.reflect.Method.invoke(Method.java:585)
      3 frames
    4. webwork.util
      InjectionUtils$DefaultInjectionImpl.invoke
      1. webwork.util.InjectionUtils$DefaultInjectionImpl.invoke(InjectionUtils.java:61)
      1 frame