1
resposta

To trigger deployment create a file called casadocodigo.war.dodeploy

Após realizar a criação da tabela no banco, na atividade 16 da Aula 1, e compilar o Wildfly, o seguinte erro ocorre:

WFLYCTL0184:    New missing/unsatisfied dependencies:
      service jboss.deployment.unit."casadocodigo.war".WeldBootstrapService (missing) dependents: [service jboss.deployment.unit."casadocodigo.war".component."org.jboss.weld.servlet.WeldTerminalListener".WeldInstantiator, service jboss.deployment.unit."casadocodigo.war".WeldStartService, service jboss.deployment.unit."casadocodigo.war".component."com.sun.faces.config.ConfigureListener".WeldInstantiator, service jboss.deployment.unit."casadocodigo.war".CdiValidatorFactoryService, WFLYCTL0208: ... and 5 more ] 
      service jboss.deployment.unit."casadocodigo.war".component."com.sun.faces.config.ConfigureListener".CREATE (missing) dependents: [service jboss.deployment.unit."casadocodigo.war".component."com.sun.faces.config.ConfigureListener".START] 
      service jboss.deployment.unit."casadocodigo.war".component."com.sun.faces.config.ConfigureListener".START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./casadocodigo.UndertowDeploymentInfoService, service jboss.deployment.unit."casadocodigo.war".deploymentCompleteService, service jboss.undertow.deployment.default-server.default-host./casadocodigo] 
      service jboss.deployment.unit."casadocodigo.war".component."com.sun.faces.config.ConfigureListener".WeldInstantiator (missing) dependents: [service jboss.deployment.unit."casadocodigo.war".component."com.sun.faces.config.ConfigureListener".START] 
      service jboss.deployment.unit."casadocodigo.war".component."javax.faces.webapp.FacetTag".CREATE (missing) dependents: [service jboss.deployment.unit."casadocodigo.war".component."javax.faces.webapp.FacetTag".START] 
      service jboss.deployment.unit."casadocodigo.war".component."javax.faces.webapp.FacetTag".........

 service org.wildfly.request-controller.control-point."casadocodigo.war".undertow (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./casadocodigo.UndertowDeploymentInfoService] 
WFLYCTL0186:   Services which failed to start:      service jboss.persistenceunit."casadocodigo.war#casadocodigo-dev"

14:13:19,948 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) WFLYDS0004: Found casadocodigo.war in deployment directory. To trigger deployment create a file called casadocodigo.war.dodeploy
1 resposta

Pode ser que seja a configuração do datasource no persistence.xml ou standalone-full.xml, segue:

persistence.xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        version="2.1"
    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence
    http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
    <persistence-unit name="casadocodigo-dev" transaction-type="JTA">
        <description>Dev persistence unit</description>
        <provider>org.hibernate.ejb.HibernatePersistence</provider>
        <!-- java transaction api || JNDI -->
        <jta-data-source>java:jboss/datasources/casadocodigoDS</jta-data-source>
        <properties>
            <property name="hibernate.hbm2ddl.auto" value="update"/>
            <property name="hibernate.show_sql" value="true" />
            <property name="hibernate.format_sql" value="true" />
            <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect"/>
        </properties>
    </persistence-unit>
</persistence>

standalone-full.xml

<datasource jndi-name="java:jboss/datasources/casadocodigoDS" pool-name="casadocodigoDS">
                    <connection-url>jdbc:mysql://localhost:3306/casadocodigo_javaee</connection-url>
                    <connection-property name="DatabaseName">
                        casadocodigo_javaee
                    </connection-property>
                    <driver>mysql</driver>
                    <pool>
                        <min-pool-size>10</min-pool-size>
                        <max-pool-size>20</max-pool-size>
                    </pool>
                    <security>
                        <user-name>root</user-name>
                    </security>
                </datasource>
                <drivers>
                    <driver name="mysql" module="com.mysql">
                        <datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlDataSource</datasource-class>
                    </driver>
                </drivers>

Confirma também se tem na pasta com > mysql > main o module.xml:

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.3" name="com.mysql">
    <resources>
        <resource-root path="mysql-connector-java-5.1.35.jar"/>
    </resources>
    <dependencies>
        <module name="javax.api"/>
    </dependencies>
</module>

Além desse xml, colar o mysql-connector-java, que é um jar usado para realizar a conexão com o banco, ele pode ser baixado aqui: http://central.maven.org/maven2/mysql/mysql-connector-java/5.1.35/mysql-connector-java-5.1.35.jar