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

WildFly10.x e Mysql8

Estou com dificuldades em criar o DataSource ele me da o seguinte erro:

18:12:07,057 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 36) WFLYCTL0013: Operation ("add") failed - address: ([
    ("subsystem" => "datasources"),
    ("jdbc-driver" => "mysql")
]) - failure description: "WFLYJCA0041: Failed to load module for driver [com.mysql]"

(...)

18:12:11,740 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
    ("subsystem" => "datasources"),
    ("data-source" => "nineteenDS")
]) - failure description: {
    "WFLYCTL0412: Required services that are not installed:" => ["jboss.jdbc-driver.mysql"],
    "WFLYCTL0180: Services with missing/unavailable dependencies" => [
        "jboss.driver-demander.java:jboss/datasources/nineteenDS is missing [jboss.jdbc-driver.mysql]",
        "org.wildfly.data-source.nineteenDS is missing [jboss.jdbc-driver.mysql]"
    ]
}

e toda a sequência de erro é pela falta do jboss.jdbc-driver.mysql.

o meu standalone-full está assim:

 <subsystem xmlns="urn:jboss:domain:datasources:4.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/nineteenDS" pool-name="nineteenDS">
                    <connection-url>jdbc:mysql://localhost:3306/nineteendb?useSSL=false&amp;serverTimezone=UTC</connection-url>
                    <connection-property name="DatabaseName">
                        nineteendb
                    </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>minhasenha</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>
        </subsystem>

Já tentei colocar o <.driver> de diversas formas.

o module.xml está com o driver no diretório " \wildfly-10.1.0.Final\modules\com\mysql\main" o driver é mysql-connector-java-8.0.16 e o module.xml está 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-8.0.16.jar"/>
    </resources>
    <dependencies>
        <module name="javax.api"/>
    </dependencies>
</module>

alguém consegue me dar uma luz no que estou fazendo errado?

2 respostas

Consegui hoje resolver esse problema. Havia salvo o meu arquivo .xml como .txt.... Agora estou com problema com o Dialect

Caused by: org.hibernate.boot.registry.selector.spi.StrategySelectionException: Unable to resolve name [org.hibernate.dialect.MySQL8Dialect] as strategy [org.hibernate.dialect.Dialect]
solução!

mudei o MYSQL Dialect para MySQLDialect e resolveu