java.lang.ClassCastException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • After adding a global Number field, creating two issues with values set, and sorting by the number CF, the page dies with the message: # Errors: null. Please manually reindex (Administration -> System -> Indexing) # null. Please manually reindex (Administration -> System -> Indexing) and in the logs, we get: java.lang.ClassCastException at com.atlassian.jira.issue.customfields.impl.NumberCFType.compare(NumberCFType.java:41) at com.atlassian.jira.issue.fields.CustomFieldImpl.compare(CustomFieldImpl.java:353) at com.atlassian.jira.issue.comparator.IssueCustomFieldComparator.compare(IssueCustomFieldComparator.java:55) at org.apache.commons.collections.comparators.ComparatorChain.compare(Unknown Source) at java.util.Arrays.mergeSort(Arrays.java:1278) at java.util.Arrays.sort(Arrays.java:1219) at java.util.Collections.sort(Collections.java:155) at com.atlassian.jira.issue.search.providers.DefaultSearchProvider.search(DefaultSearchProvider.java:63) at com.atlassian.jira.issue.managers.DefaultIssueManager.execute(DefaultIssueManager.java:231) at com.atlassian.jira.issue.managers.CachingIssueManager.execute(CachingIssueManager.java:99) 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:324) at com.atlassian.util.profiling.object.ObjectProfiler.profiledInvoke(ObjectProfiler.java:68) at com.atlassian.jira.config.component.DelegatingInvocationHandler.invoke(DelegatingInvocationHandler.java:27) at $Proxy4.execute(Unknown Source) at com.atlassian.jira.web.action.issue.IssueNavigator.getBrowsableItems(IssueNavigator.java:531) at com.atlassian.jira.web.action.issue.IssueNavigator.doExecute(IssueNavigator.java:412) at webwork.action.ActionSupport.execute(ActionSupport.java:151) at com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:46) at webwork.dispatcher.GenericDispatcher.executeAction(GenericDispatcher.java:131) at com.atlassian.jira.web.dispatcher.JiraServletDispatcher.service(JiraServletDispatcher.java:186) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:142) at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:58) at com.atlassian.jira.web.filters.SitemeshExcludePathFilter.doFilter(SitemeshExcludePathFilter.java:36) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at com.atlassian.seraph.filter.SecurityFilter.doFilter(SecurityFilter.java:168) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at com.atlassian.seraph.filter.LoginFilter.doFilter(LoginFilter.java:181) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at com.atlassian.util.profiling.filters.ProfilingFilter.doFilter(ProfilingFilter.java:132) at com.atlassian.jira.web.filters.ProfilingAndErrorFilter.doFilter(ProfilingAndErrorFilter.java:25) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at com.atlassian.jira.web.filters.ActionCleanupDelayFilter.doFilter(ActionCleanupDelayFilter.java:37) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at com.atlassian.johnson.filters.JohnsonFilter.doFilter(JohnsonFilter.java:91) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at com.atlassian.jira.web.filters.gzip.GzipFilter.doFilter(GzipFilter.java:72) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at com.atlassian.core.filters.AbstractEncodingFilter.doFilter(AbstractEncodingFilter.java:36) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:589) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666) at java.lang.Thread.run(Thread.java:534) 2004-10-27 09:21:45,573 ERROR [web.action.issue.IssueNavigator] Error searching: java.lang.ClassCastException at com.atlassian.jira.issue.customfields.impl.NumberCFType.compare(NumberCFType.java:41) at com.atlassian.jira.issue.fields.CustomFieldImpl.compare(CustomFieldImpl.java:353) at com.atlassian.jira.issue.comparator.IssueCustomFieldComparator.compare(IssueCustomFieldComparator.java:55) at org.apache.commons.collections.comparators.ComparatorChain.compare(Unknown Source) at java.util.Arrays.mergeSort(Arrays.java:1278) at java.util.Arrays.sort(Arrays.java:1219) at java.util.Collections.sort(Collections.java:155) at com.atlassian.jira.issue.search.providers.DefaultSearchProvider.search(DefaultSearchProvider.java:63) at com.atlassian.jira.issue.managers.DefaultIssueManager.execute(DefaultIssueManager.java:231) at com.atlassian.jira.issue.managers.CachingIssueManager.execute(CachingIssueManager.java:99) 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:324) at com.atlassian.util.profiling.object.ObjectProfiler.profiledInvoke(ObjectProfiler.java:68) at com.atlassian.jira.config.component.DelegatingInvocationHandler.invoke(DelegatingInvocationHandler.java:27) at $Proxy4.execute(Unknown Source) at com.atlassian.jira.web.action.issue.IssueNavigator.getBrowsableItems(IssueNavigator.java:531) at com.atlassian.jira.web.action.issue.IssueNavigator.doExecute(IssueNavigator.java:412) at webwork.action.ActionSupport.execute(ActionSupport.java:151) at com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:46) at webwork.dispatcher.GenericDispatcher.executeAction(GenericDispatcher.java:131) at com.atlassian.jira.web.dispatcher.JiraServletDispatcher.service(JiraServletDispatcher.java:186) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:142) at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:58) at com.atlassian.jira.web.filters.SitemeshExcludePathFilter.doFilter(SitemeshExcludePathFilter.java:36) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at com.atlassian.seraph.filter.SecurityFilter.doFilter(SecurityFilter.java:168) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at com.atlassian.seraph.filter.LoginFilter.doFilter(LoginFilter.java:181) This is with quite normal values: mysql> select * from customfieldvalue; +-------+-------+-------------+-----------+-----------+-------------+-------------+-----------+-----------+ | ID | ISSUE | CUSTOMFIELD | PARENTKEY | VALUETYPE | STRINGVALUE | NUMBERVALUE | TEXTVALUE | DATEVALUE | +-------+-------+-------------+-----------+-----------+-------------+-------------+-----------+-----------+ | 10000 | 10000 | 10000 | NULL | NULL | NULL | 1.000000 | NULL | NULL | | 10001 | 10001 | 10000 | NULL | NULL | NULL | 2.000000 | NULL | NULL | +-------+-------+-------------+-----------+-----------+-------------+-------------+-----------+-----------+
    via by Jeff Turner,
    • java.lang.ClassCastException at com.atlassian.jira.issue.customfields.impl.NumberCFType.compare(NumberCFType.java:41) at com.atlassian.jira.issue.fields.CustomFieldImpl.compare(CustomFieldImpl.java:353) at com.atlassian.jira.issue.comparator.IssueCustomFieldComparator.compare(IssueCustomFieldComparator.java:55) at org.apache.commons.collections.comparators.ComparatorChain.compare(Unknown Source) at java.util.Arrays.mergeSort(Arrays.java:1278) at java.util.Arrays.sort(Arrays.java:1219) at java.util.Collections.sort(Collections.java:155) at com.atlassian.jira.issue.search.providers.DefaultSearchProvider.search(DefaultSearchProvider.java:63) at com.atlassian.jira.issue.managers.DefaultIssueManager.execute(DefaultIssueManager.java:231) at com.atlassian.jira.issue.managers.CachingIssueManager.execute(CachingIssueManager.java:99) 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:324) at com.atlassian.util.profiling.object.ObjectProfiler.profiledInvoke(ObjectProfiler.java:68) at com.atlassian.jira.config.component.DelegatingInvocationHandler.invoke(DelegatingInvocationHandler.java:27) at $Proxy4.execute(Unknown Source) at com.atlassian.jira.web.action.issue.IssueNavigator.getBrowsableItems(IssueNavigator.java:531) at com.atlassian.jira.web.action.issue.IssueNavigator.doExecute(IssueNavigator.java:412) at webwork.action.ActionSupport.execute(ActionSupport.java:151) at com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:46) at webwork.dispatcher.GenericDispatcher.executeAction(GenericDispatcher.java:131) at com.atlassian.jira.web.dispatcher.JiraServletDispatcher.service(JiraServletDispatcher.java:186) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:142) at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:58) at com.atlassian.jira.web.filters.SitemeshExcludePathFilter.doFilter(SitemeshExcludePathFilter.java:36) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at com.atlassian.seraph.filter.SecurityFilter.doFilter(SecurityFilter.java:168) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at com.atlassian.seraph.filter.LoginFilter.doFilter(LoginFilter.java:181)
    No Bugmate found.