- install the database driver as a module
- create directory WILDFLY_HOME/modules/com/mariadb/main
$ mkdir -p modules/com/mariadb/main
- copy database driver into that one
$ cp ~/Downloads/mariadb-java-client-2.3.0.jar .
- Create the file module.xml in the same folder with the following content:
<module xmlns="urn:jboss:module:1.3" name="com.mariadb">
<resources>
<resource-root path="mariadb-java-client-2.3.0.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module> - start Wildfly
$ cd $WILDFLY_HOME/bin
$ ./standalone.sh - connect to http://localhost:9990/error/index.html
- run ./add-user.sh
[mrbear@localhost bin]$ ./add-user.sh
What type of user do you wish to add?
a) Management User (mgmt-users.properties)
b) Application User (application-users.properties)
(a): a
Enter the details of the new user to add.
Using realm 'ManagementRealm' as discovered from the existing property files.
Username : mrbear
Password recommendations are listed below. To modify these restrictions edit the add-user.properties configuration file.
- The password should be different from the username
- The password should not be one of the following restricted values {root, admin, administrator}
- The password should contain at least 8 characters, 1 alphabetic character(s), 1 digit(s), 1 non-alphanumeric symbol(s)
Password :
Re-enter Password :
What groups do you want this user to belong to? (Please enter a comma separated list, or leave blank for none)[ ]:
About to add user 'mrbear' for realm 'ManagementRealm'
Is this correct yes/no? yes
Added user 'mrbear' to file '/home/mrbear/wildfly-14.0.1.Final/standalone/configuration/mgmt-users.properties'
Added user 'mrbear' to file '/home/mrbear/wildfly-14.0.1.Final/domain/configuration/mgmt-users.properties'
Added user 'mrbear' with groups to file '/home/mrbear/wildfly-14.0.1.Final/standalone/configuration/mgmt-groups.properties'
Added user 'mrbear' with groups to file '/home/mrbear/wildfly-14.0.1.Final/domain/configuration/mgmt-groups.properties'
Is this new user going to be used for one AS process to connect to another AS process?
e.g. for a slave host controller connecting to the master or for a Remoting connection for server to server EJB calls.
yes/no? no - click on "Try again" on the Website
- log on with the new added user
- Configuration - Subsystems - Datasources and drivers - JDBC drivers - [+]
- Fill out the following information:
Driver name mariadb Driver Module Name com.mariadb Module Slot Driver Class Name org.mariadb.jdbc.Driver Drive Datasource Class Name Driver XA Datasource Class Name - Configuration - Subsystems - Datasources and drivers - Datasources - [+]
- Select "Add Datasource" to add a non-XA Datasource
- Select "Custom" template
- Attributes:
Name [name] JNDI Name java:/jdbc/[name] - JDBC Driver
Driver Name mariadb Driver Module Name [empty] Driver Class Name [empty] - Connection:
Connection URL jdbc:mariadb://localhost:3306/[databasename] User name root Password itsasecret Security Domain [empty] - Test connection
- Reload of server required - so reload the server
- Test connection: Successfully tested connection for datasource [name].
References
- JDBC Driver / DataSource Setup
- https://hal.gitbooks.io/dev/content/recipes/jdbc-driver-setup.html
- About MariaDB Connector/J
- https://mariadb.com/kb/en/library/about-mariadb-connector-j/
- GitHub - Use MariaDB Connector/J Driver
- https://github.com/MariaDB/mariadb-connector-j/blob/master/documentation/use-mariadb-connector-j-driver.creole
- IronJacamar 1.1 - Userguide - Deploying DS Descriptor
- http://www.ironjacamar.org/doc/userguide/1.1/en-US/html_single/index.html#deployingds_descriptor
No comments:
Post a Comment