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

Kuali JIRA | Dave Raines | 5 years ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    At UConn, we were seeing many occurances of the below stack trace in the logs. I determined the cause to be a bug in org.kuali.kfs.sys.document.workflow.FinancialSystemSearchableAttribute.validateUserSearchInputs method. The values of paramMap were being cast to String, when in fact the Map contains either String or List values. I am contributing back the fix we implemented at UConn. Patch is attached. {code} 10:53:57 u:mjf06002/d: ERROR StandardDocumentSearchGenerator: error finding searchable attribute in when validating document search criteria. java.lang.ClassCastException: java.util.Arrays$ArrayList cannot be cast to java.lang.String at org.kuali.kfs.sys.document.workflow.FinancialSystemSearchableAttribute.validateUserSearchInputs(FinancialSystemSearchableAttribute.java:249) at org.kuali.rice.kew.docsearch.StandardDocumentSearchGenerator.validateSearchableAttribute(StandardDocumentSearchGenerator.java:227) at org.kuali.rice.kew.docsearch.StandardDocumentSearchGenerator.validateSearchableAttributes(StandardDocumentSearchGenerator.java:204) at org.kuali.rice.kns.workflow.attribute.DataDictionaryDocumentSearchCustomizer.validateSearchableAttributes(DataDictionaryDocumentSearchCustomizer.java:77) at org.kuali.rice.kew.docsearch.service.impl.DocumentSearchServiceImpl.validateDocumentSearchCriteria(DocumentSearchServiceImpl.java:180) at sun.reflect.GeneratedMethodAccessor1829.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at net.bull.javamelody.MonitoringSpringInterceptor.invoke(MonitoringSpringInterceptor.java:73) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy522.validateDocumentSearchCriteria(Unknown Source) at sun.reflect.GeneratedMethodAccessor1829.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy523.validateDocumentSearchCriteria(Unknown Source) at org.kuali.rice.kew.bo.lookup.DocSearchCriteriaDTOLookupableHelperServiceImpl.validateSearchParameters(DocSearchCriteriaDTOLookupableHelperServiceImpl.java:908) at sun.reflect.GeneratedMethodAccessor1563.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at net.bull.javamelody.MonitoringSpringInterceptor.invoke(MonitoringSpringInterceptor.java:73) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy87.validateSearchParameters(Unknown Source) at org.kuali.rice.kns.lookup.KualiLookupableImpl.validateSearchParameters(KualiLookupableImpl.java:97) at sun.reflect.GeneratedMethodAccessor1562.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy88.validateSearchParameters(Unknown Source) at org.kuali.rice.kns.web.struts.action.KualiLookupAction.search(KualiLookupAction.java:202) at sun.reflect.GeneratedMethodAccessor1662.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) {code} JIRA COMMENTS {QUOTE} Kymber Horn added a comment - 26/Mar/13 7:21 PM Accepting functionally since this is a technical issue. Kymber Horn added a comment - 26/Mar/13 7:22 PM Changing it back. Barb Sutton added a comment - 23/Sep/14 6:36 PM Reverting functional and technical proposal acceptance since this was deferred to a future patch release. It can be reviewed again when the fix is ready to be contributed. {QUOTE}

    Kuali JIRA | 5 years ago | Dave Raines
    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 cannot be cast to java.lang.String

      at org.kuali.kfs.sys.document.workflow.FinancialSystemSearchableAttribute.validateUserSearchInputs()
    2. org.kuali.kfs
      FinancialSystemSearchableAttribute.validateUserSearchInputs
      1. org.kuali.kfs.sys.document.workflow.FinancialSystemSearchableAttribute.validateUserSearchInputs(FinancialSystemSearchableAttribute.java:249)
      1 frame
    3. org.kuali.rice
      DocumentSearchServiceImpl.validateDocumentSearchCriteria
      1. org.kuali.rice.kew.docsearch.StandardDocumentSearchGenerator.validateSearchableAttribute(StandardDocumentSearchGenerator.java:227)
      2. org.kuali.rice.kew.docsearch.StandardDocumentSearchGenerator.validateSearchableAttributes(StandardDocumentSearchGenerator.java:204)
      3. org.kuali.rice.kns.workflow.attribute.DataDictionaryDocumentSearchCustomizer.validateSearchableAttributes(DataDictionaryDocumentSearchCustomizer.java:77)
      4. org.kuali.rice.kew.docsearch.service.impl.DocumentSearchServiceImpl.validateDocumentSearchCriteria(DocumentSearchServiceImpl.java:180)
      4 frames
    4. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor1829.invoke(Unknown Source)
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      3. java.lang.reflect.Method.invoke(Method.java:597)
      3 frames
    5. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
      2. org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
      3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
      3 frames
    6. net.bull.javamelody
      MonitoringSpringInterceptor.invoke
      1. net.bull.javamelody.MonitoringSpringInterceptor.invoke(MonitoringSpringInterceptor.java:73)
      1 frame
    7. Spring AOP
      JdkDynamicAopProxy.invoke
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      2 frames
    8. Unknown
      $Proxy522.validateDocumentSearchCriteria
      1. $Proxy522.validateDocumentSearchCriteria(Unknown Source)
      1 frame
    9. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor1829.invoke(Unknown Source)
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      3. java.lang.reflect.Method.invoke(Method.java:597)
      3 frames
    10. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
      2. org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
      3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
      3 frames
    11. Spring Tx
      TransactionInterceptor.invoke
      1. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
      1 frame
    12. Spring AOP
      JdkDynamicAopProxy.invoke
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      2 frames
    13. Unknown
      $Proxy523.validateDocumentSearchCriteria
      1. $Proxy523.validateDocumentSearchCriteria(Unknown Source)
      1 frame
    14. org.kuali.rice
      DocSearchCriteriaDTOLookupableHelperServiceImpl.validateSearchParameters
      1. org.kuali.rice.kew.bo.lookup.DocSearchCriteriaDTOLookupableHelperServiceImpl.validateSearchParameters(DocSearchCriteriaDTOLookupableHelperServiceImpl.java:908)
      1 frame
    15. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor1563.invoke(Unknown Source)
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      3. java.lang.reflect.Method.invoke(Method.java:597)
      3 frames
    16. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
      2. org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
      3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
      3 frames
    17. Spring Tx
      TransactionInterceptor.invoke
      1. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
      1 frame
    18. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      1 frame
    19. Spring Tx
      TransactionInterceptor.invoke
      1. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
      1 frame
    20. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      1 frame
    21. net.bull.javamelody
      MonitoringSpringInterceptor.invoke
      1. net.bull.javamelody.MonitoringSpringInterceptor.invoke(MonitoringSpringInterceptor.java:73)
      1 frame
    22. Spring AOP
      JdkDynamicAopProxy.invoke
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      2 frames
    23. Unknown
      $Proxy87.validateSearchParameters
      1. $Proxy87.validateSearchParameters(Unknown Source)
      1 frame
    24. org.kuali.rice
      KualiLookupableImpl.validateSearchParameters
      1. org.kuali.rice.kns.lookup.KualiLookupableImpl.validateSearchParameters(KualiLookupableImpl.java:97)
      1 frame
    25. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor1562.invoke(Unknown Source)
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      3. java.lang.reflect.Method.invoke(Method.java:597)
      3 frames
    26. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
      2. org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
      3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
      3 frames
    27. Spring Tx
      TransactionInterceptor.invoke
      1. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
      1 frame
    28. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      1 frame
    29. Spring Tx
      TransactionInterceptor.invoke
      1. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
      1 frame
    30. Spring AOP
      JdkDynamicAopProxy.invoke
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      2 frames
    31. Unknown
      $Proxy88.validateSearchParameters
      1. $Proxy88.validateSearchParameters(Unknown Source)
      1 frame
    32. org.kuali.rice
      KualiLookupAction.search
      1. org.kuali.rice.kns.web.struts.action.KualiLookupAction.search(KualiLookupAction.java:202)
      1 frame
    33. Java RT
      DelegatingMethodAccessorImpl.invoke
      1. sun.reflect.GeneratedMethodAccessor1662.invoke(Unknown Source)
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      2 frames