java.lang.ClassCastException: MyOwnClass cannot be cast to java.lang.Comparable

Coderanch | Laythe Chamse | 7 years ago
  1. 0

    why do i get TreeSet RuntimeException with my code?

    Coderanch | 7 years ago | Laythe Chamse
    java.lang.ClassCastException: MyOwnClass cannot be cast to java.lang.Comparable
  2. 0

    can StringBuffer objects be keys in TreeSet in Java?

    Stack Overflow | 3 years ago | eagertoLearn
    java.lang.ClassCastException: java.lang.StringBuffer cannot be cast to java.lang.Comparable
  3. 0

    making a binary search tree throws an exception

    Stack Overflow | 6 years ago | user472221
    java.lang.ClassCastException: OBST.Element cannot be cast to java.lang.Comparable
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Returning a SortedSet

    Stack Overflow | 2 years ago | Khal
    java.lang.ClassCastException: helloworld.Student cannot be cast to java.lang.Comparable
  6. 0

    [TOMEE-436] Getting SEVERE: OpenEJBContextConfig.processAnnotationsFile: failed. on Windows - ASF JIRA

    apache.org | 11 months ago
    java.lang.ClassCastException: org.apache.openejb.assembler.classic.ClassListInfo cannot be cast to java.lang.Comparable

  1. aldrinleal 2 times, last 3 months ago
3 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.ClassCastException

    MyOwnClass cannot be cast to java.lang.Comparable

    at java.util.TreeMap.put()
  2. Java RT
    TreeSet.add
    1. java.util.TreeMap.put(TreeMap.java:542)
    2. java.util.TreeSet.add(TreeSet.java:238)
    2 frames
  3. Unknown
    MyTreeSet.main
    1. MyTreeSet.main(MyTreeSet.java:21)
    1 frame