1
resposta

Erro ao subir wildfly

                <datasource jndi-name="java:jboss/datasources/casadocodigoDS" pool-name="casadocodigoDS">
                    <connection-url>jdbc:mysql://localhost:3306/casadocodigo2_javaee</connection-url>
                    <connection-property name="DatabaseName">
                        casadocodigo2_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>marcelo</password>
                    </security>
                </datasource>
07:25:06,474 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
    ("subsystem" => "datasources"),
    ("data-source" => "casadocodigoDS")
]) - failure description: {
    "WFLYCTL0412: Required services that are not installed:" => ["jboss.jdbc-driver.mysql"],
    "WFLYCTL0180: Services with missing/unavailable dependencies" => [
        "org.wildfly.data-source.casadocodigoDS is missing [jboss.jdbc-driver.mysql]",
        "jboss.driver-demander.java:jboss/datasources/casadocodigoDS is missing [jboss.jdbc-driver.mysql]"
    ]
}
07:25:06,475 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
    ("subsystem" => "datasources"),
    ("data-source" => "casadocodigoDS")
]) - failure description: {
    "WFLYCTL0412: Required services that are not installed:" => [
        "jboss.jdbc-driver.mysql",
        "jboss.jdbc-driver.mysql"
    ],
    "WFLYCTL0180: Services with missing/unavailable dependencies" => [
        "org.wildfly.data-source.casadocodigoDS is missing [jboss.jdbc-driver.mysql]",
        "jboss.driver-demander.java:jboss/datasources/casadocodigoDS is missing [jboss.jdbc-driver.mysql]",
        "org.wildfly.data-source.casadocodigoDS is missing [jboss.jdbc-driver.mysql]"
1 resposta

Oi MARCELO

Você provavelmente não configurou o driver JDBC na sua instalação do Wildfly:

Todo driver JDBC, precisa de um JAR. Esse JAR não fica armazenado no projeto e sim no servidor. No Wildfly os drivers ficam armazenados na pasta: wildfly/modules/. Devemos colocar nosso JAR dentro desta pasta, com a estrutura a seguir:

com/
    mysql/
        main/
            mysql-connector-java-5.1.35.jar

Dentro da pasta main nós temos que adicionar um arquivo chamado module.xml além do JAR do driver de conexão. No arquivo module.xml temos o caminho para o jar do driver de conexão e uma dependência para a API de persistência do JDBC chamada javax.api. O module.xml ficará assim:

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