I am want to deploy an application with spring jpa using datasource from wildfly9, I think I have all configuration needed but I am getting an error.
What i have is
standalon.xml in subsystem
<datasource jndi-name="java:jboss/datasources/PostgreSQLDS"
jta="true" enabled="${postgresql.enabled}"
use-java-context="true"
pool-name="PostgreSQLDS"
use-ccm="true">
<connection-url>
jdbc:postgresql://${env.OPENSHIFT_POSTGRESQL_DB_HOST}:${env.OPENSHIFT_POSTGRESQL_DB_PORT}/${env.OPENSHIFT_APP_NAME}
</connection-url>
<driver>postgresql</driver>
<security>
<user-name>${env.OPENSHIFT_POSTGRESQL_DB_USERNAME}
</user-name>
<password>
${env.OPENSHIFT_POSTGRESQL_DB_PASSWORD}
</password>
</security>
<validation>
<check-valid-connection-sql>SELECT 1</check-valid-connection-sql>
<background-validation>true</background-validation>
<background-validation-millis>60000</background-validation-millis>
</validation>
<pool>
<flush-strategy>IdleConnections</flush-strategy>
</pool>
</datasource>
<drivers>
<driver name="postgresql" module="org.postgresql.jdbc">
<xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
</driver>
</drivers>
my spring.profile.xml has
<beans:bean id="dbDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<beans:property name="jndiName" value="java:jboss/datasources/PostgreSQLDS"/>
</beans:bean>
and the error i am getting is
[0m[31m08:57:40,995 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "ROOT.war")]) - failure description: {"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"jboss.persistenceunit.\"ROOT.war#my-jpa\".__FIRST_PHASE__ is missing [jboss.naming.context.java.\"\\n java:comp\".env.jdbc.\"PostgreSQLDS\\n \"]",
"jboss.persistenceunit.\"ROOT.war#my-jpa\" is missing [jboss.naming.context.java.\"\\n java:comp\".env.jdbc.\"PostgreSQLDS\\n \"]"
]}
I am not sure what i am doing bad, any help is welcome
Try this JNDI resource mapping with java:comp/env and you need datasource resource reference in your app using jboss-web.xml below.
<beans:bean id="dbDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<beans:property name="jndiName" value="java:comp/env/jdbc/PostgreSQLDS"/>
</beans:bean>
Add jboss-web.xml inside WEB-INF folder with this content
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web xmlns="http://www.jboss.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.jboss.com/xml/ns/javaee
http://www.jboss.org/j2ee/schema/jboss-web_5_1.xsd">
<context-root>/myAppRoot</context-root>
<resource-ref>
<res-ref-name>jdbc/PostgreSQLDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<jndi-name>java:jboss/datasources/PostgreSQLDS</jndi-name>
</resource-ref>
</jboss-web>
Related
Setting up connection to Oracle19C from Keycloak 12.0.3
Receiving message: "failure description: "WFLYJCA0041: Failed to load module for driver [com.oracle]"
I've relooked x100 and can't seem to find what is missing. Could any kind soul review the below for what I have missed?
JAR File path:
/modules/system/layers/keycloak/com/oracle/main
module.xml
ojdbc10.jar
standalone.xml
<datasource jndi-name="java:jboss/datasources/KeycloakDS" pool-name="KeycloakDS" enabled="true" use-java-context="true" statistics-enabled="${wildfly.datasources.statistics-enabled:${wildfly.statistics-enabled:false}}">
<connection-url>jdbc:oracle:thin:#DBURL:1521:SID</connection-url>
<driver>oracle</driver>
<pool>
<min-pool-size>5</min-pool-size>
<max-pool-size>100</max-pool-size>
<prefill>true</prefill>
<flush-strategy>IdleConnections</flush-strategy>
</pool>
<security>
<user-name>USER</user-name>
<password>PASSWORD</password>
</security>
<validation>
<valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker"/>
<check-valid-connection-sql>select 1 from dual</check-valid-connection-sql>
<background-validation>true</background-validation>
<stale-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleStaleConnectionChecker"/>
<exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter"/>
</validation>
<timeout>
<blocking-timeout-millis>5000</blocking-timeout-millis>
<idle-timeout-minutes>5</idle-timeout-minutes>
</timeout>
</datasource>
<driver name="oracle" module="com.oracle">
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
</driver>
module.xml
<?xml version=”1.0" ?><?xml version='1.0' encoding='UTF-8'?>
<module xmlns=”urn:jboss:module:1.3" name=”com.oracle”>
<resources>
<resource-root path=”ojdbc10.jar”/>
</resources>
<dependencies>
<module name=”javax.api”/>
<module name=”javax.transaction.api”/>
</dependencies>
</module>
I had this issue, and the only way I could solve it was to place the oracle driver in the keycloak/modules directory.
These did not work:
keycloak/modules/system/layers/keycloak/com/oracle It is here that is described in the KeyCloak documentation, and it worked for me for Postgres, but I could not get the oracle driver to load from here.
keycloak/modules/system/layers/base/com/oracle : Tried this out of desperation.
But this worked for me in:
keycloak/modules/com/oracle
keycloak/modules/com/oracle/main/module.xml
<?xml version='1.0' encoding='UTF-8'?>
<module xmlns="urn:jboss:module:1.1" name="com.oracle">
<resources>
<resource-root path="ojdbc8.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
And the ojdbc8.jar file was also in this directory.
NOTE: The name="com.oracle" has to match the path com/oracle in the module directory.
In the standalone.xml file, I added the following datasource.
<datasource jndi-name="java:jboss/datasources/KeycloakDS" pool-name="KeycloakDS" enabled="true" use-java-context="true">
<connection-url>jdbc:oracle:thin:#hostname:1521:SID</connection-url>
<driver>oraclejdbc</driver>
<pool>
<min-pool-size>1</min-pool-size>
<max-pool-size>20</max-pool-size>
</pool>
<security>
<user-name>user</user-name>
<password>password</password>
</security>
</datasource>
With the matching driver
<driver name="oraclejdbc" module="com.oracle">
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
</driver>
NOTE:
the module="com.oracle" matches the path com/oracle.
the driver name="oraclejdbc" matches the <driver>oraclejdbc</driver> element.
Once working, I saws this in the log.
2021-05-31 14:46:17,376 INFO [org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory] (ServerService Thread Pool -- 60) Database info: {databaseUrl=jdbc:oracle:thin:#server:1521:SID, databaseUser=user, databaseProduct=Oracle Oracle Database 19c Standard Edition 2 Release 19.0.0.0.0 - Production
Version 19.10.0.0.0, databaseDriver=Oracle JDBC driver 19.3.0.0.0}
But prior to it working I would see the following errors in the log (which I am including, incase people are googling the error message)
2021-05-31 14:47:12,049 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 50) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("jdbc-driver" => "oraclejdbc")
]) - failure description: "WFLYJCA0115: Module for driver [com.oracle] or one of it dependencies is missing: [com.oracle]"
Or this error
2021-05-31 14:47:14,962 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "KeycloakDS")
]) - failure description: {
"WFLYCTL0412: Required services that are not installed:" => ["jboss.jdbc-driver.oraclejdbc"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"org.wildfly.data-source.KeycloakDS is missing [jboss.jdbc-driver.oraclejdbc]",
"jboss.driver-demander.java:jboss/datasources/KeycloakDS is missing [jboss.jdbc-driver.oraclejdbc]"
]
}
Adde module via commandline.
module add --name=oracle.jdbc --resources=customization/ojdbc10.jar --dependencies=javax.transaction.api
Created under the following structure:
-keycloak
--modules
----oracle
------jdbc
--------main
----------module.xml
----------ojdbc10.jar
I have a ejb-based application deployed initially in jboss AS 5.0 that i'm upgrading to wildfly 20, the problem is that i cant resolve correctly the datasources defined in web.xml in the datasource section in standalone.xml
<resource-ref>
<res-ref-name>Midd2</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<mapped-name>jdbc/SybaseDB</mapped-name>
</resource-ref>
<resource-ref>
<res-ref-name>Midd</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<mapped-name>jdbc/SybaseDS2</mapped-name>
</resource-ref>
My datasources in standalone.xml
<datasource jndi-name="java:/jdbc/SybaseDB" pool-name="SybaseDB">
<connection-url>jdbc:sybase:XXXX.XXXX.XXXX.XXXX/database</connection-url>
<driver-class>com.sybase.jdbc3.jdbc.SybDriver</driver-class>
<driver>
jconn3.jar
</driver>
<security>
<user-name>x</user-name>
<password>y</password>
</security>
<pool>
<min-pool-size>1</min-pool-size>
<max-pool-size>5</max-pool-size>
</pool>
</datasource>
<datasource jndi-name="java:/jdbc/SybaseDS2" pool-name="SybaseDS2">
<connection-url>jdbc:sybase:XXXX.XXXX.XXXX.XXXX/database</connection-url>
<driver-class>com.sybase.jdbc3.jdbc.SybDriver</driver-class>
<driver>
jconn3.jar
</driver>
<security>
<user-name>x</user-name>
<password>y</password>
</security>
<pool>
<min-pool-size>1</min-pool-size>
<max-pool-size>5</max-pool-size>
</pool>
</datasource>
But i'm getting
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"jboss.naming.context.java.module.Midd.Midd.env.Midd2 is missing [jboss.naming.context.java.module.Midd.Midd.env.jdbc.SybaseDB]",
"jboss.naming.context.java.module.Midd.Midd.env.Midd is missing [jboss.naming.context.java.module.Midd.Midd.env.jdbc.SybaseDS2]"
]
I've read a lot of docs in google but nothing that could help
Have you tried using the annotation to inject the data source?
#Resource(name = "jdbc/SybaseDB")
private DataSource dataSource1;
#Resource(name = "jdbc/SybaseDS2")
private DataSource dataSource2;
Where do you put the jconn3.jar?
I'm trying to connect my project to a Database(with Mysql workbench). I have two files:
persistence.xml:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.2"
xmlns="http://xmlns.jcp.org/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://
xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd">
<persistence-unit name="dogs-breeds-jee" transaction-type="JTA">
<jta-data-source>java:jboss/datasources/dogsBreedsEeDS</jta-data-source>
<class>domain.Breed</class>
<exclude-unlisten-classes>true</exclude-unlisten-classes>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL8Dialect"/>
<property name="hibernate.hbm2ddl.auto" value="create"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>
<property name="hibernate.use_sql_comments" value="true"/>
<property name="hibernate.default_batch_fetch_size" value="16"/>
<property name="hibernate.jdbc.batch_size" value="100"/>
<property name="hibernate.order_updates" value="true"/>
<property name="hibernate.id.new_generator_mappings" value="true"/>
</properties>
</persistence-unit>
</persistence>
and an .xml for my datasource:
<?xml version="1.0" encoding="UTF-8"?>
<datasources xmlns ="http://www.jboss.org/ironjacamar/schema"
xmlns:xsi ="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation ="
http://www.jboss.org/ironjacamar/schema
http://docs.jboss.org/ironjacamar/schema/datasources_1_0.xsd">
<datasource jndi-name="java:jboss/datasources/dogsBreedsEeDS" enabled="true" use-java-context ="true" pool-name="dogsBreedsEeDS">
<connection-url> jdbc:mysql://localhost:3306/java-ee-schema?serverTimezone=UTC</connection-url>
<driver> com.mysql.jdbc.Driver </driver>
<security>
<user-name> java--client </user-name>
<password> password </password>
</security>
</datasource>
</datasources>
I've done the mapping in my model and if everything is okay it should create a db in my java-ee-schema right?
but I'm getting these errors when I run my WildFly server:
658 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 44) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("jdbc-driver" => "mysql")
]) - failure description: "WFLYJCA0041: Failed to load module for driver [com.mysql]"
799 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "dogs-breeds-jee-ds.xml")]) - failure description: {
"WFLYCTL0412: Required services that are not installed:" => ["jboss.jdbc-driver.com_mysql_jdbc_Driver"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => ["jboss.data-source.\"jboss.naming.context.java.jboss.datasources.dogsBreedsEeDS\" is missing [jboss.jdbc-driver.com_mysql_jdbc_Driver]"]
}
946 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 20.0.1.Final (WildFly Core 12.0.3.Final) started (with errors) in 6638ms - Started 454 of 688 services (3 services failed or missing dependencies, 378 services are lazy, passive or on-demand)
Can someone tell me why is this happening? Am I doing something wrong?
Thanks a lot
You need to define your driver in the configuration. The "driver" tag doesn't target a class but a name in wildfly configuration.
I am trying to use postgres with keycloak. following Doc
$ ls keycloak-9.0.0/modules/system/layers/keycloak/org/postgresql/main
config.xml postgresql-42.2.10.jar
This is the config.xml file.
config.xml
<?xml version="1.0" ?>
<module xmlns="urn:jboss:module:1.3" name="org.postgresql">
<resources>
<resource-root path="postgresql-42.2.10.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
These are the changes that i have made in standalone.xml
standalone.xml
<datasources>
<datasource jndi-name="java:jboss/datasources/KeycloakDS" pool-name="KeycloakDS" enabled="true" use-java-context="true">
<connection-url>jdbc:postgresql://localhost:5432/test</connection-url>
<driver>postgresql</driver>
<pool>
<max-pool-size>20</max-pool-size>
</pool>
<security>
<user-name>postgres</user-name>
<password>StrongPassword</password>
</security>
</datasource>
<drivers>
<driver name="postgresql" module="org.postgresql">
<xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
<default-bindings context-service="java:jboss/ee/concurrency/context/default" datasource="java:jboss/datasources/KeycloakDS">
The error i am getting.
error
06:13:39,430 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 32) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("jdbc-driver" => "postgresql")
]) - failure description: "WFLYJCA0115: Module for driver [org.postgresql] or one of it dependencies is missing: [org.postgresql]"
How can i resolve this?
Can I suggest another way to configure this that is less likely to have an issue? I use the following to configure PostgreSQL and Keycloak and it has been working well. The key is to run this against a stopped Keycloak (using a fresh install). Save the below to something like setup-keycloak.cli:
embed-server --server-config=standalone.xml --std-out=echo
batch
#
# remove the default provided datasource
#
/subsystem=datasources/data-source=KeycloakDS/:remove
#
# add them
#
module add --name=org.postgres --resources=/path/to/postgresql-42.2.10.jar --dependencies=javax.api,javax.transaction.api
/subsystem=datasources/jdbc-driver=postgres:add(driver-name="postgres",driver-module-name="org.postgres",driver-class-name=org.postgresql.Driver)
/subsystem=datasources/data-source=KeycloakDS/:add(connection-url=jdbc:postgresql://localhost:5432/keycloak_database,driver-name=postgres,jndi-name=java:jboss/datasources/KeycloakDS,initial-pool-size=4,max-pool-size=64,min-pool-size=4,password=keycloak_user,user-name=keycloak_pass)
run-batch
Then run this with $KEYCLOAK_HOME/bin/jboss.sh --file=setup-keycloak.cli. This removes the KeycloakDS datasource, adds the PostgreSQL module, and recreates the KeycloakDS datasource with your parameters. You can use this to reproduce the configuration any time as long as you have a local copy of the PostgreSQL JDBC driver.
I think your problem is that you named the settings config.xml and should be module.xml.
Second you have to download postgresql jar to that location:
curl -O https://jdbc.postgresql.org/download/postgresql-X.X.X.jar > /opt/keycloak/modules/system/layers/keycloak/org/postgresql/main
just replace the X.X.X with your version.
Then restart the server.
PS: you should use a vault for your password.
This works for me.
create PostgreSQL module.xml (not config.xml) inside base directory (keycloak-11.0.2/modules/system/layers/base/com/postgresql/)
update standalone.xml
<datasource jndi-name="java:jboss/datasources/KeycloakDS" pool-name="KeycloakDS" enabled="true" use-java-context="true"
statistics-enabled="${wildfly.datasources.statistics-enabled:${wildfly.statistics-enabled:false}}">
<connection-url>jdbc:postgresql://localhost:5432/keycloak</connection-url>
<driver>postgresql</driver>
<security>
<user-name>db-user</user-name>
<password>db-pass</password>
</security>
</datasource>
<drivers>
<driver name="postgresql" module="com.postgresql.h2">
<driver-class>org.postgresql.Driver</driver-class>
<xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
</driver>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
</drivers>
This works for me in standalone:
In file module.xml
<module xmlns="urn:jboss:module:1.3" name="org.postgresql">
<resources>
<resource-root path="postgresql-42.2.23.jar" />
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
2.In file standalone.xml
<datasources>
<datasource jndi-name="java:jboss/datasources/KeycloakDS"
pool-name="KeycloakDS"
enabled="true"
use-java-context="true"
statistics-enabled="${wildfly.datasources.statistics-enabled:${wildfly.statistics-enabled:false}}" >
<connection-url>jdbc:postgresql://192.168.1.XX:5432/Your-DataBase</connection-url>
<driver>postgresql</driver>
<pool>
<max-pool-size>20</max-pool-size>
</pool>
<security>
<user-name>UserName</user-name>
<password>**********</password>
</security>
<statement>
<prepared-statement-cache-size>32</prepared-statement-cache-size>
<share-prepared-statements>true</share-prepared-statements>
</statement>
</datasource>
<drivers>
<driver name="postgresql" module="org.postgresql">
<xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
3.in file standalone.xml
<default-bindings
context-service="java:jboss/ee/concurrency/context/default"
datasource="java:jboss/datasources/KeycloakDS"
managed-executor-service="java:jboss/ee/concurrency/executor/default"
managed-scheduled-executor-service="java:jboss/ee/concurrency/scheduler/default"
managed-thread-factory="java:jboss/ee/concurrency/factory/default"/>
For those who came here from tutorials with Dockerized jboss/keycloak instance, you have built-in rdbms support without any configuration: https://hub.docker.com/r/jboss/keycloak/
docker run -p 8080:8080 -e KEYCLOAK_USER=kuser -e KEYCLOAK_PASSWORD=kpass -e DB_VENDOR=postgres -e DB_ADDR=host:port -e DB_DATABASE=postgres -e DB_USER=pguser -e DB_PASSWORD=pgpass jboss/keycloak:15.0.2
I've got some issues with MySQL module my local JBoss.
In $JBOSS_HOME I created com/mysql/main
There, I dropped mysql-connector-java-5.1.26-bin.jar and module.xml
I then configured my datasource.
In the Netbeans project, persistence.xml was configured as attached via the Persistence Unit wizard and Netbeans automatically recognizes the configured datasource which is cool.
The issue now is that when I want to "Create Entity Classes From Database", I get this error.
I've checked all over the web. I think I have a good config but this error still persists.
Netbeans: 7.3.1; Mysql connector: 5.1.26; App Server: JBoss EAP 6.1.0; Mysql: 5.6.14; Windows 7; Java 7
Kindly advise.
Thanks.
In $JBOSS_HOME I created com/mysql/main There, I dropped mysql-connector-java-5.1.26-bin.jar and module.xml
Can you make sure the folder is under $JBOSS_HOME/modules location
I found answer today,
just set driver-class and driver the same name
com.mysql.jdbc.Driver
<driver-class>com.mysql.jdbc.Driver</driver-class>
<driver>com.mysql.jdbc.Driver</driver>
<pool>
<min-pool-size>10</min-pool-size>
<max-pool-size>100</max-pool-size>
<use-strict-min>true</use-strict-min>
<flush-strategy>IdleConnections</flush-strategy>
</pool>
<security>
<user-name>root</user-name>
<password>root</password>
</security>
And also create jboss-ds xml file and put it into -ejb\src\main\setup
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<datasource jta="false" jndi-name="java:/MysqlDS" pool-name="MysqlDS" enabled="true" use-ccm="false" statistics-enabled="false">
<connection-url>jdbc:mysql://localhost:3306/dmbs?zeroDateTimeBehavior=convertToNull&useUnicode=yes&characterEncoding=UTF-8</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<driver>com.mysql.jdbc.Driver</driver>
<pool>
<min-pool-size>10</min-pool-size>
<max-pool-size>100</max-pool-size>
<use-strict-min>true</use-strict-min>
<flush-strategy>IdleConnections</flush-strategy>
</pool>
<security>
<user-name>root</user-name>
<password>root</password>
</security>
<validation>
<validate-on-match>false</validate-on-match>
<background-validation>false</background-validation>
</validation>
<timeout>
<set-tx-query-timeout>false</set-tx-query-timeout>
<blocking-timeout-millis>0</blocking-timeout-millis>
<idle-timeout-minutes>3</idle-timeout-minutes>
<query-timeout>0</query-timeout>
<use-try-lock>0</use-try-lock>
<allocation-retry>0</allocation-retry>
<allocation-retry-wait-millis>0</allocation-retry-wait-millis>
</timeout>
<statement>
<track-statements>true</track-statements>
<share-prepared-statements>false</share-prepared-statements>
</statement>
</datasource>
</datasources>
and my standalone.xml config
<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="false" jndi-name="java:/MysqlDS" pool-name="MysqlDS" enabled="true" use-ccm="false" statistics-enabled="false">
<connection-url>jdbc:mysql://localhost:3306/dmbs?zeroDateTimeBehavior=convertToNull&useUnicode=yes&characterEncoding=UTF-8</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<driver>com.mysql.jdbc.Driver</driver>
<pool>
<min-pool-size>10</min-pool-size>
<max-pool-size>100</max-pool-size>
<use-strict-min>true</use-strict-min>
<flush-strategy>IdleConnections</flush-strategy>
</pool>
<security>
<user-name>root</user-name>
<password>root</password>
</security>
<validation>
<validate-on-match>false</validate-on-match>
<background-validation>false</background-validation>
</validation>
<timeout>
<set-tx-query-timeout>false</set-tx-query-timeout>
<blocking-timeout-millis>0</blocking-timeout-millis>
<idle-timeout-minutes>3</idle-timeout-minutes>
<query-timeout>0</query-timeout>
<use-try-lock>0</use-try-lock>
<allocation-retry>0</allocation-retry>
<allocation-retry-wait-millis>0</allocation-retry-wait-millis>
</timeout>
<statement>
<track-statements>true</track-statements>
<share-prepared-statements>false</share-prepared-statements>
</statement>
</datasource>
<drivers>
<driver name="com.mysql.jdbc.Driver" module="com.mysql.jdbc">
<driver-class>com.mysql.jdbc.Driver</driver-class>
<!-- <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>-->
</driver>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
My module.xml file in
C:\wildfly-9.0.0\modules\system\layers\base\com\mysql\jdbc\main
and near mysql driver jar
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="com.mysql.jdbc">
<resources>
<resource-root path="mysql-connector-java-5.1.32-bin.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>