Olá estou com problema para criar um datasource com servidor WildFly 10, faço todas as configurações no standalone.xml além de adicionar o driver ".jar" em "HOME_WILDFLY/modules/system/layers/base/com/mysql/main". E mostra falha de conexão ao realizar o ping no console do server.
standalone (parte do datasource):
<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 jta="true" jndi-name="java:jboss/datasources/projeto-ds"
pool-name="projeto" enabled="true" use-java-context="true"
use-ccm="true">
<!-- Aqui você deve colocar o endereço da sua base de dados -->
<connection-url>jdbc:mysql://localhost:8088/projeto</connection-url>
<driver>com.mysql.jdbc.Driver</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>senha</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>
module.xml:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.mysql">
<resources>
<!-- O nome do meu jar é "mysql.jar" -->
<resource-root path="mysql.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
<module name="javax.servlet.api" optional="true"/>
</dependencies>
</module>
Erro ao executar o servidor depois da configuração do DataSource:
16:01:17,881 INFO [org.jboss.ws.common.management] (MSC service thread 1-8) JBWS022052: Starting JBossWS 5.1.5.Final (Apache CXF 3.1.6)
16:01:17,887 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "projeto")
]) - failure description: {
"WFLYCTL0412: Required services that are not installed:" => ["jboss.jdbc-driver.com_mysql_jdbc_Driver"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"org.wildfly.data-source.vagasone is missing [jboss.jdbc-driver.com_mysql_jdbc_Driver]",
"jboss.driver-demander.java:jboss/datasources/vagasone-ds is missing [jboss.jdbc-driver.com_mysql_jdbc_Driver]"
]
}
16:01:17,890 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "projeto")
]) - failure description: {
"WFLYCTL0412: Required services that are not installed:" => [
"jboss.jdbc-driver.com_mysql_jdbc_Driver",
"jboss.jdbc-driver.com_mysql_jdbc_Driver"
],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"org.wildfly.data-source.projeto is missing [jboss.jdbc-driver.com_mysql_jdbc_Driver]",
"jboss.driver-demander.java:jboss/datasources/projeto-ds is missing [jboss.jdbc-driver.com_mysql_jdbc_Driver]",
"org.wildfly.data-source.projeto is missing [jboss.jdbc-driver.com_mysql_jdbc_Driver]"
]
}
16:01:17,935 INFO [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0184: New missing/unsatisfied dependencies:
service jboss.jdbc-driver.com_mysql_jdbc_Driver (missing) dependents: [service org.wildfly.data-source.projeto, service jboss.driver-demander.java:jboss/datasources/projeto-ds]
16:01:18,344 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
16:01:18,344 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
16:01:18,344 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 10.1.0.Final (WildFly Core 2.2.0.Final) started (with errors) in 3482ms - Started 332 of 583 services (4 services failed or missing dependencies, 394 services are lazy, passive or on-demand)
Já tentei de tudo, mas não nada resolveu :(
Alguém poderia me ajudar? Obrigado!