java.lang.ClassCastException: java.lang.String cannot be cast to main.java.example2.Person

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

    java.lang.String cannot be cast to main.java.example.Person

    Stack Overflow | 6 months ago | Oleksandr Spodin
    java.lang.ClassCastException: java.lang.String cannot be cast to main.java.example2.Person

    Root Cause Analysis

    1. java.lang.ClassCastException

      java.lang.String cannot be cast to main.java.example2.Person

      at main.java.example2.CassandraApp.main()
    2. main.java.example2
      CassandraApp.main
      1. main.java.example2.CassandraApp.main(CassandraApp.java:40)
      1 frame
    3. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:498)
      4 frames
    4. IDEA
      AppMain.main
      1. com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
      1 frame