How to install a module on WildFly / JBoss AS 7

Installing a module on WildFly / JBoss AS 7 requires creating a path under the JBOSS_HOME/modules folder. Under this path, you will install the JAR libraries which are part of the module and a module.xml file which describes the module itself and dependencies with other module.

Example: how to install Quartz library as a module

Create the following path under the JBOSS_HOME:

$ mkdir -p $JBOSS_HOME/modules/org/quartz/main

 Now include in the main folder the XML descriptor of the module (module.xml) and the JAR files. Here's a view of your modules structure:

This is a sample module.xml configuration for your module:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="org.quartz">
      <resource-root path="quartz-all-2.0.2.jar" />
      <module name="org.slf4j" />
      <module name="javax.api" />

This basically says that the module has a dependency on the other modules: org.slf4j (logging framework) and javax.api module.

Using properties in your module

Besides declaring dependencies, you can also specify some System Properties, so that they are loaded up when the module is available. Here's an example:

<module xmlns="urn:jboss:module:1.1" name="com.mymodule" >

        <property name="" value="property.value"/>

        <resource-root path="my-module-1.0.jar"/>


How to use a Module in your application

In order to use this module in your applications you have to trigger a dependency on the module. This can be done by adding into the META-INF/MANIFEST.MF file a Dependency [modulename]


Dependency: org.quartz						

How to define a global module

It is also possible to set up global modules, that are accessible to all deployments. This is done by modifying the configuration file (standalone/domain.xml).

For example, to add javassist to all deployments you can use the following XML in your standalone.xml/domain.xml

<subsystem xmlns="urn:jboss:domain:ee:1.0" >            
    <module name="org.javassist" slot="main" />            

Note that the slot field is optional and defaults to main.

If you want to learn more about modules installation, check out the next tutorial which shows how to install different releases of a module using module slots.

Related articles available on

JBoss AS 7 introduction

This is an introduction tutorial to the newest JBoss AS 7 which a

Develop Java EE applications with JBoss AS 7

In this tutorial we will learn how to create and deploy a Java EE

Adding users with JBoss AS 7

If you are planning to add new users to your management interface

Using JBoss AS 7 management API programmatically

In this tutorial we will show how to use detyped management API t

JNDI view in JBoss AS 7

JNDI can be checked on the naming subsystem of the application se

JBoss AS 7 classloading

JBoss AS 7 classloading explained As mandated by Java EE specifi

Follow us on Twitter