To create a new module, we must follow the WildFly patterns. This mechanism creates a single default location under which modules can be located easily. For this, access the base
directory under /opt/server/wildfly-8.0.0.CR1/modules/system/layers/
.
So, within the subdirectory com
, let's create the necessary structure for the MySQL module installation as follows:
[root@wfly_book main]# mkdir -p com/mysql/jdbc/main
The directory does not need to be exactly like this; however, for easy identification of a module, we follow the package hierarchy. For example, a module that has the following hierarchy com.spolti.modules.MyModule.class
would look like this com/spolti/modules/main
.
This is not a rule, but rather a standard that is adopted within the hierarchy of the WildFly modules. The directory structure of a new module can be named the way you want, but it is not a good practice. So, let's proceed with the configuration.
Copy the MySQL JAR into the directory...