Solucionado (ver solução)
Solucionado
(ver solução)
9
respostas

Erro ao subir o servidor de aplicação

ao iniciar o servidor a seguinte mensagem aparece:

12:30:00,435 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-8) WFLYJCA0002: Bound JCA ConnectionFactory [java:/JmsXA]
12:30:00,435 INFO  [org.wildfly.extension.messaging-activemq] (MSC service thread 1-1) WFLYMSGAMQ0002: Bound messaging object to jndi name java:jboss/DefaultJMSConnectionFactory
12:30:00,436 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
    ("subsystem" => "datasources"),
    ("data-source" => "casadocodigoDS")
]) - failure description: {"WFLYCTL0180: Services with missing/unavailable dependencies" => [
    "jboss.driver-demander.java:jboss/datasources/casadocodigoDS is missing [jboss.jdbc-driver.mysql]",
    "org.wildfly.data-source.casadocodigoDS is missing [jboss.jdbc-driver.mysql]"
]}
12:30:00,437 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "casadocodigo.war")]) - failure description: {"WFLYCTL0288: One or more services were unable to start due to one or more indirect dependencies not being available." => {
    "Services that were unable to start:" => [
        "jboss.deployment.unit.\"casadocodigo.war\".POST_MODULE",
        "jboss.persistenceunit.\"casadocodigo.war#casadocodigo-dev\".__FIRST_PHASE__"
    ],
    "Services that may be the cause:" => ["jboss.jdbc-driver.mysql"]
}}
12:30:00,438 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
    ("subsystem" => "datasources"),
    ("data-source" => "casadocodigoDS")
]) - failure description: {"WFLYCTL0180: Services with missing/unavailable dependencies" => [
    "jboss.driver-demander.java:jboss/datasources/casadocodigoDS is missing [jboss.jdbc-driver.mysql]",
    "org.wildfly.data-source.casadocodigoDS is missing [jboss.jdbc-driver.mysql]",
    "org.wildfly.data-source.casadocodigoDS is missing [jboss.jdbc-driver.mysql]"
]}
12:30:00,450 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 37) WFLYSRV0010: Deployed "casadocodigo.war" (runtime-name : "casadocodigo.war")
12:30:00,451 INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0184:    New missing/unsatisfied dependencies:
      service jboss.jdbc-driver.mysql (missing) dependents: [service org.wildfly.data-source.casadocodigoDS, service jboss.driver-demander.java:jboss/datasources/casadocodigoDS] 

12:30:00,524 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
12:30:00,524 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
12:30:00,524 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final) started (with errors) in 2325ms - Started 321 of 613 services (6 services failed or missing dependencies, 389 services are lazy, passive or on-demand)
12:30:00,541 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0028: Stopped deployment casadocodigo.war (runtime-name: casadocodigo.war) in 5ms
12:30:00,583 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 1) WFLYSRV0009: Undeployed "casadocodigo.war" (runtime-name: "casadocodigo.war")
12:30:00,584 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 1) WFLYCTL0183: Service status report
WFLYCTL0184:    New missing/unsatisfied dependencies:
      service jboss.persistenceunit."casadocodigo.war#casadocodigo-dev".__FIRST_PHASE__ (missing) dependents: [service jboss.deployment.unit."casadocodigo.war".POST_MODULE] 

12:30:05,473 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
9 respostas

Fala, Lucas!

A causa raiz do erro está descrita nessa mensagem:

WFLYCTL0184:    New missing/unsatisfied dependencies:
      service jboss.jdbc-driver.mysql (missing) dependents: [service org.wildfly.data-source.casadocodigoDS, service jboss.driver-demander.java:jboss/datasources/casadocodigoDS]

Não é muito fácil de ler, mas o que está sendo dito é que o DataSource casadocodigoDS precisa do módulo jboss.jdbc-driver.mysql, que não foi encontrado...

Você chegou a seguir os passos da explicação da aula e do exercício DataSource, module e mais configurações?

Sim aqui esta o persistence:

<?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>

e aqui o standalone:

 <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/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>
                        <password>root</password>
                    </security>
                </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">
                        <datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlDataSource</datasource-class>
                    </driver>
                </drivers>
            </datasources>

Chegou a colocar o mysql-connector-java-5.1.35.jar lá no diretório modules/com/mysql/main/ e a criar o module.xml?

Se sim, dê uma conferida nos diretórios e no conteúdo do module.xml pois parece que o erro é no módulo do driver do MySQL.

aqui está o module:

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

até baixei um conector antigo nessa versão

Opa, Lucas.

O erro tá nesse driver, mas não sei qual é!

A mensagem deixa claro que tá faltando a configuração do driver.mysql:

org.wildfly.data-source.casadocodigoDS is missing [jboss.jdbc-driver.mysql

Não consegui ver nenhum erro nas configurações que você enviou. Você tem alguma outra ideia relacionada a esse driver?

para eu utilizar um driver mais atual no caso eu teria que alterar somente esta parte da configuração?

 <resource-root path="mysql-connector-java-5.1.35.jar"/>

Isso. E também modificar o arquivo .jar que está no diretório modules/com/mysql/main/.

solução!

Refiz o projeto do 0 e funcionou, devo ter feito algo errado em algum passo