java.lang.ClassCastException: net.fortuna.ical4j.model.property.Uid cannot be cast to java.lang.Comparable

Apereo Issues | Drew Wills | 6 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

    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
  2. 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
  3. 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
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 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

    Root Cause Analysis

    1. java.lang.ClassCastException

      net.fortuna.ical4j.model.property.Uid 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:486)
      2. org.apache.commons.lang.builder.CompareToBuilder.append(CompareToBuilder.java:415)
      2 frames
    3. org.jasig.portlet
      JsonCalendarEvent.compareTo
      1. org.jasig.portlet.calendar.mvc.JsonCalendarEvent.compareTo(JsonCalendarEvent.java:174)
      2. org.jasig.portlet.calendar.mvc.JsonCalendarEvent.compareTo(JsonCalendarEvent.java:36)
      2 frames
    4. Java RT
      TreeSet.addAll
      1. java.util.TreeMap.put(TreeMap.java:545)
      2. java.util.TreeSet.add(TreeSet.java:238)
      3. java.util.AbstractCollection.addAll(AbstractCollection.java:305)
      4. java.util.TreeSet.addAll(TreeSet.java:295)
      4 frames
    5. org.jasig.portlet
      AjaxCalendarController.getEventList
      1. org.jasig.portlet.calendar.mvc.controller.AjaxCalendarController.getEventList(AjaxCalendarController.java:163)
      1 frame
    6. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:597)
      4 frames
    7. Spring
      HandlerMethodInvoker.invokeHandlerMethod
      1. org.springframework.web.bind.annotation.support.HandlerMethodInvoker.doInvokeMethod(HandlerMethodInvoker.java:421)
      2. org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:136)
      2 frames
    8. Spring Web Portlet
      FrameworkPortlet.processAction
      1. org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:271)
      2. org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter.doHandle(AnnotationMethodHandlerAdapter.java:259)
      3. org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter.handleAction(AnnotationMethodHandlerAdapter.java:210)
      4. org.springframework.web.portlet.DispatcherPortlet.doActionService(DispatcherPortlet.java:694)
      5. org.springframework.web.portlet.FrameworkPortlet.processRequest(FrameworkPortlet.java:480)
      6. org.springframework.web.portlet.FrameworkPortlet.processAction(FrameworkPortlet.java:462)
      6 frames
    9. Pluto Portlet Container
      PortletServlet.doPost
      1. org.apache.pluto.core.PortletServlet.dispatch(PortletServlet.java:218)
      2. org.apache.pluto.core.PortletServlet.doPost(PortletServlet.java:145)
      2 frames
    10. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
      2. javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      2 frames
    11. Glassfish Core
      ApplicationDispatcher.include
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      3. org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
      4. org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:535)
      5. org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:472)
      5 frames
    12. Pluto Portlet Container
      PortletContainerImpl.doAction
      1. org.apache.pluto.core.DefaultPortletInvokerService.invoke(DefaultPortletInvokerService.java:167)
      2. org.apache.pluto.core.DefaultPortletInvokerService.action(DefaultPortletInvokerService.java:85)
      3. org.apache.pluto.core.PortletContainerImpl.doAction(PortletContainerImpl.java:217)
      3 frames
    13. org.jasig.portal
      BaseTask.run
      1. org.jasig.portal.portlet.rendering.PortletRendererImpl.doAction(PortletRendererImpl.java:184)
      2. org.jasig.portal.channels.portlet.SpringPortletChannelImpl.action(SpringPortletChannelImpl.java:261)
      3. org.jasig.portal.channels.portlet.CSpringPortletAdaptor.processAction(CSpringPortletAdaptor.java:155)
      4. org.jasig.portal.ChannelRenderer$Worker.execute(ChannelRenderer.java:524)
      5. org.jasig.portal.utils.threading.BaseTask.run(BaseTask.java:41)
      5 frames
    14. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor198.invoke(Unknown Source)
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      3. java.lang.reflect.Method.invoke(Method.java:597)
      3 frames
    15. 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
    16. Spring ORM
      JpaInterceptor.invoke
      1. org.springframework.orm.jpa.JpaInterceptor.invoke(JpaInterceptor.java:96)
      1 frame
    17. 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
    18. org.jasig.portal
      $Proxy196.run
      1. org.jasig.portal.$Proxy196.run(Unknown Source)
      1 frame
    19. Java RT
      Thread.run
      1. java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      2. java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      3. java.util.concurrent.FutureTask.run(FutureTask.java:138)
      4. java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      5. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      6. java.lang.Thread.run(Thread.java:619)
      6 frames