org.hibernate.MappingException: Unable to find physical table: BoatInXml

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.

  • To reproduce this scenario you must: * be running the latest code from CVS (3.1beta6 works fine) * use an AnnotationConfiguration to load both hbm.xml and annotated classes * create a one-to-many annotation mapping to the class loaded via an hbm.xml file Note: To simplify reproducing and fixing this problem, a unit test case has been attached. The result is that on the call to buildSessionFactory, hibernate will fall into an infinite loop in the Mappings.getLogicalColumnName class (note that this class resides in the hibernate proper project, not the hibernate annotations project). If you modify the loop to properly terminate when description comes back as null, you will then get the following exception: org.hibernate.MappingException: Unable to find physical table: BoatInXml at org.hibernate.cfg.Mappings.getLogicalTableName(Mappings.java:476) at org.hibernate.cfg.Mappings.getLogicalTableName(Mappings.java:523) at org.hibernate.cfg.annotations.CollectionBinder.bindManyToManySecondPass(CollectionBinder.java:729) at org.hibernate.cfg.annotations.CollectionBinder.bindStarToManySecondPass(CollectionBinder.java:410) at org.hibernate.cfg.annotations.CollectionBinder$1.secondPass(CollectionBinder.java:371) at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:35) at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1030) at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:227) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1145) at org.hibernate.test.annotations.ConfigurationTest.testAnnReferencesHbm(ConfigurationTest.java:142) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:86) The simplest fix I could come up with was to return the physicalName in the case where no logicalName can be found. However, I don't know enough about this code to understand the implications of this change. I've attached a modified version of the Mappings.java file that seems to fix this problem, but may introduce other issues.
    via by Stephen Chin,
  • To reproduce this scenario you must: * be running the latest code from CVS (3.1beta6 works fine) * use an AnnotationConfiguration to load both hbm.xml and annotated classes * create a one-to-many annotation mapping to the class loaded via an hbm.xml file Note: To simplify reproducing and fixing this problem, a unit test case has been attached. The result is that on the call to buildSessionFactory, hibernate will fall into an infinite loop in the Mappings.getLogicalColumnName class (note that this class resides in the hibernate proper project, not the hibernate annotations project). If you modify the loop to properly terminate when description comes back as null, you will then get the following exception: org.hibernate.MappingException: Unable to find physical table: BoatInXml at org.hibernate.cfg.Mappings.getLogicalTableName(Mappings.java:476) at org.hibernate.cfg.Mappings.getLogicalTableName(Mappings.java:523) at org.hibernate.cfg.annotations.CollectionBinder.bindManyToManySecondPass(CollectionBinder.java:729) at org.hibernate.cfg.annotations.CollectionBinder.bindStarToManySecondPass(CollectionBinder.java:410) at org.hibernate.cfg.annotations.CollectionBinder$1.secondPass(CollectionBinder.java:371) at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:35) at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1030) at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:227) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1145) at org.hibernate.test.annotations.ConfigurationTest.testAnnReferencesHbm(ConfigurationTest.java:142) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:86) The simplest fix I could come up with was to return the physicalName in the case where no logicalName can be found. However, I don't know enough about this code to understand the implications of this change. I've attached a modified version of the Mappings.java file that seems to fix this problem, but may introduce other issues.
    via by Stephen Chin,
  • Hibernate mapping. Table related with other two
    via Stack Overflow by Rob
    ,
  • 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
    via by Stephen Chin,
    • org.hibernate.MappingException: Unable to find physical table: BoatInXml at org.hibernate.cfg.Mappings.getLogicalTableName(Mappings.java:476) at org.hibernate.cfg.Mappings.getLogicalTableName(Mappings.java:523) at org.hibernate.cfg.annotations.CollectionBinder.bindManyToManySecondPass(CollectionBinder.java:729) at org.hibernate.cfg.annotations.CollectionBinder.bindStarToManySecondPass(CollectionBinder.java:410) at org.hibernate.cfg.annotations.CollectionBinder$1.secondPass(CollectionBinder.java:371) at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:35) at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1030) at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:227) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1145) at org.hibernate.test.annotations.ConfigurationTest.testAnnReferencesHbm(ConfigurationTest.java:142) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:86)

    Users with the same issue

    nasimk
    nasimk4 times, last one,
    kuldeep
    kuldeep16 times, last one,
    Unknown visitor2 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    35 more bugmates