org.hibernate.MappingException: Following superclasses referenced in extends not found: EntityHasName

Hibernate JIRA | Stefan Wachter | 1 decade ago
  1. 0

    The following mapping yields an exception: <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping> <class lazy="true" entity-name="EntityHasName" table="F5_ENTITY_HASNAME"> <id name="id" column="ID" type="long"> <generator class="native"/> </id> <property name="attrName" type="string"> <column name="NAME"/> </property> </class> <joined-subclass lazy="true" entity-name="EntityCompany" table="F5_ENTITY_COMPANY" extends="EntityHasName"> <key column="REF_ID"/> </joined-subclass> </hibernate-mapping> org.hibernate.MappingException: Following superclasses referenced in extends not found: EntityHasName at org.hibernate.cfg.Configuration.processExtendsQueue(Configuration.java:918) at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:852) at org.hibernate.cfg.Configuration.generateDropSchemaScript(Configuration.java:586) at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:64) at org.hibernate.tool.hbm2ddl.SchemaExportTask.getSchemaExport(SchemaExportTask.java:210) at org.hibernate.tool.hbm2ddl.SchemaExportTask.execute(SchemaExportTask.java:136) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) at org.apache.tools.ant.Task.perform(Task.java:364) at org.apache.tools.ant.Target.execute(Target.java:341) at org.apache.tools.ant.Target.performTasks(Target.java:369) at org.apache.tools.ant.Project.executeTarget(Project.java:1214) at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:386) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) at org.apache.tools.ant.Task.perform(Task.java:364) at org.apache.tools.ant.Target.execute(Target.java:341) at org.apache.tools.ant.Target.performTasks(Target.java:369) at org.apache.tools.ant.Project.executeTarget(Project.java:1214) at org.apache.tools.ant.Project.executeTargets(Project.java:1062) at org.apache.tools.ant.Main.runBuild(Main.java:673) at org.apache.tools.ant.Main.startAnt(Main.java:188) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)

    Hibernate JIRA | 1 decade ago | Stefan Wachter
    org.hibernate.MappingException: Following superclasses referenced in extends not found: EntityHasName
  2. 0

    The following mapping yields an exception: <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping> <class lazy="true" entity-name="EntityHasName" table="F5_ENTITY_HASNAME"> <id name="id" column="ID" type="long"> <generator class="native"/> </id> <property name="attrName" type="string"> <column name="NAME"/> </property> </class> <joined-subclass lazy="true" entity-name="EntityCompany" table="F5_ENTITY_COMPANY" extends="EntityHasName"> <key column="REF_ID"/> </joined-subclass> </hibernate-mapping> org.hibernate.MappingException: Following superclasses referenced in extends not found: EntityHasName at org.hibernate.cfg.Configuration.processExtendsQueue(Configuration.java:918) at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:852) at org.hibernate.cfg.Configuration.generateDropSchemaScript(Configuration.java:586) at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:64) at org.hibernate.tool.hbm2ddl.SchemaExportTask.getSchemaExport(SchemaExportTask.java:210) at org.hibernate.tool.hbm2ddl.SchemaExportTask.execute(SchemaExportTask.java:136) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) at org.apache.tools.ant.Task.perform(Task.java:364) at org.apache.tools.ant.Target.execute(Target.java:341) at org.apache.tools.ant.Target.performTasks(Target.java:369) at org.apache.tools.ant.Project.executeTarget(Project.java:1214) at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:386) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) at org.apache.tools.ant.Task.perform(Task.java:364) at org.apache.tools.ant.Target.execute(Target.java:341) at org.apache.tools.ant.Target.performTasks(Target.java:369) at org.apache.tools.ant.Project.executeTarget(Project.java:1214) at org.apache.tools.ant.Project.executeTargets(Project.java:1062) at org.apache.tools.ant.Main.runBuild(Main.java:673) at org.apache.tools.ant.Main.startAnt(Main.java:188) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)

    Hibernate JIRA | 1 decade ago | Stefan Wachter
    org.hibernate.MappingException: Following superclasses referenced in extends not found: EntityHasName
  3. 0

    To reproduce this issue you need to: a) Load some hbm files using the AnnotationConfiguration b) Use a subclass reference referring to a class in a separate file via the "extends" attribute in your hbm files What happens is that you will get an exception from the buildSessionFactory call on AnnotationConfiguration similar to the following: org.hibernate.MappingException: Following superclasses referenced in extends not found: org.gs1.v202.gdsn.RegistryPartyDataDumpType at org.hibernate.cfg.Configuration.processExtendsQueue(Configuration.java:1077) at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1016) at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:218) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1138) A simple workaround is to use the base Configuration class rather than the AnnotationConfiguration. However, this is not practical if you need to load a mix of existing hbm files as well as new classes that use annotations. The reason that this occurs is that the AnnotationConfiguration class overrides the add method of Configuration, storing all of the hbm files in a Map for later processing. This works fine for regular class files; however, it is not compatible with the recursive hbm file processing performed by processExtendsQueue. I've attached a fix for this issue that disables the delayed hbm processing before processing of the extends queue begins. This modification fixes this issue in the unit tests of the application I am working on. Please see the attached java file that includes the integrated fix built off the latest CVS version, as well as the unified diff I created via CVS. I would appreciate it if this fix could be rolled into the upcoming 3.1beta7, and would be happy to help out with whatever documentation or unit tests are needed for final integration. Cheers, --Steve

    Hibernate JIRA | 1 decade ago | Stephen Chin
    org.hibernate.MappingException: Following superclasses referenced in extends not found: org.gs1.v202.gdsn.RegistryPartyDataDumpType
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    To reproduce this issue you need to: a) Load some hbm files using the AnnotationConfiguration b) Use a subclass reference referring to a class in a separate file via the "extends" attribute in your hbm files What happens is that you will get an exception from the buildSessionFactory call on AnnotationConfiguration similar to the following: org.hibernate.MappingException: Following superclasses referenced in extends not found: org.gs1.v202.gdsn.RegistryPartyDataDumpType at org.hibernate.cfg.Configuration.processExtendsQueue(Configuration.java:1077) at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1016) at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:218) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1138) A simple workaround is to use the base Configuration class rather than the AnnotationConfiguration. However, this is not practical if you need to load a mix of existing hbm files as well as new classes that use annotations. The reason that this occurs is that the AnnotationConfiguration class overrides the add method of Configuration, storing all of the hbm files in a Map for later processing. This works fine for regular class files; however, it is not compatible with the recursive hbm file processing performed by processExtendsQueue. I've attached a fix for this issue that disables the delayed hbm processing before processing of the extends queue begins. This modification fixes this issue in the unit tests of the application I am working on. Please see the attached java file that includes the integrated fix built off the latest CVS version, as well as the unified diff I created via CVS. I would appreciate it if this fix could be rolled into the upcoming 3.1beta7, and would be happy to help out with whatever documentation or unit tests are needed for final integration. Cheers, --Steve

    Hibernate JIRA | 1 decade ago | Stephen Chin
    org.hibernate.MappingException: Following superclasses referenced in extends not found: org.gs1.v202.gdsn.RegistryPartyDataDumpType

    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. org.hibernate.MappingException

      Following superclasses referenced in extends not found: EntityHasName

      at org.hibernate.cfg.Configuration.processExtendsQueue()
    2. Hibernate
      SchemaExportTask.execute
      1. org.hibernate.cfg.Configuration.processExtendsQueue(Configuration.java:919)
      2. org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:853)
      3. org.hibernate.cfg.Configuration.generateDropSchemaScript(Configuration.java:587)
      4. org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:64)
      5. org.hibernate.tool.hbm2ddl.SchemaExportTask.getSchemaExport(SchemaExportTask.java:210)
      6. org.hibernate.tool.hbm2ddl.SchemaExportTask.execute(SchemaExportTask.java:136)
      6 frames
    3. Ant
      Main.startAnt
      1. org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
      2. org.apache.tools.ant.Task.perform(Task.java:364)
      3. org.apache.tools.ant.Target.execute(Target.java:341)
      4. org.apache.tools.ant.Target.performTasks(Target.java:369)
      5. org.apache.tools.ant.Project.executeTarget(Project.java:1214)
      6. org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:386)
      7. org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
      8. org.apache.tools.ant.Task.perform(Task.java:364)
      9. org.apache.tools.ant.Target.execute(Target.java:341)
      10. org.apache.tools.ant.Target.performTasks(Target.java:369)
      11. org.apache.tools.ant.Project.executeTarget(Project.java:1214)
      12. org.apache.tools.ant.Project.executeTargets(Project.java:1062)
      13. org.apache.tools.ant.Main.runBuild(Main.java:673)
      14. org.apache.tools.ant.Main.startAnt(Main.java:188)
      14 frames
    4. Apache Ant Launcher
      Launcher.main
      1. org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
      2. org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
      2 frames