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.

  • NavigableSet can't add different sub class
    via by Unknown author,
  • Map + Set
    via by Sted Alana,
  • When a plugin attempts to send an email notification (when a smart commit fails, say), with certain email configurations, the following exception is thrown when the email notification is processed by FishEye: {code} java.lang.ClassCastException: com.cenqua.crucible.notification.Notification cannot be cast to java.lang.Comparable at java.util.TreeMap.compare(Unknown Source) at java.util.TreeMap.put(Unknown Source) at java.util.TreeSet.add(Unknown Source) at java.util.AbstractCollection.addAll(Unknown Source) at java.util.TreeSet.addAll(Unknown Source) at java.util.TreeSet.<init>(Unknown Source) at com.cenqua.crucible.notification.batch.creators.PluginBatchCreator.getEmailSegment(PluginBatchCreator.java:50) at com.cenqua.crucible.notification.DefaultNotificationManager.getBatchMessage(DefaultNotificationManager.java:556) at com.cenqua.crucible.notification.DefaultNotificationManager.processNotification(DefaultNotificationManager.java:506) at com.cenqua.crucible.notification.DefaultNotificationManager.processNotifications(DefaultNotificationManager.java:362) at com.cenqua.crucible.notification.DefaultNotificationManager.access$200(DefaultNotificationManager.java:78) at com.cenqua.crucible.notification.DefaultNotificationManager$6.run(DefaultNotificationManager.java:289) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source) at java.util.concurrent.FutureTask.runAndReset(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) {code} This is happening because we are adding a Notification object to a TreeSet. The contract for a TreeSet is: bq. All elements inserted into the set must implement the Comparable interface. http://docs.oracle.com/javase/7/docs/api/java/util/TreeSet.html#TreeSet(java.util.SortedSet)
    via by Nick Pellow [Atlassian],
    • java.lang.ClassCastException: java.util.HashMap cannot be cast to java.lang.Comparable at java.util.TreeMap.compare(TreeMap.java:1290) at java.util.TreeMap.put(TreeMap.java:538) at java.util.TreeSet.add(TreeSet.java:255) at java.util.AbstractCollection.addAll(AbstractCollection.java:344) at java.util.TreeSet.addAll(TreeSet.java:312) at java.util.TreeSet.<init>(TreeSet.java:160)

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    odd
    1 times, last one,
    tvrmsmith
    4 times, last one,
    johnxfly
    1 times, last one,
    8 more bugmates