Uploaded image for project: 'Hibernate ORM'
  1. HHH-12247

Bootstrap error information is only logged at DEBUG level

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 5.3.0.Beta1
    • Fix Version/s: 5.3.2
    • Component/s: hibernate-core
    • Labels:
      None
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true
    • Sprint:

      Description

      I was getting NPE when trying to use the result of:

      HibernatePersistenceProvider hpp = new HibernatePersistenceProvider();
      EntityManagerFactory emFactory = hpp.createEntityManagerFactory("paxDB", puProps);

      I got no error message or stack trace.

      Using the debugger, I stepped through the code. After the second line, emFactory was null.

      I had the logging settings for Hibernate set to display INFO.

      I turned logging to TRACE and got the trace shown below. Now that I know there's a problem with my definition, I can fix it.

      The error message, however, should be shown at ERROR level, not at DEBUG!

      2018-01-23 17:01:34.148 [JavaFX-Launcher] TRACE org.hibernate.cfg.annotations.PropertyBinder 329 - Cascading parentName with null
      2018-01-23 17:01:34.150 [JavaFX-Launcher] TRACE org.hibernate.cfg.AnnotationBinder 1618 - Processing annotations of paxapps.importdata.model.entities.SpaceTemplate.parentTemplate
      2018-01-23 17:01:34.152 [JavaFX-Launcher] TRACE org.hibernate.engine.jdbc.env.internal.NormalizingIdentifierHelperImpl 61 - Normalizing identifier quoting [venue]
      2018-01-23 17:01:34.153 [JavaFX-Launcher] DEBUG org.hibernate.cfg.Ejb3Column 213 - Binding column: Ejb3JoinColumn

      {logicalColumnName='venue', referencedColumn='venue', mappedBy=''}

      2018-01-23 17:01:34.155 [JavaFX-Launcher] TRACE org.hibernate.engine.jdbc.env.internal.NormalizingIdentifierHelperImpl 61 - Normalizing identifier quoting [parent_type]
      2018-01-23 17:01:34.156 [JavaFX-Launcher] DEBUG org.hibernate.cfg.Ejb3Column 213 - Binding column: Ejb3JoinColumn

      {logicalColumnName='parent_type', referencedColumn='space_type', mappedBy=''}

      2018-01-23 17:01:34.158 [JavaFX-Launcher] TRACE org.hibernate.engine.jdbc.env.internal.NormalizingIdentifierHelperImpl 61 - Normalizing identifier quoting [parent_name]
      2018-01-23 17:01:34.160 [JavaFX-Launcher] DEBUG org.hibernate.cfg.Ejb3Column 213 - Binding column: Ejb3JoinColumn

      {logicalColumnName='parent_name', referencedColumn='space_name', mappedBy=''}

      2018-01-23 17:01:34.162 [JavaFX-Launcher] TRACE org.hibernate.engine.jdbc.env.internal.NormalizingIdentifierHelperImpl 61 - Normalizing identifier quoting [parentTemplate]
      2018-01-23 17:01:34.163 [JavaFX-Launcher] TRACE org.hibernate.engine.jdbc.env.internal.NormalizingIdentifierHelperImpl 61 - Normalizing identifier quoting [parentTemplate]
      2018-01-23 17:01:34.165 [JavaFX-Launcher] DEBUG org.hibernate.cfg.Ejb3Column 213 - Binding column: Ejb3Column

      {table=org.hibernate.mapping.Table(paxdb.space_template), mappingColumn=parentTemplate, insertable=true, updatable=true, unique=false}

      2018-01-23 17:01:34.169 [JavaFX-Launcher] DEBUG org.hibernate.jpa.HibernatePersistenceProvider 62 - Unable to create EntityManagerFactory
      org.hibernate.AnnotationException: Mixing nullable and non nullable columns in a property is not allowed: paxapps.importdata.model.entities.SpaceTemplate.parentTemplate
      at org.hibernate.cfg.Ejb3Column.checkPropertyConsistency(Ejb3Column.java:723) ~[hibernate-core-5.3.0.Beta1.jar:5.3.0.Beta1]
      at org.hibernate.cfg.AnnotationBinder.bindManyToOne(AnnotationBinder.java:3020) ~[hibernate-core-5.3.0.Beta1.jar:5.3.0.Beta1]
      at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1752) ~[hibernate-core-5.3.0.Beta1.jar:5.3.0.Beta1]
      at org.hibernate.cfg.AnnotationBinder.processIdPropertiesIfNotAlready(AnnotationBinder.java:961) ~[hibernate-core-5.3.0.Beta1.jar:5.3.0.Beta1]
      at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:788) ~[hibernate-core-5.3.0.Beta1.jar:5.3.0.Beta1]
      at org.hibernate.boot.model.source.internal.annotations.AnnotationMetadataSourceProcessorImpl.processEntityHierarchies(AnnotationMetadataSourceProcessorImpl.java:250) ~[hibernate-core-5.3.0.Beta1.jar:5.3.0.Beta1]
      at org.hibernate.boot.model.process.spi.MetadataBuildingProcess$1.processEntityHierarchies(MetadataBuildingProcess.java:226) ~[hibernate-core-5.3.0.Beta1.jar:5.3.0.Beta1]
      at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:269) ~[hibernate-core-5.3.0.Beta1.jar:5.3.0.Beta1]
      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:861) ~[hibernate-core-5.3.0.Beta1.jar:5.3.0.Beta1]
      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:888) ~[hibernate-core-5.3.0.Beta1.jar:5.3.0.Beta1]
      at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:58) [hibernate-core-5.3.0.Beta1.jar:5.3.0.Beta1]
      at paxapps.importdata.model.DbUtil.<clinit>(DbUtil.java:133) [importData/:?]
      at paxapps.importdata.Main.init(Main.java:30) [importData/:?]
      at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:897) [javafx.graphics:?]
      at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:198) [javafx.graphics:?]
      at java.lang.Thread.run(Thread.java:844) [?:?]

        Attachments

          Issue links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: