title: insert into hibernate_sequence values ( 1 )" via JDBC Statement: org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL "
body: <p>wildfly version: wildfly-15
  Hibernate version: Hibernate-5</p>
  
  <pre><code>  &lt;datasource jndi-name="java:jboss/datasources/MySqlDS" pool-name="MySqlDS" spy="true" tracking="true" enlistment-trace="true" statistics-enabled="true"&gt;
                      &lt;connection-url&gt;jdbc:mysql://localhost:3306/sample&lt;/connection-url&gt;
                      &lt;driver-class&gt;com.mysql.cj.jdbc.Driver&lt;/driver-class&gt;
                      &lt;datasource-class&gt;com.mysql.cj.jdbc.MysqlDataSource&lt;/datasource-class&gt;
                      &lt;connection-property name="useSSL"&gt;
                          false
                      &lt;/connection-property&gt;
                      &lt;connection-property name="characterEncoding"&gt;
                          UTF-8
                      &lt;/connection-property&gt;
                      &lt;connection-property name="serverTimezone"&gt;
                          GMT+8
                      &lt;/connection-property&gt;
                      &lt;driver&gt;mysql&lt;/driver&gt;
                      &lt;security&gt;
                          &lt;user-name&gt;sample&lt;/user-name&gt;
                          &lt;password&gt;sample&lt;/password&gt;
                      &lt;/security&gt;
                      &lt;validation&gt;
                          &lt;valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker"/&gt;
                          &lt;background-validation&gt;true&lt;/background-validation&gt;
                          &lt;exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter"/&gt;
                      &lt;/validation&gt;
                      &lt;statement&gt;
                          &lt;share-prepared-statements&gt;true&lt;/share-prepared-statements&gt;
                      &lt;/statement&gt;
                  &lt;/datasource&gt;
  </code></pre>
  
  <p>Entity:</p>
  
  <pre><code>@Entity
  @Table(schema = "sample", name="person")
  @Data
  public class Person implements Serializable {
  
      private static final long serialVersionUID = 1L;
  
      /**
       * primary key and increment strategy
       */
      @Id
      @GeneratedValue(strategy=GenerationType.AUTO)
      private Integer personId;
  
      /**
       * Field Constraint: no-null、length=32
       */
      @Column(nullable=false,length=32)
      private String name;
  
      @Column(nullable=false)
      private Integer age;
  
      @Temporal(value=TemporalType.DATE)
      private Date birthday;
  }
  </code></pre>
  
  <p>persitence.xml:</p>
  
  <pre><code>    &lt;persistence-unit name="persistenceUnit"&gt;
       &lt;jta-data-source&gt;java:jboss/datasources/MySqlDS&lt;/jta-data-source&gt;
       &lt;properties&gt;
           &lt;property name="hibernate.show_sql" value="true" /&gt;
           &lt;property name="hibernate.format_sql" value="true"/&gt;
           &lt;property name="hibernate.hbm2ddl.auto" value="update"/&gt;
           &lt;property name="hibernate.dialect" value="org.hibernate.dialect.MySQL8Dialect"/&gt;
       &lt;/properties&gt;
  &lt;/persistence-unit&gt;
  </code></pre>
  
  <p>Error Info:</p>
  
  <pre><code>18:25:26,417 WARN  [org.hibernate.tool.schema.internal.ExceptionHandlerLoggedImpl] (ServerService Thread Pool -- 11) GenerationTarget encountered exception accepting command : Error executing DDL "
      insert into hibernate_sequence values ( 1 )" via JDBC Statement: org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL "
      insert into hibernate_sequence values ( 1 )" via JDBC Statement
      at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:67)
      at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.applySqlString(AbstractSchemaMigrator.java:559)
      at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.applySqlStrings(AbstractSchemaMigrator.java:504)
      at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.createTable(AbstractSchemaMigrator.java:277)
      at org.hibernate.tool.schema.internal.GroupedSchemaMigratorImpl.performTablesMigration(GroupedSchemaMigratorImpl.java:71)
      at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.performMigration(AbstractSchemaMigrator.java:207)
      at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.doMigration(AbstractSchemaMigrator.java:114)
      at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:183)
      at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:72)
      at org.hibernate.internal.SessionFactoryImpl.&lt;init&gt;(SessionFactoryImpl.java:310)
      at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:467)
      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:939)
      at org.jboss.as.jpa.hibernate5.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44)
      at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:170)
      at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:128)
      at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:649)
      at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:212)
      at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
      at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
      at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
      at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
      at java.lang.Thread.run(Thread.java:748)
      at org.jboss.threads.JBossThread.run(JBossThread.java:485)
  Caused by: java.sql.SQLException: No database selected
  </code></pre>
  
  <p>Problem:
  When I configure wildfly mysql datasource , when I login in wildfly management web ui, I can test datasource successfully, but when I package ejb project with jpa configure into a jar , then error info happens, How can I solve it? Thanks </p>