javax.persistence.PersistenceException: java.lang.ClassCastException: $Proxy0

Hibernate JIRA | Levi Purvis | 1 decade ago
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

    Hibernate / Mailing Lists

    sourceforge.net | 1 year ago
    javax.persistence.PersistenceException: java.lang.ClassCastException: $Proxy0
  2. 0

    Hibernate / Mailing Lists

    sourceforge.net | 10 months ago
    javax.persistence.PersistenceException: java.lang.ClassCastException: $Proxy0
  3. 0

    Using a <mapped-superclass> element in orm.xml will generate the following exception: javax.persistence.PersistenceException: java.lang.ClassCastException: $Proxy0 at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:217) at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:114) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:27) ...... Caused by: java.lang.ClassCastException: $Proxy0 at org.hibernate.reflection.java.EJB3OverridenAnnotationReader.getMappedSuperclass(EJB3OverridenAnnotationReader.java:1688) at org.hibernate.reflection.java.EJB3OverridenAnnotationReader.initAnnotations(EJB3OverridenAnnotationReader.java:285) at org.hibernate.reflection.java.EJB3OverridenAnnotationReader.isAnnotationPresent(EJB3OverridenAnnotationReader.java:257) at org.hibernate.reflection.java.JavaXAnnotatedElement.isAnnotationPresent(JavaXAnnotatedElement.java:40) at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:237) at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1034) at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1015) at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:154) at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:751) at org.hibernate.ejb.Ejb3Configuration.createFactory(Ejb3Configuration.java:151) at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:205) ... 19 more Also see the following thread: http://forum.hibernate.org/viewtopic.php?t=960744

    Hibernate JIRA | 1 decade ago | Levi Purvis
    javax.persistence.PersistenceException: java.lang.ClassCastException: $Proxy0
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Using a <mapped-superclass> element in orm.xml will generate the following exception: javax.persistence.PersistenceException: java.lang.ClassCastException: $Proxy0 at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:217) at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:114) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:27) ...... Caused by: java.lang.ClassCastException: $Proxy0 at org.hibernate.reflection.java.EJB3OverridenAnnotationReader.getMappedSuperclass(EJB3OverridenAnnotationReader.java:1688) at org.hibernate.reflection.java.EJB3OverridenAnnotationReader.initAnnotations(EJB3OverridenAnnotationReader.java:285) at org.hibernate.reflection.java.EJB3OverridenAnnotationReader.isAnnotationPresent(EJB3OverridenAnnotationReader.java:257) at org.hibernate.reflection.java.JavaXAnnotatedElement.isAnnotationPresent(JavaXAnnotatedElement.java:40) at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:237) at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1034) at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1015) at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:154) at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:751) at org.hibernate.ejb.Ejb3Configuration.createFactory(Ejb3Configuration.java:151) at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:205) ... 19 more Also see the following thread: http://forum.hibernate.org/viewtopic.php?t=960744

    Hibernate JIRA | 1 decade ago | Levi Purvis
    javax.persistence.PersistenceException: java.lang.ClassCastException: $Proxy0
  6. 0

    How to use datasource for Hibernate Entity Manager

    Coderanch | 9 years ago | Pramod Kumar
    javax.persistence.PersistenceException: org.hibernate.HibernateException: Could not find datasource

    4 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. javax.persistence.PersistenceException

      java.lang.ClassCastException: $Proxy0

      at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory()
    2. Hibernate EJB
      HibernatePersistence.createEntityManagerFactory
      1. org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:217)
      2. org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:114)
      2 frames
    3. JavaEE 7
      Persistence.createEntityManagerFactory
      1. javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37)
      2. javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:27)
      2 frames