Featured resource
Tech Upskilling Playbook 2025
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Learn more
  • Labs icon Lab
  • Cloud
Google Cloud Platform icon
Labs

Adding a Module to JBoss EAP

The JBoss Enterprise Application Platform provides extensive support for deploying and managing Java-based applications. Part of this support includes the ability to add and create modules, which in turn opens up additional functionality for your application — such as allowing the option to connect to a MySQL database, as in this lab.

Google Cloud Platform icon
Labs

Path Info

Level
Clock icon Beginner
Duration
Clock icon 15m
Last updated
Clock icon Aug 29, 2025

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Download Module Drivers

    1. Download the MySQL JDBC connector:

      wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.18.tar.gz
      
    2. Extract the contents:

      tar xf mysql-connector-java-8.0.18.tar.gz
      
  2. Challenge

    Create Module

    1. Move into the modules directory:

      cd /opt/jboss-eap/modules
      
    2. Create com directory to store local, non-system modules:

      sudo mkdir com
      
    3. We can now create the mysql module directory underneath this; each module stores all required configurations and JAR files in a required main directory, so create this, too:

      sudo mkdir -p com/mysql/main
      
    4. Move the downloaded .jar file into this new directory:

      sudo mv ~/mysql-connector-java-8.0.18/mysql-connector-java-8.0.18.jar com/mysql/main/
      
  3. Challenge

    Create .xml File

    Within the main directory for the mysql module, create a module.xml file to configure the MySQL JDBC diver. Note that the name of the module must mimic the directory structure — in this case, it should be com.mysql:

    sudo vim com/mysql/main/module.xml
    
    <?xml version="1.0" ?>
    <module xmlns="urn:jboss:module:1.1" name="com.mysql">
      <resources>
        <resource-root path="mysql-connector-java-8.0.18.jar"/>
      </resources>
      <dependencies>
        <module name="javax.api"/>
        <module name="javax.transaction.api"/>
      </dependencies>
    </module>
    

    Note that the dependencies provided are system modules, found in /opt/jboss-eap/modules/system/layers/base/javax/.

  4. Challenge

    Add as a Global Module

    1. Open the management CLI:

      cd ..
      sudo ./bin/jboss-cli.sh
      
    2. Connect:

      connect
      
    3. Add the module to global modules, under the EE subsystem:

      /subsystem=ee:list-add(name=global-modules,value={name=com.mysql})
      
    4. We can check that the module has been added by logging in to the Management Console at PUBLICIP:9990 using the username admin and the password pinehead. Select Start, under Configuration, then select Subsystems from the menu. View the EE subsystem. Select Global Modules -- the com.mysql module should be listed.

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

What's a lab?

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Provided environment for hands-on practice

We will provide the credentials and environment necessary for you to practice right within your browser.

Guided walkthrough

Follow along with the author’s guided walkthrough and build something new in your provided environment!

Did you know?

On average, you retain 75% more of your learning if you get time for practice.