简体   繁体   中英

How to setup MariaDB datasource in Wildfly with CLI

I'm really new to Wildfly and probably this is a dumb question. I'm trying to configurate the MariaDB datasource with the CLI. The script I'm using is:

module add --name=org.mariadb.jdbc --resources=mariadb-java-client-1.5.5.jar --dependencies=javax.api.javax.transaction.api

/subsystem=datasources/jdbc-driver=org.mariadb.jdbc.Driver:add(driver-name=org.mariadb.jdbc.Driver,driver-module-name=org.mariadb.jdbc)

data-source add --jndi-name=java:/datasources/MariaDBS --name=MariaDBPool --connection-url=jdbc:mariadb://localhost:3306/exampledb --driver-name=org.mariadb.jdbc --user-name=root --password=root

The error I'm getting is:

{
    "outcome" => "failed",
    "failure-description" => "WFLYJCA0041: Failed to load module for driver [org.mariadb.jdbc]",
    "rolled-back" => true
}

The code is similar to MySQL setting I have found in the internet. I tried to modified it to use MariaDB instead. Any help will be appreciate. Also my original jar is in /bin and I'm using Wildfly 10.1.0

Please change:

  1. --dependencies=javax.api.javax.transaction.api to --dependencies=javax.api,javax.transaction.api

  2. --driver-name=org.mariadb.jdbc to --driver-name=org.mariadb.jdbc.Driver

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM