classification.Status

Hibernate JIRA | Hao Chen | 1 decade ago
  1. 0

    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

    Hibernate JIRA | 1 decade ago | Hao Chen
    classification.Status
  2. 0

    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

    Hibernate JIRA | 1 decade ago | Hao Chen
    classification.Status
  3. 0

    Hibernate + composite primary keys

    theserverside.com | 6 months ago
    net.sf.hibernate.MappingException: Error reading resource: com/auctioninfo/model/Person.hbm.xml
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    exception 1 « Exception « JPA Q&A

    java2s.com | 2 months ago
    net.sf.hibernate.MappingException: Error reading resource: equicom/offline/transmission/Transmission.hbm.xml
  6. 0

    <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"> <hibernate-mapping schema="pkr"> <class name="edu.sdsc.pkr.orm.pkr.ProteinSequence" table="protein_sequences" > <id name="proteinSequenceId" column="protein_sequence_id" type="java.lang.Long" unsaved-value="null"> <generator class="assigned"/> </id> <property name="sequence" column="sequence" type="java.lang.TextType" not-null="true" unique="true" /> </class> </hibernate-mapping> ##The error is in the mapping in in line: -- name="sequence" column="sequence" type="java.lang.TextType" ##which should be ++name="sequence" column="sequence" type="net.sf.hibernate.type.TextType" But the error message "net.sf.hibernate.MappingException: duplicate import: ProteinSequence" is rather misleading. I believe a similar error was addressed in last release 2.1.1 <http://sourceforge.net/project/shownotes.php?group_id=40712&release_id=214960> <quote> * fixed a problem where mapping validation failure was reported as duplicate import (Michael Gloegl)"</quote> 11:53:35,323 INFO Environment:462 - Hibernate 2.1.2 11:53:35,390 INFO Environment:491 - hibernate.properties not found 11:53:35,412 INFO Environment:519 - using CGLIB reflection optimizer 11:53:35,428 INFO Configuration:854 - configuring from resource: /hibernate.cfg.xml 11:53:35,429 INFO Configuration:826 - Configuration resource: /hibernate.cfg.xml 11:53:38,080 INFO Configuration:311 - Mapping resource: edu/sdsc/pkr/orm/pkr/MasterSource.hbm.xml 11:53:38,318 INFO Binder:229 - Mapping class: edu.sdsc.pkr.orm.pkr.MasterSource -> master_source 11:53:38,407 INFO Configuration:311 - Mapping resource: edu/sdsc/pkr/orm/pkr/ProteinSequence.hbm.xml 11:53:38,671 INFO Binder:229 - Mapping class: edu.sdsc.pkr.orm.pkr.ProteinSequence -> protein_sequences 11:53:38,688 ERROR Configuration:252 - Could not compile the mapping document net.sf.hibernate.MappingException: Could not interpret type: java.lang.TextType at net.sf.hibernate.cfg.Binder.getTypeFromXML(Binder.java:910) at net.sf.hibernate.cfg.Binder.bindSimpleValue(Binder.java:411) at net.sf.hibernate.cfg.Binder.propertiesFromXML(Binder.java:1023) at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:352) at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1229) at net.sf.hibernate.cfg.Configuration.add(Configuration.java:249) at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:285) at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:315) at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:973) at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:928) at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:856) at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:842) at edu.sdsc.pkr.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:8) at edu.sdsc.pkr.struts.ActionWithHbmSession.getSession(ActionWithHbmSession.java:33) at edu.sdsc.pkr.test.testPkrEntry.main(testPkrEntry.java:54) 11:53:38,807 INFO Configuration:311 - Mapping resource: edu/sdsc/pkr/orm/pkr/ProteinSequence.hbm.xml 11:53:39,045 ERROR Configuration:252 - Could not compile the mapping document net.sf.hibernate.MappingException: duplicate import: ProteinSequence at net.sf.hibernate.cfg.Mappings.addImport(Mappings.java:85) at net.sf.hibernate.cfg.Binder.bindClass(Binder.java:126) at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:221) at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1229) at net.sf.hibernate.cfg.Configuration.add(Configuration.java:249) at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:285) at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:315) at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:976) at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:928) at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:856) at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:842) at edu.sdsc.pkr.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:8) at edu.sdsc.pkr.struts.ActionWithHbmSession.getSession(ActionWithHbmSession.java:33) at edu.sdsc.pkr.test.testPkrEntry.main(testPkrEntry.java:54) Exception in thread "main" java.lang.ExceptionInInitializerError at edu.sdsc.pkr.struts.ActionWithHbmSession.getSession(ActionWithHbmSession.java:33) at edu.sdsc.pkr.test.testPkrEntry.main(testPkrEntry.java:54) Caused by: java.lang.RuntimeException: Exception building SessionFactory: Error reading resource: edu/sdsc/pkr/orm/pkr/ProteinSequence.hbm.xml at edu.sdsc.pkr.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:11) ... 2 more Caused by: net.sf.hibernate.MappingException: Error reading resource: edu/sdsc/pkr/orm/pkr/ProteinSequence.hbm.xml at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:318) at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:976) at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:928) at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:856) at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:842) at edu.sdsc.pkr.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:8) ... 2 more Caused by: net.sf.hibernate.MappingException: duplicate import: ProteinSequence at net.sf.hibernate.cfg.Mappings.addImport(Mappings.java:85) at net.sf.hibernate.cfg.Binder.bindClass(Binder.java:126) at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:221) at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1229) at net.sf.hibernate.cfg.Configuration.add(Configuration.java:249) at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:285) at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:315) ... 7 more

    Hibernate JIRA | 1 decade ago | R. Hannes Niedner
    net.sf.hibernate.MappingException: Could not interpret type: java.lang.TextType

    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. net.sf.hibernate.MappingException

      Could not interpret type: classification.Status

      at net.sf.hibernate.cfg.Binder.getTypeFromXML()
    2. net.sf.hibernate
      Configuration.addClass
      1. net.sf.hibernate.cfg.Binder.getTypeFromXML(Binder.java:769)
      2. net.sf.hibernate.cfg.Binder.bindValue(Binder.java:348)
      3. net.sf.hibernate.cfg.Binder.propertiesFromXML(Binder.java:872)
      4. net.sf.hibernate.cfg.Binder.bindSubclass(Binder.java:123)
      5. net.sf.hibernate.cfg.Binder.propertiesFromXML(Binder.java:882)
      6. net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:288)
      7. net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1076)
      8. net.sf.hibernate.cfg.Configuration.add(Configuration.java:230)
      9. net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:252)
      10. net.sf.hibernate.cfg.Configuration.addClass(Configuration.java:286)
      10 frames
    3. FitNesse
      HibernateUtil.main
      1. util.HibernateUtil.getSessionFactory(HibernateUtil.java:29)
      2. util.HibernateUtil.main(HibernateUtil.java:53)
      2 frames