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: it.cogitoweb.csi.entity.csiorelav.CsiTipoLav cannot be cast to it.cogitoweb.csi.entity.csiorelav.CsiTipoLav Its alway the same JPA class which is related to the form which is shown on the screen, it doesn\'t make sense to me why is it the same class, it seems impossible. 回答1: This happens when two different ClassLoader objects load classes with the same name. The equality of two classes in