Top "Classcastexception" questions

The Java exception thrown to indicate that the code has attempted to cast an object to a subclass of which it is not an instance.

Getting class cast exception where both classes are exactly the same

I am doing a JBoss SEAM project and when I view a form I get this error. java.lang.ClassCastException: …

java classcastexception
android classcastexception on activity startup

i have a simple activity program in android. basically the class just extends Activity. But when i start it i …

android android-activity startup classcastexception
can't cast to implemented interface

i'm very confused... I have a class which directly implements an interface: public class Device implements AutocompleteResult {...} Here is proof …

java inheritance classcastexception
How to set width and height for custom view in programmatically?

I have created a custom view named MyDraw ,this is my MyDraw code, public class MyDraw extends View { public MyDraw(…

android android-layout classcastexception
java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.String

when I am running this code its giving me exception java.lang.ClassCastException: java.util.ArrayList cannot be cast to …

java hibernate classcastexception
List to TreeSet conversion produces: "java.lang.ClassCastException: MyClass cannot be cast to java.lang.Comparable"

List<MyClass> myclassList = (List<MyClass>) rs.get(); TreeSet<MyClass> myclassSet = new TreeSet<MyClass&…

java classcastexception
com.google.gson.JsonPrimitive cannot be cast to com.google.gson.JsonObject ERROR

When i try to parjse the json object from thelist i get an error com.google.gson.JsonPrimitive cannot be …

exception gson classcastexception
Why am I getting a ClassCastException when generating javadocs?

I'm using ant to generate javadocs, but get this exception over and over - why? I'm using JDK version 1.6.0_06. [javadoc] …

java ant javadoc classcastexception
ClassCastException ViewGroup$LayoutParams cannot be cast to ViewPager$LayoutParams

My initial code line is inside the overridden method onGlobalLayout(): img.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, 100)); ClassCastException occuring in …

android classcastexception