net.sf.hibernate.MappingException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • exception 1 « Exception « JPA Q&A
    via by Unknown author,
  • A super class has a field whose type is a subclass. Looks like Hibernate failed to load the subclass because the super class has not been initialized. Can we have a better algorithm to deal with this situation? ============================================================== My configurations: <hibernate-mapping> <class name="BaseEntity" dynamic-update="false" dynamic-insert="false" > <id name="id" column="id" type="java.lang.Long"> <generator class="native"> </generator> </id> <property name="name" type="java.lang.String" update="true" insert="true" column="name" length="100" not-null="true" /> <subclass name="resource.BaseResource" dynamic-update="false" dynamic-insert="false" > <property name="description" type="java.lang.String" update="true" insert="true" column="description" length="300" not-null="true" /> <property name="status" type="classification.Status" update="true" insert="true" column="status" not-null="true" /> ... <subclass name="classification.Status" dynamic-update="false" dynamic-insert="false" > <property name="description" type="java.lang.String" update="true" insert="true" column="description" length="100" not-null="true" /> </subclass> </subclass> </class> </hibernate-mapping> ================================================================================ INFO - Mapping subclass: resource.BaseResource -> BaseEntity DEBUG - Mapped property: description -> description, type: string ERROR - Could not compile the mapping document net.sf.hibernate.MappingException: Could not interpret type: classification.Status at net.sf.hibernate.cfg.Binder.getTypeFromXML(Binder.java:769) at net.sf.hibernate.cfg.Binder.bindValue(Binder.java:348) at net.sf.hibernate.cfg.Binder.propertiesFromXML(Binder.java:872) at net.sf.hibernate.cfg.Binder.bindSubclass(Binder.java:123) at net.sf.hibernate.cfg.Binder.propertiesFromXML(Binder.java:882) at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:288) at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1076) at net.sf.hibernate.cfg.Configuration.add(Configuration.java:230) at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:252) at net.sf.hibernate.cfg.Configuration.addClass(Configuration.java:286) at util.HibernateUtil.getSessionFactory(HibernateUtil.java:29) at util.HibernateUtil.main(HibernateUtil.java:53) Exception in thread "main" exception.SystemException: net.sf.hibernate.MappingException: Could not int erpret type: classification.Status at util.HibernateUtil.getSessionFactory(HibernateUtil.java:43) at util.HibernateUtil.main(HibernateUtil.java:53) Caused by: net.sf.hibernate.MappingException: Could not interpret type: classification.Status at net.sf.hibernate.cfg.Binder.getTypeFromXML(Binder.java:769) at net.sf.hibernate.cfg.Binder.bindValue(Binder.java:348) at net.sf.hibernate.cfg.Binder.propertiesFromXML(Binder.java:872) at net.sf.hibernate.cfg.Binder.bindSubclass(Binder.java:123) at net.sf.hibernate.cfg.Binder.propertiesFromXML(Binder.java:882) at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:288) at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1076) at net.sf.hibernate.cfg.Configuration.add(Configuration.java:230) at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:252) at net.sf.hibernate.cfg.Configuration.addClass(Configuration.java:286) at util.HibernateUtil.getSessionFactory(HibernateUtil.java:29) ... 1 more
    via by Hao Chen,
  • Hibernate + composite primary keys
    via by Unknown author,
  • A super class has a field whose type is a subclass. Looks like Hibernate failed to load the subclass because the super class has not been initialized. Can we have a better algorithm to deal with this situation? ============================================================== My configurations: <hibernate-mapping> <class name="BaseEntity" dynamic-update="false" dynamic-insert="false" > <id name="id" column="id" type="java.lang.Long"> <generator class="native"> </generator> </id> <property name="name" type="java.lang.String" update="true" insert="true" column="name" length="100" not-null="true" /> <subclass name="resource.BaseResource" dynamic-update="false" dynamic-insert="false" > <property name="description" type="java.lang.String" update="true" insert="true" column="description" length="300" not-null="true" /> <property name="status" type="classification.Status" update="true" insert="true" column="status" not-null="true" /> ... <subclass name="classification.Status" dynamic-update="false" dynamic-insert="false" > <property name="description" type="java.lang.String" update="true" insert="true" column="description" length="100" not-null="true" /> </subclass> </subclass> </class> </hibernate-mapping> ================================================================================ INFO - Mapping subclass: resource.BaseResource -> BaseEntity DEBUG - Mapped property: description -> description, type: string ERROR - Could not compile the mapping document net.sf.hibernate.MappingException: Could not interpret type: classification.Status at net.sf.hibernate.cfg.Binder.getTypeFromXML(Binder.java:769) at net.sf.hibernate.cfg.Binder.bindValue(Binder.java:348) at net.sf.hibernate.cfg.Binder.propertiesFromXML(Binder.java:872) at net.sf.hibernate.cfg.Binder.bindSubclass(Binder.java:123) at net.sf.hibernate.cfg.Binder.propertiesFromXML(Binder.java:882) at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:288) at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1076) at net.sf.hibernate.cfg.Configuration.add(Configuration.java:230) at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:252) at net.sf.hibernate.cfg.Configuration.addClass(Configuration.java:286) at util.HibernateUtil.getSessionFactory(HibernateUtil.java:29) at util.HibernateUtil.main(HibernateUtil.java:53) Exception in thread "main" exception.SystemException: net.sf.hibernate.MappingException: Could not int erpret type: classification.Status at util.HibernateUtil.getSessionFactory(HibernateUtil.java:43) at util.HibernateUtil.main(HibernateUtil.java:53) Caused by: net.sf.hibernate.MappingException: Could not interpret type: classification.Status at net.sf.hibernate.cfg.Binder.getTypeFromXML(Binder.java:769) at net.sf.hibernate.cfg.Binder.bindValue(Binder.java:348) at net.sf.hibernate.cfg.Binder.propertiesFromXML(Binder.java:872) at net.sf.hibernate.cfg.Binder.bindSubclass(Binder.java:123) at net.sf.hibernate.cfg.Binder.propertiesFromXML(Binder.java:882) at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:288) at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1076) at net.sf.hibernate.cfg.Configuration.add(Configuration.java:230) at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:252) at net.sf.hibernate.cfg.Configuration.addClass(Configuration.java:286) at util.HibernateUtil.getSessionFactory(HibernateUtil.java:29) ... 1 more
    via by Hao Chen,
  • hibernate.MappingException
    via by Karthik Vijayarajan,
  • hibernate.MappingException
    via by Bhushan Garud,
  • hibernate MappingException: duplicate import
    via by Isaac Kwame,
  • Hibernate + Configuration.addClass Exception
    via by Steve Press,
    • net.sf.hibernate.MappingException: Error reading resource: equicom/offline/transmission/Transmission.hbm.xml at net.sf.hibernate.cfg.Configuration.addClass(Configuration.java:336) at com.equifax.persistence.PersistenceSession.init(PersistenceSession.java:201)
    No Bugmate found.