Incorrectly trying to cast an object of one type to another

java.lang.ClassCastException
Javadoc
Thrown to indicate that the code has attempted to cast an object to a subclass of which it is not an instance. For example, the following code generates a ClassCastException:
    Object x = new Integer(0);
    System.out.println((String)x);
@author unascribed @since JDK1.0
at com.mysql.jdbc.ConnectionImpl.buildCollationMapping
(source)

Typical Exception Messages

  1. java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long
  2. Unexpected error when trying to create the tpcc database
  3. java.math.BigInteger cannot be cast to java.lang.Long

Specific cases

External results for this pattern (10)

  1. DreamingInLifevia GitHub2 months ago
    java.math.BigInteger cannot be cast to java.lang.Long
    Show stack trace
  2. M-sunaryvia GitHub2 months ago
    java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long
    Show stack trace
  3. java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long
    Show stack trace
  4. java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long
    Show stack trace
  5. Bharadwajvia Stack Overflow4 months ago
    java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long
    Show stack trace
  6. java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long
    Show stack trace
  7. Khim Reyesvia Stack Overflow5 months ago
    java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long
    Show stack trace
  8. at15via GitHub8 months ago
    Unexpected error when trying to create the tpcc database
    Show stack trace
  9. preehistvia Stack Overflow9 months ago
    java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long
    Show stack trace