java.lang.ClassCastException: com.atlassian.bamboo.plan.PlanKey cannot be cast to java.lang.Comparable

Atlassian JIRA | Piotr Stefan Stefaniak [Atlassian] | 5 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    When user have some notifications set up the Bamboo will throw following exception when trying to view "http://localhost:8085/bamboo/profile/userNotifications.action": {noformat} java.lang.ClassCastException: com.atlassian.bamboo.plan.PlanKey cannot be cast to java.lang.Comparable at org.apache.commons.lang.builder.CompareToBuilder.append(CompareToBuilder.java:483) at org.apache.commons.lang.builder.CompareToBuilder.append(CompareToBuilder.java:412) at com.atlassian.bamboo.plan.AbstractPlan.compareTo(AbstractPlan.java:408) at com.atlassian.bamboo.plan.AbstractPlan.compareTo(AbstractPlan.java:34) at org.apache.commons.lang.builder.CompareToBuilder.append(CompareToBuilder.java:483) at org.apache.commons.lang.builder.CompareToBuilder.append(CompareToBuilder.java:412) at com.atlassian.bamboo.notification.UsersNotificationImpl.compareTo(UsersNotificationImpl.java:47) at java.util.Arrays.mergeSort(Arrays.java:1144) at java.util.Arrays.mergeSort(Arrays.java:1155) at java.util.Arrays.mergeSort(Arrays.java:1155) at java.util.Arrays.mergeSort(Arrays.java:1155) at java.util.Arrays.sort(Arrays.java:1079) at java.util.Collections.sort(Collections.java:117) at com.atlassian.bamboo.notification.NotificationManagerImpl.getNotificationRulesForUser(NotificationManagerImpl.java:285) at sun.reflect.GeneratedMethodAccessor866.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor blabla {noformat} Thing is that PlanKey doesn't implement Comparable interface, and it should, as it is called from Plan.compareTo(Plan o).

    Atlassian JIRA | 5 years ago | Piotr Stefan Stefaniak [Atlassian]
    java.lang.ClassCastException: com.atlassian.bamboo.plan.PlanKey cannot be cast to java.lang.Comparable
  2. 0

    When user have some notifications set up the Bamboo will throw following exception when trying to view "http://localhost:8085/bamboo/profile/userNotifications.action": {noformat} java.lang.ClassCastException: com.atlassian.bamboo.plan.PlanKey cannot be cast to java.lang.Comparable at org.apache.commons.lang.builder.CompareToBuilder.append(CompareToBuilder.java:483) at org.apache.commons.lang.builder.CompareToBuilder.append(CompareToBuilder.java:412) at com.atlassian.bamboo.plan.AbstractPlan.compareTo(AbstractPlan.java:408) at com.atlassian.bamboo.plan.AbstractPlan.compareTo(AbstractPlan.java:34) at org.apache.commons.lang.builder.CompareToBuilder.append(CompareToBuilder.java:483) at org.apache.commons.lang.builder.CompareToBuilder.append(CompareToBuilder.java:412) at com.atlassian.bamboo.notification.UsersNotificationImpl.compareTo(UsersNotificationImpl.java:47) at java.util.Arrays.mergeSort(Arrays.java:1144) at java.util.Arrays.mergeSort(Arrays.java:1155) at java.util.Arrays.mergeSort(Arrays.java:1155) at java.util.Arrays.mergeSort(Arrays.java:1155) at java.util.Arrays.sort(Arrays.java:1079) at java.util.Collections.sort(Collections.java:117) at com.atlassian.bamboo.notification.NotificationManagerImpl.getNotificationRulesForUser(NotificationManagerImpl.java:285) at sun.reflect.GeneratedMethodAccessor866.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor blabla {noformat} Thing is that PlanKey doesn't implement Comparable interface, and it should, as it is called from Plan.compareTo(Plan o).

    Atlassian JIRA | 5 years ago | Piotr Stefan Stefaniak [Atlassian]
    java.lang.ClassCastException: com.atlassian.bamboo.plan.PlanKey cannot be cast to java.lang.Comparable
  3. 0

    The net.fortuna.ical4j.model.property.Uid class does not implement Comparable, so the apache commons CompareToBuilder & EqualsBuilder choke on them as sortable fields. WARN [org.jasig.portal.ChannelManager#153] Jan/19 13:27:19,665 controller.AjaxCalendarController.[] - Unknown Error java.lang.ClassCastException: net.fortuna.ical4j.model.property.Uid cannot be cast to java.lang.Comparable at org.apache.commons.lang.builder.CompareToBuilder.append(CompareToBuilder.java:486) at org.apache.commons.lang.builder.CompareToBuilder.append(CompareToBuilder.java:415) at org.jasig.portlet.calendar.mvc.JsonCalendarEvent.compareTo(JsonCalendarEvent.java:174) at org.jasig.portlet.calendar.mvc.JsonCalendarEvent.compareTo(JsonCalendarEvent.java:36) at java.util.TreeMap.put(TreeMap.java:545) at java.util.TreeSet.add(TreeSet.java:238) at java.util.AbstractCollection.addAll(AbstractCollection.java:305) at java.util.TreeSet.addAll(TreeSet.java:295) at org.jasig.portlet.calendar.mvc.controller.AjaxCalendarController.getEventList(AjaxCalendarController.java:163) 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 org.springframework.web.bind.annotation.support.HandlerMethodInvoker.doInvokeMethod(HandlerMethodInvoker.java:421) at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:136) at org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:271) at org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter.doHandle(AnnotationMethodHandlerAdapter.java:259) at org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter.handleAction(AnnotationMethodHandlerAdapter.java:210) at org.springframework.web.portlet.DispatcherPortlet.doActionService(DispatcherPortlet.java:694) at org.springframework.web.portlet.FrameworkPortlet.processRequest(FrameworkPortlet.java:480) at org.springframework.web.portlet.FrameworkPortlet.processAction(FrameworkPortlet.java:462) at org.apache.pluto.core.PortletServlet.dispatch(PortletServlet.java:218) at org.apache.pluto.core.PortletServlet.doPost(PortletServlet.java:145) at javax.servlet.http.HttpServlet.service(HttpServlet.java:710) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:535) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:472) at org.apache.pluto.core.DefaultPortletInvokerService.invoke(DefaultPortletInvokerService.java:167) at org.apache.pluto.core.DefaultPortletInvokerService.action(DefaultPortletInvokerService.java:85) at org.apache.pluto.core.PortletContainerImpl.doAction(PortletContainerImpl.java:217) at org.jasig.portal.portlet.rendering.PortletRendererImpl.doAction(PortletRendererImpl.java:184) at org.jasig.portal.channels.portlet.SpringPortletChannelImpl.action(SpringPortletChannelImpl.java:261) at org.jasig.portal.channels.portlet.CSpringPortletAdaptor.processAction(CSpringPortletAdaptor.java:155) at org.jasig.portal.ChannelRenderer$Worker.execute(ChannelRenderer.java:524) at org.jasig.portal.utils.threading.BaseTask.run(BaseTask.java:41) at sun.reflect.GeneratedMethodAccessor198.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.orm.jpa.JpaInterceptor.invoke(JpaInterceptor.java:96) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at org.jasig.portal.$Proxy196.run(Unknown Source) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619)

    Apereo Issues | 6 years ago | Drew Wills
    java.lang.ClassCastException: net.fortuna.ical4j.model.property.Uid cannot be cast to java.lang.Comparable
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    The net.fortuna.ical4j.model.property.Uid class does not implement Comparable, so the apache commons CompareToBuilder & EqualsBuilder choke on them as sortable fields. WARN [org.jasig.portal.ChannelManager#153] Jan/19 13:27:19,665 controller.AjaxCalendarController.[] - Unknown Error java.lang.ClassCastException: net.fortuna.ical4j.model.property.Uid cannot be cast to java.lang.Comparable at org.apache.commons.lang.builder.CompareToBuilder.append(CompareToBuilder.java:486) at org.apache.commons.lang.builder.CompareToBuilder.append(CompareToBuilder.java:415) at org.jasig.portlet.calendar.mvc.JsonCalendarEvent.compareTo(JsonCalendarEvent.java:174) at org.jasig.portlet.calendar.mvc.JsonCalendarEvent.compareTo(JsonCalendarEvent.java:36) at java.util.TreeMap.put(TreeMap.java:545) at java.util.TreeSet.add(TreeSet.java:238) at java.util.AbstractCollection.addAll(AbstractCollection.java:305) at java.util.TreeSet.addAll(TreeSet.java:295) at org.jasig.portlet.calendar.mvc.controller.AjaxCalendarController.getEventList(AjaxCalendarController.java:163) 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 org.springframework.web.bind.annotation.support.HandlerMethodInvoker.doInvokeMethod(HandlerMethodInvoker.java:421) at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:136) at org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:271) at org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter.doHandle(AnnotationMethodHandlerAdapter.java:259) at org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter.handleAction(AnnotationMethodHandlerAdapter.java:210) at org.springframework.web.portlet.DispatcherPortlet.doActionService(DispatcherPortlet.java:694) at org.springframework.web.portlet.FrameworkPortlet.processRequest(FrameworkPortlet.java:480) at org.springframework.web.portlet.FrameworkPortlet.processAction(FrameworkPortlet.java:462) at org.apache.pluto.core.PortletServlet.dispatch(PortletServlet.java:218) at org.apache.pluto.core.PortletServlet.doPost(PortletServlet.java:145) at javax.servlet.http.HttpServlet.service(HttpServlet.java:710) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:535) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:472) at org.apache.pluto.core.DefaultPortletInvokerService.invoke(DefaultPortletInvokerService.java:167) at org.apache.pluto.core.DefaultPortletInvokerService.action(DefaultPortletInvokerService.java:85) at org.apache.pluto.core.PortletContainerImpl.doAction(PortletContainerImpl.java:217) at org.jasig.portal.portlet.rendering.PortletRendererImpl.doAction(PortletRendererImpl.java:184) at org.jasig.portal.channels.portlet.SpringPortletChannelImpl.action(SpringPortletChannelImpl.java:261) at org.jasig.portal.channels.portlet.CSpringPortletAdaptor.processAction(CSpringPortletAdaptor.java:155) at org.jasig.portal.ChannelRenderer$Worker.execute(ChannelRenderer.java:524) at org.jasig.portal.utils.threading.BaseTask.run(BaseTask.java:41) at sun.reflect.GeneratedMethodAccessor198.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.orm.jpa.JpaInterceptor.invoke(JpaInterceptor.java:96) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at org.jasig.portal.$Proxy196.run(Unknown Source) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619)

    Apereo Issues | 6 years ago | Drew Wills
    java.lang.ClassCastException: net.fortuna.ical4j.model.property.Uid cannot be cast to java.lang.Comparable

    Root Cause Analysis

    1. java.lang.ClassCastException

      com.atlassian.bamboo.plan.PlanKey cannot be cast to java.lang.Comparable

      at org.apache.commons.lang.builder.CompareToBuilder.append()
    2. Commons Lang
      CompareToBuilder.append
      1. org.apache.commons.lang.builder.CompareToBuilder.append(CompareToBuilder.java:483)
      2. org.apache.commons.lang.builder.CompareToBuilder.append(CompareToBuilder.java:412)
      2 frames
    3. com.atlassian.bamboo
      AbstractPlan.compareTo
      1. com.atlassian.bamboo.plan.AbstractPlan.compareTo(AbstractPlan.java:408)
      2. com.atlassian.bamboo.plan.AbstractPlan.compareTo(AbstractPlan.java:34)
      2 frames
    4. Commons Lang
      CompareToBuilder.append
      1. org.apache.commons.lang.builder.CompareToBuilder.append(CompareToBuilder.java:483)
      2. org.apache.commons.lang.builder.CompareToBuilder.append(CompareToBuilder.java:412)
      2 frames
    5. com.atlassian.bamboo
      UsersNotificationImpl.compareTo
      1. com.atlassian.bamboo.notification.UsersNotificationImpl.compareTo(UsersNotificationImpl.java:47)
      1 frame
    6. Java RT
      Collections.sort
      1. java.util.Arrays.mergeSort(Arrays.java:1144)
      2. java.util.Arrays.mergeSort(Arrays.java:1155)
      3. java.util.Arrays.mergeSort(Arrays.java:1155)
      4. java.util.Arrays.mergeSort(Arrays.java:1155)
      5. java.util.Arrays.sort(Arrays.java:1079)
      6. java.util.Collections.sort(Collections.java:117)
      6 frames
    7. com.atlassian.bamboo
      NotificationManagerImpl.getNotificationRulesForUser
      1. com.atlassian.bamboo.notification.NotificationManagerImpl.getNotificationRulesForUser(NotificationManagerImpl.java:285)
      1 frame
    8. Java RT
      GeneratedMethodAccessor866.invoke
      1. sun.reflect.GeneratedMethodAccessor866.invoke(Unknown Source)
      1 frame