title: Issue while configuring multiple persistence units in JPA with JBoss Server
body: <p>Here I have to connect to multiple databases using JPA say db1, db2. I need  data from table(db2) in my application. So I have configured multiple persistance units for db1 and db2 in persistance.xml file. But I am getting an issue while starting the server saying that:</p>
  
  <pre><code>javax.persistence.PersistenceException: [PersistenceUnit: defPU] Unable to build Hibernate SessionFactory. 
  </code></pre>
  
  <p>and this is caused by: </p>
  
  <pre><code>org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing table [db2_table].
  </code></pre>
  
  <p>Actually it is looking the db2_table in db1, which would be not available. Which means it is not recognising the 2nd persistence unit.</p>
  
  <p>Full trace:</p>
  
  <pre><code>14:05:35,409 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 60) MSC000001: Failed to start service jboss.persistenceunit."default.war#defaultPU": org.jboss.msc.service.StartException in service jboss.persistenceunit."def.war#defPU": javax.persistence.PersistenceException: [PersistenceUnit: defPU] Unable to build Hibernate SessionFactory
      at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:195)
      at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:125)
      at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:640)
      at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:209)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:748)
      at org.jboss.threads.JBossThread.run(JBossThread.java:320)
  Caused by: javax.persistence.PersistenceException: [PersistenceUnit: defPU] Unable to build Hibernate SessionFactory
      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:953)
      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:883)
      at org.jboss.as.jpa.hibernate5.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44)
      at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:167)
      ... 7 more
  Caused by: org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing table [def_table]
      at org.hibernate.tool.schema.internal.AbstractSchemaValidator.validateTable(AbstractSchemaValidator.java:121)
      at org.hibernate.tool.schema.internal.GroupedSchemaValidatorImpl.validateTables(GroupedSchemaValidatorImpl.java:42)
      at org.hibernate.tool.schema.internal.AbstractSchemaValidator.performValidation(AbstractSchemaValidator.java:89)
      at org.hibernate.tool.schema.internal.AbstractSchemaValidator.doValidation(AbstractSchemaValidator.java:68)
      at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:184)
      at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:65)
      at org.hibernate.internal.SessionFactoryImpl.&lt;init&gt;(SessionFactoryImpl.java:476)
      at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:422)
      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:880)
      ... 9 more
  </code></pre>