1 Reply Latest reply on Apr 19, 2017 8:55 AM by valsaraj viswanathan

    WildFly 10.1 Hibernate SchemaManagementException

    valsaraj viswanathan Master

      Hi,

       

      I got following exception in Linux server running with WildFly 10.1 & PostgreSQL:

      javax.persistence.PersistenceException: [PersistenceUnit: em] Unable to build Hibernate SessionFactory

      [Server:app-node-00] at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:179)

      ...

      [Server:app-node-00] Caused by: org.hibernate.tool.schema.spi.SchemaManagementException: Unable to execute schema management to JDBC target

      [alter table app.USER add constraint FKbd6bn1ivwqkoq88eaarhvwr0o foreign key (parent_id) references app.USER]

      [Server:app-node-00] at org.hibernate.tool.schema.internal.TargetDatabaseImpl.accept(TargetDatabaseImpl.java:59)

      [Server:app-node-00] at org.hibernate.tool.schema.internal.SchemaMigratorImpl.applySqlString(SchemaMigratorImpl.java:431)

      Any solution for this?

       

      Thanks!

        • 1. Re: WildFly 10.1 Hibernate SchemaManagementException
          valsaraj viswanathan Master

          Upgraded to hibernate 5.1.5 but still getting this:

          2017-04-19 18:10:30,113 WARN  [org.hibernate.tool.schema.internal.ExceptionHandlerLoggedImpl] (ServerService Thread Pool -- 86) GenerationTarget encountered exception accepting command : Error executing DDL via JDBC Statement: org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL via JDBC Statement

          ...

          Caused by: org.postgresql.util.PSQLException: ERROR: insert or update on table "author_info" violates foreign key constraint "fk8dmiogojwntxbw5acljojkvan"

            Detail: Key (author_id)=(5967) is not present in table "author".