Estou estudando um projeto Web no WildFly 8.2.1 com Hibernet e JPA 2.0. Ao rodar a aplicação e ao subir o serviço no Server, as tabelas não Criadas. Alguém pode me ajudar, por favor?
Abaixo meus arquivos persistence.xml, module.xml e standalone.xml:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="SCPPU">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:jboss/datasources/SCPDS</jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
</properties>
</persistence-unit>
</persistence>
<module xmlns="urn:jboss:module:1.3" name="com.mysql">
<resources>
<resource-root path="mysql-connector-java-5.1.31.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
<module name="javax.servlet.api" optional="true"/>
</dependencies>
</module>
<subsystem xmlns="urn:jboss:domain:datasources:2.0">
<datasources>
<datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
<connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
<driver>h2</driver>
<security>
<user-name>sa</user-name>
<password>sa</password>
</security>
</datasource>
<datasource jndi-name="java:jboss/datasources/SCPDS" pool-name="SCPDS" enabled="true" use-java-context="true">
<connection-url>jdbc:mysql://localhost:3306/db_scp</connection-url>
<driver>mysql</driver>
<transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
<pool>
<min-pool-size>10</min-pool-size>
<max-pool-size>100</max-pool-size>
<prefill>true</prefill>
</pool>
<security>
<user-name>root</user-name>
<password>root</password>
</security>
<statement>
<prepared-statement-cache-size>32</prepared-statement-cache-size>
<share-prepared-statements>true</share-prepared-statements>
</statement>
</datasource>
<drivers>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
<driver name="mysql" module="com.mysql">
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
</subsystem>
Log do WildFly
07:32:47,340 INFO [org.jboss.modules] (main) JBoss Modules version 1.3.3.Final
07:32:59,267 INFO [org.jboss.msc] (main) JBoss MSC version 1.2.2.Final
07:33:01,530 INFO [org.jboss.as] (MSC service thread 1-7) JBAS015899: WildFly 8.2.1.Final “Tweek” starting
07:33:27,796 INFO [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found SCP2.war in deployment directory. To trigger deployment create a file called SCP2.war.dodeploy
07:33:27,798 INFO [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found portal-web.war in deployment directory. To trigger deployment create a file called portal-web.war.dodeploy
07:33:27,798 INFO [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found SCP.war in deployment directory. To trigger deployment create a file called SCP.war.dodeploy
07:33:27,955 INFO [org.jboss.as.server] (Controller Boot Thread) JBAS015888: Creating http management service using socket-binding (management-http)
07:33:28,620 INFO [org.xnio] (MSC service thread 1-6) XNIO version 3.3.0.Final
07:33:28,781 INFO [org.jboss.as.security] (ServerService Thread Pool – 45) JBAS013171: Activating Security Subsystem
07:33:28,785 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool – 32) JBAS010280: Activating Infinispan subsystem.
07:33:28,784 WARN [org.jboss.as.txn] (ServerService Thread Pool – 46) JBAS010153: Node identifier property is set to the default value. Please make sure it is unique.
07:33:28,787 INFO [org.jboss.as.naming] (ServerService Thread Pool – 40) JBAS011800: Activating Naming Subsystem
07:33:28,799 INFO [org.jboss.as.jsf] (ServerService Thread Pool – 38) JBAS012615: Activated the following JSF Implementations: [main]
07:33:28,840 INFO [org.xnio.nio] (MSC service thread 1-6) XNIO NIO Implementation Version 3.3.0.Final
07:33:28,842 INFO [org.jboss.as.webservices] (ServerService Thread Pool – 48) JBAS015537: Activating WebServices Extension
07:33:28,904 INFO [org.jboss.as.security] (MSC service thread 1-2) JBAS013170: Current PicketBox version=4.0.21.Final
07:33:29,086 INFO [org.wildfly.extension.undertow] (MSC service thread 1-4) JBAS017502: Undertow 1.1.8.Final starting
07:33:29,086 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool – 47) JBAS017502: Undertow 1.1.8.Final starting
07:33:29,318 INFO [org.jboss.as.connector.logging] (MSC service thread 1-4) JBAS010408: Starting JCA Subsystem (IronJacamar 1.1.9.Final)
07:33:30,204 INFO [org.wildfly.extension.io] (ServerService Thread Pool – 31) WFLYIO001: Worker ‘default’ has auto-configured to 8 core threads with 64 task threads based on your 4 available processors
07:33:30,238 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool – 47) JBAS017527: Creating file handler for path C:\wildfly-8.2.1.Final/welcome-content
07:33:31,989 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool – 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
07:33:31,991 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) JBAS010417: Started Driver service with driver-name = h2
07:33:32,191 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool – 27) JBAS010404: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)
07:33:32,191 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) JBAS010417: Started Driver service with driver-name = mysql
07:33:34,253 INFO [org.jboss.as.mail.extension] (MSC service thread 1-4) JBAS015400: Bound mail session [java:jboss/mail/Default]
07:33:34,253 INFO [org.jboss.as.naming] (MSC service thread 1-5) JBAS011802: Starting Naming Service
07:33:35,964 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-5) JBAS015012: Started FileSystemDeploymentService for directory C:\wildfly-8.2.1.Final\standalone\deployments
07:33:35,969 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of “SCP2.war” (runtime-name: “SCP2.war”)
07:33:35,969 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of “SCP.war” (runtime-name: “SCP.war”)
07:33:35,969 INFO [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015876: Starting deployment of “portal-web.war” (runtime-name: “portal-web.war”)
07:33:35,990 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-3) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
07:33:36,192 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) JBAS010400: Bound data source [java:jboss/datasources/SCPDS]
07:33:39,969 INFO [org.wildfly.extension.undertow] (MSC service thread 1-4) JBAS017525: Started server default-server.
07:33:40,081 INFO [org.jboss.remoting] (MSC service thread 1-8) JBoss Remoting version 4.0.7.Final
07:33:40,090 INFO [org.wildfly.extension.undertow] (MSC service thread 1-3) JBAS017531: Host default-host starting
07:33:40,115 INFO [org.wildfly.extension.undertow] (MSC service thread 1-4) JBAS017519: Undertow HTTP listener default listening on localhost/127.0.0.1:8080
07:33:42,386 INFO [org.jboss.weld.deployer] (MSC service thread 1-7) JBAS016002: Processing weld deployment portal-web.war
07:33:46,672 INFO [org.hibernate.validator.internal.util.Version] (MSC service thread 1-7) HV000001: Hibernate Validator 5.1.3.Final
07:33:54,059 INFO [org.jboss.ws.common.management] (MSC service thread 1-5) JBWS022052: Starting JBoss Web Services - Stack CXF Server 4.3.2.Final
07:33:57,067 INFO [org.jboss.weld.deployer] (MSC service thread 1-3) JBAS016005: Starting Services for CDI deployment: portal-web.war
07:33:57,303 INFO [org.wildfly.extension.undertow] (MSC service thread 1-4) JBAS017534: Registered web context: /SCP
07:33:57,815 INFO [org.jboss.weld.Version] (MSC service thread 1-3) WELD-000900: 2.2.6 (Final)
07:33:57,833 INFO [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016008: Starting weld service for deployment portal-web.war
07:33:58,892 INFO [org.wildfly.extension.undertow] (MSC service thread 1-5) JBAS017534: Registered web context: /SCP2
07:34:01,163 INFO [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-2) Initializing Mojarra 2.2.8-jbossorg-1 20140822-1131 for context '/portal-web’
07:34:03,736 INFO [org.primefaces.webapp.PostConstructApplicationEventListener] (MSC service thread 1-2) Running on PrimeFaces 5.1
07:34:03,738 INFO [org.wildfly.extension.undertow] (MSC service thread 1-2) JBAS017534: Registered web context: /portal-web
07:34:03,784 INFO [org.jboss.as.server] (ServerService Thread Pool – 28) JBAS018559: Deployed “SCP2.war” (runtime-name : “SCP2.war”)
07:34:03,784 INFO [org.jboss.as.server] (ServerService Thread Pool – 28) JBAS018559: Deployed “SCP.war” (runtime-name : “SCP.war”)
07:34:03,784 INFO [org.jboss.as.server] (ServerService Thread Pool – 28) JBAS018559: Deployed “portal-web.war” (runtime-name : “portal-web.war”)
07:34:04,096 INFO [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:9990/management
07:34:04,098 INFO [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990
07:34:04,098 INFO [org.jboss.as] (Controller Boot Thread) JBAS015874: WildFly 8.2.1.Final “Tweek” started in 96044ms - Started 661 of 727 services (112 services are lazy, passive or on-demand)