Hibernate Migration 4.3.7 to 5.0.6 (Wildfly 10CR5) SchemaManagementException: Schema-validation: missing table

Version 3

    Hi all

     

    During the migration (I changed only version in pom of my project) I'm reciving the error:

     

    11:29:55,571 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 64) MSC000001: Failed to start service jboss.persistenceunit."oms-ear.ear/oms-model.jar#omsPU": org.jboss.msc.service.StartException in service jboss.persistenceunit."oms-ear.ear/oms-model.jar#omsPU": javax.persistence.PersistenceException: [PersistenceUnit: omsPU] Unable to build Hibernate SessionFactory

        at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:172) [wildfly-jpa-10.0.0.CR5.jar:10.0.0.CR5]

        at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:117) [wildfly-jpa-10.0.0.CR5.jar:10.0.0.CR5]

        at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:667)

        at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:182) [wildfly-jpa-10.0.0.CR5.jar:10.0.0.CR5]

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_60]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_60]

        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_60]

        at org.jboss.threads.JBossThread.run(JBossThread.java:320)

    Caused by: javax.persistence.PersistenceException: [PersistenceUnit: omsPU] Unable to build Hibernate SessionFactory

        at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:954) [hibernate-entitymanager-5.0.6.Final.jar:5.0.6.Final]

        at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:882) [hibernate-entitymanager-5.0.6.Final.jar:5.0.6.Final]

        at org.jboss.as.jpa.hibernate5.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44)

        at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:154) [wildfly-jpa-10.0.0.CR5.jar:10.0.0.CR5]

        ... 7 more

    Caused by: org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing table [channelFlow]

        at org.hibernate.tool.schema.internal.SchemaValidatorImpl.validateTable(SchemaValidatorImpl.java:67) [hibernate-core-5.0.6.Final.jar:5.0.6.Final]

        at org.hibernate.tool.schema.internal.SchemaValidatorImpl.doValidation(SchemaValidatorImpl.java:50) [hibernate-core-5.0.6.Final.jar:5.0.6.Final]

        at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:91) [hibernate-core-5.0.6.Final.jar:5.0.6.Final]

        at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:473) [hibernate-core-5.0.6.Final.jar:5.0.6.Final]

        at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:444) [hibernate-core-5.0.6.Final.jar:5.0.6.Final]

        at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:879) [hibernate-entitymanager-5.0.6.Final.jar:5.0.6.Final]

     

    When I removed from persistence.xml entry: <property name="hibernate.hbm2ddl.auto" value="validate" />

    then it works but I want to use validation in my project. I'm using JTA, org.hibernate.dialect.SQLServer2012Dialec, JPA 2.1 and Wildfly 10CR5 and jtds 1.3.1. ... and version 4.3.7 is working fine with option "validate".

     

    Please let me know if you'll have any idea what is the cause of it, what is wrong or what to change in my project or if you need more details to fix it.

     

    regards