title: How to generate table schema from persistence.xml of jpa 2.1?
body: <p>I try to generate table schema with script file with eclipse and wildfly 8.1
  This is my persistence.xml file.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"
   version="2.1"&gt;
  
  &lt;persistence-unit name="MyFamily"&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="javax.persistence.schema-generation.database.action" value="drop-and-create"/&gt;
     &lt;property name="javax.persistence.schema-generation.create-source" value="script-then-metadata"/&gt;
     &lt;property name="javax.persistence.schema-generation.create-database-schemas" value="true"/&gt;
     &lt;property name="javax.persistence.schema-generation.scripts.drop-script-source" value="META-INF/drop-script.jdbc"/&gt;
     &lt;property name="javax.persistence.schema-generation.scripts.create-script-source" value="META-INF/create-script.jdbc"/&gt;
     &lt;property name="javax.persistence.sql-load-script-source" value="META-INF/load-script.jdbc"/&gt;
     &lt;property name="org.hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect"/&gt;
    &lt;/properties&gt;
   &lt;/persistence-unit&gt;
  &lt;/persistence&gt;
  </code></pre>
  
  <p>And these are entity source and script files.</p>
  
  <p>=== Entity</p>
  
  <pre><code>@Entity
  @EntityListeners(Alarm.class)
  @Table(name="family", indexes={@Index(columnList="EMP_ID"), @Index(columnList="EMP_NAME")})
  public class Members implements Serializable {
  
   @Id
   @Column(name = "EMP_ID")
   private String ID;
  
   @Column(name = "EMP_Passwd")
   private String Passwd;
  
   @Column(name = "EMP_Age")
   private int Age;
  
   @Column(name = "EMP_Name")
   private String Name;
  </code></pre>
  
  <p>=== create-script.jdbc</p>
  
  <pre><code>CREATE TABLE family (
     EMP_ID VARCHAR(255) NOT NULL,
     EMP_PASSWD VARCHAR(255) NOT NULL,
     EMP_AGE INT NOT NULL,
     EMP_NAME VARCHAR(255) NOT NULL,
  
     PRIMARY KEY(EMP_ID)
  )
  </code></pre>
  
  <p>But deployment throws the following exception:</p>
  
  <pre><code>15:05:58,728 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 55) MSC000001: Failed to start service jboss.persistenceunit."EJBLoginEAR.ear/EJBLoginModule.jar#MyFamily": org.jboss.msc.service.StartException in service jboss.persistenceunit."EJBLoginEAR.ear/EJBLoginModule.jar#MyFamily": javax.persistence.PersistenceException: Schema generation configuration indicated to include CREATE scripts, but no script was specified
   at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:172) [wildfly-jpa-8.1.0.Final.jar:8.1.0.Final]
   at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:117) [wildfly-jpa-8.1.0.Final.jar:8.1.0.Final]
   at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.7.0_60]
   at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:474)
   at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:182) [wildfly-jpa-8.1.0.Final.jar:8.1.0.Final]
   at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_60]
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_60]
   at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_60]
   at org.jboss.threads.JBossThread.run(JBossThread.java:122)
  Caused by: javax.persistence.PersistenceException: Schema generation configuration indicated to include CREATE scripts, but no script was specified
   at org.hibernate.jpa.internal.schemagen.JpaSchemaGenerator$Generation.buildCreateSourceList(JpaSchemaGenerator.java:284) [hibernate-entitymanager-4.3.5.Final.jar:4.3.5.Final]
   at org.hibernate.jpa.internal.schemagen.JpaSchemaGenerator$Generation.execute(JpaSchemaGenerator.java:133) [hibernate-entitymanager-4.3.5.Final.jar:4.3.5.Final]
   at org.hibernate.jpa.internal.schemagen.JpaSchemaGenerator.performGeneration(JpaSchemaGenerator.java:76) [hibernate-entitymanager-4.3.5.Final.jar:4.3.5.Final]
   at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:857) [hibernate-entitymanager-4.3.5.Final.jar:4.3.5.Final]
   at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:843) [hibernate-entitymanager-4.3.5.Final.jar:4.3.5.Final]
   at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:397) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
   at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:842) [hibernate-entitymanager-4.3.5.Final.jar:4.3.5.Final]
   at org.jboss.as.jpa.hibernate4.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44) [jipijapa-hibernate4-3-1.0.1.Final.jar:]
   at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:154) [wildfly-jpa-8.1.0.Final.jar:8.1.0.Final]
   ... 8 more
  
  15:05:58,731 ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 2) JBAS014613: Operation ("full-replace-deployment") failed - address: ([]) - failure description: {"JBAS014671: Failed services" =&gt; {"jboss.persistenceunit.\"EJBLoginEAR.ear/EJBLoginModule.jar#MyFamily\"" =&gt; "org.jboss.msc.service.StartException in service jboss.persistenceunit.\"EJBLoginEAR.ear/EJBLoginModule.jar#MyFamily\": javax.persistence.PersistenceException: Schema generation configuration indicated to include CREATE scripts, but no script was specified
      Caused by: javax.persistence.PersistenceException: Schema generation configuration indicated to include CREATE scripts, but no script was specified"}}
  </code></pre>
  
  <p>How can I generate database schema with script files of persistence.xml in Wildfly 8?</p>