java.lang.ExceptionInInitializerError

Hibernate JIRA | harry clark | 8 years ago
  1. 0

    I have what appears to be a reprise of issue 509, about finding join columns in keys. This occurs with one to many, not many to one. It occurs on the second pass over the configuration, and varies with order, as the earlier issue. When I move the class where the issue first occurs to be the first class in the config, the error occurs in another class, also in the second pass. That is, the file which raised the exception in the first example is processed successfully in the second, apparently. I cannot reproduce this in a simple example; there is no simple example with this database, or on this server for admin reasons. I did try on MSSQL. There are ~1360 persistent classes in the ORM, and ~1100 compound key classes. This is a legacy database, obviously, but the ORM is generated from a data modeling tool which has enforced correct key relations, not a hand-written, hand-modified, buggy schema. The join columns are correct. I would very much like to eat humble pie and get on with this project, but doesn't the order variation suggest a Hibernate problem? Has Hib processed this many compound keys? Here is the stack trace. The persistent classes are in an attached file. Thanks. Initial SessionFactory creation failed.Unable to find column with logical name: THAZCD in org.hibernate.mapping.Table(DBAFREP) and its related supertables and secondary tables Exception in thread "main" java.lang.ExceptionInInitializerError at com.kve.util.HibernateUtil.<clinit>(HibernateUtil.java:1360) at com.kve.main.Main.main(Main.java:22) Caused by: org.hibernate.MappingException: Unable to find column with logical name: THAZCD in org.hibernate.mapping.Table(DBAFREP) and its related supertables and secondary tables at org.hibernate.cfg.Ejb3JoinColumn.checkReferencedColumnsType(Ejb3JoinColumn.java:396) at org.hibernate.cfg.BinderHelper.createSyntheticPropertyReference(BinderHelper.java:102) at org.hibernate.cfg.annotations.CollectionBinder.bindCollectionSecondPass(CollectionBinder.java:1321) at org.hibernate.cfg.annotations.CollectionBinder.bindOneToManySecondPass(CollectionBinder.java:654) at org.hibernate.cfg.annotations.CollectionBinder.bindStarToManySecondPass(CollectionBinder.java:589) at org.hibernate.cfg.annotations.CollectionBinder$1.secondPass(CollectionBinder.java:543) at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:66) at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1163) at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:329) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1319) at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867) at com.kve.util.HibernateUtil.<clinit>(HibernateUtil.java:1356) ... 1 more

    Hibernate JIRA | 8 years ago | harry clark
    java.lang.ExceptionInInitializerError
  2. 0

    I have what appears to be a reprise of issue 509, about finding join columns in keys. This occurs with one to many, not many to one. It occurs on the second pass over the configuration, and varies with order, as the earlier issue. When I move the class where the issue first occurs to be the first class in the config, the error occurs in another class, also in the second pass. That is, the file which raised the exception in the first example is processed successfully in the second, apparently. I cannot reproduce this in a simple example; there is no simple example with this database, or on this server for admin reasons. I did try on MSSQL. There are ~1360 persistent classes in the ORM, and ~1100 compound key classes. This is a legacy database, obviously, but the ORM is generated from a data modeling tool which has enforced correct key relations, not a hand-written, hand-modified, buggy schema. The join columns are correct. I would very much like to eat humble pie and get on with this project, but doesn't the order variation suggest a Hibernate problem? Has Hib processed this many compound keys? Here is the stack trace. The persistent classes are in an attached file. Thanks. Initial SessionFactory creation failed.Unable to find column with logical name: THAZCD in org.hibernate.mapping.Table(DBAFREP) and its related supertables and secondary tables Exception in thread "main" java.lang.ExceptionInInitializerError at com.kve.util.HibernateUtil.<clinit>(HibernateUtil.java:1360) at com.kve.main.Main.main(Main.java:22) Caused by: org.hibernate.MappingException: Unable to find column with logical name: THAZCD in org.hibernate.mapping.Table(DBAFREP) and its related supertables and secondary tables at org.hibernate.cfg.Ejb3JoinColumn.checkReferencedColumnsType(Ejb3JoinColumn.java:396) at org.hibernate.cfg.BinderHelper.createSyntheticPropertyReference(BinderHelper.java:102) at org.hibernate.cfg.annotations.CollectionBinder.bindCollectionSecondPass(CollectionBinder.java:1321) at org.hibernate.cfg.annotations.CollectionBinder.bindOneToManySecondPass(CollectionBinder.java:654) at org.hibernate.cfg.annotations.CollectionBinder.bindStarToManySecondPass(CollectionBinder.java:589) at org.hibernate.cfg.annotations.CollectionBinder$1.secondPass(CollectionBinder.java:543) at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:66) at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1163) at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:329) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1319) at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867) at com.kve.util.HibernateUtil.<clinit>(HibernateUtil.java:1356) ... 1 more

    Hibernate JIRA | 8 years ago | harry clark
    java.lang.ExceptionInInitializerError
  3. 0

    foreign key must have same number of columns as the referenced primary key for manytoone mapping

    Stack Overflow | 2 years ago | user3824049
    org.hibernate.MappingException: Foreign key (FK6D56043A4415BDB5:student [userrole])) must have same number of columns as the referenced primary key (student_details [VALUE,DESCRIPTION])
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Hibernate java web application

    Stack Overflow | 4 years ago | Arnout
    org.hibernate.MappingException: An association from the table campingsperfestival refers to an unmapped class: festivalOverview.Campings
  6. 0

    Hibernate Annotations not working for getters but working for attributes

    Stack Overflow | 6 years ago | Mann
    org.hibernate.MappingException: Could not determine type for: com.xebia.hotelBooking.domain.Customer, at table: CustomerHotelBooking, for columns: [org.hibernate.mapping.Column(customer)]

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

      Unable to find column with logical name: THAZCD in org.hibernate.mapping.Table(DBAFREP) and its related supertables and secondary tables

      at org.hibernate.cfg.Ejb3JoinColumn.checkReferencedColumnsType()
    2. Hibernate
      AnnotationConfiguration.buildSessionFactory
      1. org.hibernate.cfg.Ejb3JoinColumn.checkReferencedColumnsType(Ejb3JoinColumn.java:396)
      2. org.hibernate.cfg.BinderHelper.createSyntheticPropertyReference(BinderHelper.java:102)
      3. org.hibernate.cfg.annotations.CollectionBinder.bindCollectionSecondPass(CollectionBinder.java:1321)
      4. org.hibernate.cfg.annotations.CollectionBinder.bindOneToManySecondPass(CollectionBinder.java:654)
      5. org.hibernate.cfg.annotations.CollectionBinder.bindStarToManySecondPass(CollectionBinder.java:589)
      6. org.hibernate.cfg.annotations.CollectionBinder$1.secondPass(CollectionBinder.java:543)
      7. org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:66)
      8. org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1163)
      9. org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:329)
      10. org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1319)
      11. org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
      11 frames
    3. com.kve.util
      HibernateUtil.<clinit>
      1. com.kve.util.HibernateUtil.<clinit>(HibernateUtil.java:1356)
      1 frame
    4. com.kve.main
      Main.main
      1. com.kve.main.Main.main(Main.java:22)
      1 frame