I am trying to deploy a WildFly KeyCloak Server in standalone
Mode. This works fine when I just do nothing but now I want to add a Datasource
of MySQL
.
Therefore I have to add a driver i am using the: mysql-connector-java-8.0.20.jar
.
To add the driver I put it inside /modules/com/mysql/main/
. Then I add a module.xml
file:
<module xmlns="urn:jboss:module:1.1" name="com.mysql">
<resources>
<resource-root path="mysql-connector-java-8.0.20.jar"/>
</resources>
<dependencies>
<module name="javax.api">
<module name="javax.transaction.api"/>
</dependencies>
</module>
Then I add the follwing in the standalone.xml
:
<driver name="mysql" module="com.mysql">
<xa-datasource-class>com.mysql.cj.jdbc.MysqlXADataSource</xa-datasource-class>
</driver>
When I then deploy the Server with the standalone.bat
I get following error:
16:57:43,962 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 32) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("jdbc-driver" => "mysql")
]) - failure description: "WFLYJCA0041: Failed to load module for driver [com.mysql]"
Cheers !!