Red Hat Jboss Enterprise Application Platform-7.4-Configuration Guide-En-us
Red Hat Jboss Enterprise Application Platform-7.4-Configuration Guide-En-us
Red Hat Jboss Enterprise Application Platform-7.4-Configuration Guide-En-us
Platform 7.4
Configuration Guide
Instructions for setting up and maintaining Red Hat JBoss Enterprise Application
Platform, including running applications and services.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons
Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is
available at
http://creativecommons.org/licenses/by-sa/3.0/
. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must
provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert,
Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift,
Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States
and other countries.
Linux ® is the registered trademark of Linus Torvalds in the United States and other countries.
XFS ® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States
and/or other countries.
MySQL ® is a registered trademark of MySQL AB in the United States, the European Union and
other countries.
Node.js ® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the
official Joyent Node.js open source or commercial project.
The OpenStack ® Word Mark and OpenStack logo are either registered trademarks/service marks
or trademarks/service marks of the OpenStack Foundation, in the United States and other
countries and are used with the OpenStack Foundation's permission. We are not affiliated with,
endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
Abstract
The purpose of this guide is to cover many of the configuration tasks needed for setting up and
maintaining JBoss EAP as well as running applications and other services on it.
Table of Contents
Table of Contents
. . . . . . . . . . . . . FEEDBACK
PROVIDING . . . . . . . . . . . . ON
. . . .RED
. . . . .HAT
. . . . .DOCUMENTATION
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22
..............
. . . . . . . . . .OPEN
MAKING . . . . . . SOURCE
. . . . . . . . . .MORE
. . . . . . .INCLUSIVE
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23
..............
. . . . . . . . . . . 1.. .INTRODUCTION
CHAPTER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24
..............
.CHAPTER
. . . . . . . . . . 2.
. . STARTING
. . . . . . . . . . . .AND
. . . . .STOPPING
. . . . . . . . . . . .JBOSS
. . . . . . . EAP
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25
..............
2.1. STARTING JBOSS EAP 25
Start JBoss EAP as a Standalone Server 25
Start JBoss EAP in a Managed Domain 25
2.2. STOPPING JBOSS EAP 26
Stop an Interactive Instance of JBoss EAP 26
Stop a Background Instance of JBoss EAP 26
2.3. RUNNING JBOSS EAP IN ADMIN-ONLY MODE 26
Running a Standalone Server in Admin-only Mode 26
Start the Server in Admin-only Mode 26
Check If the Server is Running in Admin-only Mode 26
Reload in a Different Mode from the Management CLI 27
Running a Managed Domain in Admin-only Mode 27
Start a Host Controller in Admin-only Mode 27
Check If a Host Controller is Running in Admin-only Mode 27
Reload in a Different Mode from the Management CLI 27
2.4. SUSPEND AND SHUT DOWN JBOSS EAP GRACEFULLY 27
2.4.1. Suspend Servers 29
Check the Server Suspend State 29
Suspend 29
Resume 29
Start a Server in a Suspended State 30
2.4.2. Shut Down Servers Gracefully Using the Management CLI 30
2.4.3. Shut Down Servers Gracefully Using an OS Signal 31
2.5. STARTING AND STOPPING JBOSS EAP (RPM INSTALLATION) 31
2.5.1. Starting JBoss EAP (RPM Installation) 31
Start JBoss EAP as a Standalone Server (RPM Installation) 31
Start JBoss EAP in a Managed Domain (RPM Installation) 32
Configure RPM Service Properties 32
2.5.2. Stopping JBoss EAP (RPM Installation) 33
Stop JBoss EAP as a Standalone Server (RPM Installation) 33
Stop JBoss EAP in a Managed Domain (RPM Installation) 33
2.6. POWERSHELL SCRIPTS (WINDOWS SERVER) 34
.CHAPTER
. . . . . . . . . . 3.
. . JBOSS
. . . . . . . . EAP
. . . . .MANAGEMENT
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35
..............
3.1. ABOUT SUBSYSTEMS, EXTENSIONS, AND PROFILES 35
Using the Management Console or the Management CLI 35
3.2. MANAGEMENT USERS 35
3.2.1. Adding a Management User 36
3.2.2. Running the Add-User Utility Non-Interactively 36
Create a User Belonging to Multiple Groups 37
Specify an Alternative Properties File 37
3.2.3. Add-User Utility Password Restrictions 37
3.2.4. Updating a Management User 39
3.3. OPTIMIZING THE JBOSS EAP SERVER CONFIGURATION 40
3.4. MANAGEMENT INTERFACES 40
1
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
2
Table of Contents
.CHAPTER
. . . . . . . . . . 4.
. . .NETWORK
. . . . . . . . . . .AND
. . . . . PORT
. . . . . . .CONFIGURATION
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
..............
4.1. INTERFACES 81
4.1.1. Default Interface Configurations 81
4.1.2. Configuring Interfaces 81
Add an Interface with a NIC Value 82
Add an Interface with Several Conditional Values 82
Update an Interface Attribute 82
Add an Interface to a Server in a Managed Domain 82
4.2. SOCKET BINDINGS 83
4.2.1. Management Ports 83
4.2.2. Default Socket Bindings 84
Standalone Server 84
Managed Domain 84
4.2.3. Configuring Socket Bindings 86
4.2.4. Viewing Socket Bindings and Open Ports for a Server 86
4.2.5. Port Offsets 87
4.3. IPV6 ADDRESSES 87
Configure the JVM Stack for IPv6 Addresses 87
Update Interface Declarations for IPv6 Addresses 88
. . . . . . . . . . . 5.
CHAPTER . . JBOSS
. . . . . . . . EAP
. . . . .SECURITY
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .89
..............
. . . . . . . . . . . 6.
CHAPTER . . .JBOSS
. . . . . . . EAP
. . . . . CLASS
. . . . . . . .LOADING
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .90
..............
6.1. MODULES 90
Static Modules 90
Dynamic Modules 91
Predefined Modules 91
6.2. MODULE DEPENDENCIES 91
Optional Dependencies 92
Export a Dependency 92
Global Modules 92
6.3. CREATE A CUSTOM MODULE 92
3
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
. . . . . . . . . . . 7.
CHAPTER . . DEPLOYING
. . . . . . . . . . . . . .APPLICATIONS
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .102
...............
7.1. DEPLOYING APPLICATIONS USING THE MANAGEMENT CLI 102
7.1.1. Deploy an Application to a Standalone Server Using the Management CLI 102
Deploy an Application 102
Undeploy an Application 103
Disable an Application 103
Enable an Application 103
List Deployments 103
7.1.2. Deploy an Application in a Managed Domain Using the Management CLI 104
Deploy an Application 104
Undeploy an Application 104
Disable an Application 105
Enable an Application 105
List Deployments 105
7.2. DEPLOYING APPLICATIONS USING THE MANAGEMENT CONSOLE 106
7.2.1. Deploy an Application to a Standalone Server Using the Management Console 106
Deploy an Application 106
Undeploy an Application 106
Disable an Application 106
Replace an Application 106
7.2.2. Deploy an Application in a Managed Domain Using the Management Console 106
Add an Application 107
Deploy an Application to a Server Group 107
Undeploy an Application from a Server Group 107
Remove an Application 107
Disable an Application 107
Replace an Application 107
7.3. DEPLOYING APPLICATIONS USING THE DEPLOYMENT SCANNER 108
7.3.1. Deploy an Application to a Standalone Server Using the Deployment Scanner 108
Deploy an Application 108
Undeploy an Application 108
Redeploy an Application 109
7.3.2. Configure the Deployment Scanner 109
Disable the Deployment Scanner 109
Change the Scan Interval 109
Change the Deployment Folder 109
Enable the Automatic Deployment of Exploded Content 109
Disable the Automatic Deployment of Zipped Content 109
4
Table of Contents
. . . . . . . . . . . 8.
CHAPTER . . .DOMAIN
. . . . . . . . .MANAGEMENT
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .124
...............
8.1. ABOUT MANAGED DOMAINS 124
8.1.1. About the Domain Controller 125
8.1.2. About Host Controllers 125
8.1.3. About Process Controllers 126
8.1.4. About Server Groups 126
8.1.5. About Servers 126
8.2. NAVIGATING DOMAIN CONFIGURATIONS 126
Management Console 126
Management CLI 127
8.3. LAUNCHING A MANAGED DOMAIN 128
8.3.1. Start a Managed Domain 128
Start the Domain Controller 128
5
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
.CHAPTER
. . . . . . . . . . 9.
. . .CONFIGURING
. . . . . . . . . . . . . . . JVM
. . . . . .SETTINGS
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .148
...............
9.1. CONFIGURING JVM SETTINGS FOR A STANDALONE SERVER 148
9.2. CONFIGURING JVM SETTINGS FOR A MANAGED DOMAIN 149
9.2.1. Defining JVM Settings on a Host Controller 149
9.2.2. Applying JVM Settings to a Server Group 149
9.2.3. Applying JVM Settings to an Individual Server 150
9.3. DISPLAYING THE JVM STATUS 150
9.4. TUNING THE JVM 151
6
Table of Contents
.CHAPTER
. . . . . . . . . . 10.
. . . MAIL
. . . . . . SUBSYSTEM
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
...............
10.1. CONFIGURING THE MAIL SUBSYSTEM 152
Configuring SMTP server for use in an application 152
10.2. CONFIGURING CUSTOM TRANSPORTS 152
10.3. USE A CREDENTIAL STORE FOR PASSWORDS 154
.CHAPTER
. . . . . . . . . . 11.
. . .LOGGING
. . . . . . . . . . .WITH
. . . . . .JBOSS
. . . . . . . EAP
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
...............
11.1. ABOUT SERVER LOGGING 155
11.1.1. Server Logging 155
11.1.2. Bootup Logging 155
11.1.2.1. View Bootup Errors 155
Examine the Server Log File 156
Read the Boot Errors from the Management CLI 156
11.1.3. Garbage Collection Logging 157
11.1.4. Default Log File Locations 157
11.1.5. Set the Default Locale of the Server 158
Set the Language 158
Set the Language and Country 158
Set the Server Locale Using the org.jboss.logging.locale Property 158
11.2. VIEWING LOG FILES 159
View Logs from the Management Console 159
View Logs from the Management CLI 159
11.3. ABOUT THE LOGGING SUBSYSTEM 160
11.3.1. Root Logger 160
11.3.2. Log Categories 161
11.3.3. Log Handlers 161
Log Handler Types 161
11.3.4. Log Levels 162
Supported Log Levels 162
11.3.5. Log Formatters 163
Pattern Formatter 164
JSON Formatter 164
XML Formatter 164
Custom Formatter 164
11.3.6. Filter Expressions 164
11.3.7. Implicit Logging Dependencies 166
11.4. CONFIGURING LOG CATEGORIES 166
Add a Log Category 166
Configure Log Category Settings 167
Assign a Handler 167
Remove a Log Category 167
11.5. CONFIGURING LOG HANDLERS 167
11.5.1. Configure a Console Log Handler 168
Add a Console Log Handler 168
Configure Console Log Handler Settings 168
Assign the Console Log Handler to a Logger 169
Remove a Console Log Handler 169
11.5.2. Configure a File Log Handler 170
Add a File Log Handler 170
Configure File Log Handler Settings 170
Assign the File Log Handler to a Logger 171
Remove a File Log Handler 171
11.5.3. Configure a Periodic Rotating Log Handler 171
7
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
8
Table of Contents
.CHAPTER
. . . . . . . . . . 12.
. . . DATASOURCE
. . . . . . . . . . . . . . . .MANAGEMENT
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .198
...............
12.1. ABOUT JBOSS EAP DATASOURCES 198
About JDBC 198
Supported Databases 198
Datasource Types 198
The ExampleDS datasource 198
12.2. JDBC DRIVERS 198
12.2.1. Installing a JDBC Driver as a Core Module 198
12.2.1.1. Add the JDBC Driver as a Core Module 199
12.2.1.2. Register the JDBC Driver 199
12.2.2. Installing a JDBC Driver as a JAR Deployment 200
Update a JDBC Driver JAR to be JDBC 4-Compliant 201
12.2.3. JDBC Driver Download Locations 201
12.2.4. Access Vendor-Specific Classes 202
Using the MANIFEST.MF File 202
Using a jboss-deployment-structure.xml File 203
12.3. CREATING DATASOURCES 203
12.3.1. Create a Non-XA Datasource 203
Defining a Non-XA Datasource Using the Management Console 203
Defining a Non-XA Datasource Using the Management CLI 204
Datasource Parameters 204
12.3.2. Create an XA Datasource 205
Defining an XA Datasource Using the Management Console 205
Defining an XA Datasource Using the Management CLI 205
Datasource Parameters 206
12.4. MODIFYING DATASOURCES 206
12.4.1. Modify a Non-XA Datasource 206
12.4.2. Modify an XA Datasource 207
12.5. REMOVING DATASOURCES 207
12.5.1. Remove a Non-XA Datasource 207
12.5.2. Remove an XA Datasource 208
12.6. TESTING DATASOURCE CONNECTIONS 208
Test a Datasource Connection Using the Management CLI 208
Test a Datasource Connection Using the Management Console 208
12.7. FLUSHING DATASOURCE CONNECTIONS 209
12.8. XA DATASOURCE RECOVERY 209
12.8.1. Configuring XA Recovery 210
12.8.2. Vendor-Specific XA Recovery 210
Vendor-Specific Configuration 210
Known Issues 211
12.9. DATABASE CONNECTION VALIDATION 213
12.10. DATASOURCE SECURITY 215
Secure a Datasource Using a Security Domain 215
9
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
10
Table of Contents
. . . . . . . . . . . 13.
CHAPTER . . . DATASOURCE
. . . . . . . . . . . . . . . .MANAGEMENT
. . . . . . . . . . . . . . . .WITH
. . . . . .AGROAL
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .253
...............
13.1. ABOUT THE AGROAL DATASOURCES SUBSYSTEM 253
13.2. ENABLING THE AGROAL DATASOURCES SUBSYSTEM 253
13.3. INSTALLING A JDBC DRIVER AS A CORE MODULE FOR AGROAL DATASOURCES 254
13.3.1. Add the JDBC Driver as a Core Module 254
13.3.2. Register the JDBC Driver for Agroal Datasources 255
13.4. CONFIGURING AGROAL NON-XA DATASOURCES 255
13.4.1. Create an Agroal Datasource 255
13.4.2. Remove an Agroal Datasource 255
13.5. CONFIGURING AGROAL XA DATASOURCES 255
13.5.1. Create an Agroal XA Datasource 256
13.5.2. Remove an Agroal XA Datasource 256
13.6. EXAMPLE AGROAL DATASOURCE CONFIGURATIONS 256
13.6.1. Example MySQL Agroal Datasource 256
Example: MySQL Agroal Datasource Configuration 256
Example: MySQL JDBC Driver module.xml File 257
Example Management CLI Commands 257
13.6.2. Example MySQL Agroal XA Datasource 258
Example: MySQL Agroal XA Datasource Configuration 258
Example: MySQL JDBC Driver module.xml File 258
Example Management CLI Commands 258
11
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
. . . . . . . . . . . 14.
CHAPTER . . . CONFIGURING
. . . . . . . . . . . . . . . . THE
. . . . .TRANSACTIONS
. . . . . . . . . . . . . . . . . SUBSYSTEM
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
................
. . . . . . . . . . . 15.
CHAPTER . . . ORB
. . . . . CONFIGURATION
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
...............
15.1. ABOUT COMMON OBJECT REQUEST BROKER ARCHITECTURE (CORBA) 261
15.2. CONFIGURING THE ORB FOR JTS 261
Configure the ORB Using the Management CLI 261
Enable the Security Interceptors 261
Enable Transactions in the IIOP Subsystem 261
Enable JTS in the Transactions Subsystem 262
Configure the ORB Using the Management Console 262
15.3. CONFIGURE IIOP TO USE SSL/TLS WITH THE ELYTRON SUBSYSTEM 262
.CHAPTER
. . . . . . . . . . 16.
. . . JAKARTA
. . . . . . . . . . .CONNECTORS
. . . . . . . . . . . . . . . .MANAGEMENT
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
................
16.1. ABOUT JAKARTA CONNECTORS 264
16.2. ABOUT RESOURCE ADAPTERS 264
16.3. CONFIGURING THE JCA SUBSYSTEM 264
Archive Validation 265
Bean Validation 266
Work Managers 266
Distributed Work Managers 267
Bootstrap Contexts 269
Cached Connection Manager 269
16.4. CONFIGURING RESOURCE ADAPTERS 269
16.4.1. Deploy a Resource Adapter 269
Deploy a Resource Adapter using the Management CLI 269
Deploy a Resource Adapter using the Management Console 270
Deploy a Resource Adapter Using the Deployment Scanner 270
16.4.2. Configure a Resource Adapter 270
Add the Resource Adapter Configuration 270
Configure the Resource Adapter Settings 270
Activate the Resource Adapter 271
16.4.3. Configure Resource Adapters to Use the Elytron Subsystem 272
Container-managed Sign-On 272
Security Inflow 272
16.4.4. Deploy and Configure the IBM MQ Resource Adapter 275
16.4.5. Deploy and Configure the Generic Jakarta Messaging Resource Adapter 276
16.5. CONFIGURE MANAGED CONNECTION POOLS 276
16.6. VIEW CONNECTION STATISTICS 276
16.7. FLUSHING RESOURCE ADAPTER CONNECTIONS 277
16.8. TUNING THE RESOURCE ADAPTERS SUBSYSTEM 277
.CHAPTER
. . . . . . . . . . 17.
. . . CONFIGURING
. . . . . . . . . . . . . . . . THE
. . . . .WEB
. . . . . SERVER
. . . . . . . . . (UNDERTOW)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .278
...............
17.1. UNDERTOW SUBSYSTEM OVERVIEW 278
Default Undertow Subsystem Configuration 278
Using Elytron with Undertow Subsystem 279
Runtime Information 280
17.2. CONFIGURING BUFFER CACHES 281
Default Undertow Subsystem Configuration 281
Updating an Existing Buffer Cache 281
Creating a New Buffer Cache 281
Deleting a Buffer Cache 281
17.3. CONFIGURING BYTE BUFFER POOLS 281
Updating an Existing Byte Buffer Pool 282
Creating a Byte Buffer Pool 282
12
Table of Contents
.CHAPTER
. . . . . . . . . . 18.
. . . CONFIGURING
. . . . . . . . . . . . . . . . REMOTING
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
................
18.1. ABOUT THE REMOTING SUBSYSTEM 304
Default Remoting Subsystem Configuration 304
The Remoting Endpoint 304
13
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Connector 304
Outbound Connections 304
Additional Configuration 304
18.2. CONFIGURING THE ENDPOINT 305
Updating the Existing Endpoint Configuration 305
Creating a New Endpoint Configuration 305
Deleting an Endpoint Configuration 305
18.3. CONFIGURING A CONNECTOR 305
Updating the Existing Connector Configuration 305
Creating a New Connector 305
Deleting a Connector 305
18.4. CONFIGURING AN HTTP CONNECTOR 306
Updating the Existing HTTP Connector Configuration 306
Creating a New HTTP Connector 306
Deleting an HTTP Connector 306
18.5. CONFIGURING AN OUTBOUND CONNECTION 306
Updating an Existing Outbound Connection 306
Creating a New Outbound Connection 306
Deleting an Outbound Connection 307
18.6. CONFIGURING A REMOTE OUTBOUND CONNECTION 307
18.7. CONFIGURING A LOCAL OUTBOUND CONNECTION 307
Updating an Existing Local Outbound Connection 307
Creating a New Local Outbound Connection 307
Deleting a Local Outbound Connection 307
18.8. ADDITIONAL REMOTING CONFIGURATION 308
.CHAPTER
. . . . . . . . . . 19.
. . . CONFIGURING
. . . . . . . . . . . . . . . . THE
. . . . .IO
. . .SUBSYSTEM
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .310
...............
19.1. IO SUBSYSTEM OVERVIEW 310
Default IO Subsystem Configuration 310
19.2. CONFIGURING A WORKER 310
Updating an Existing Worker 310
Creating a New Worker 310
Deleting a Worker 310
19.3. CONFIGURING A BUFFER POOL 310
Updating an Existing Buffer Pool 311
Creating a Buffer Pool 311
Deleting a Buffer Pool 311
19.4. TUNING THE IO SUBSYSTEM 311
. . . . . . . . . . . 20.
CHAPTER . . . .CONFIGURING
. . . . . . . . . . . . . . . .WEB
. . . . . SERVICES
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
...............
.CHAPTER
. . . . . . . . . . 21.
. . . JAKARTA
. . . . . . . . . . .SERVER
. . . . . . . . .FACES
. . . . . . . CONFIGURATION
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .313
...............
21.1. MULTIPLE JAKARTA SERVER FACES IMPLEMENTATION OF JAKARTA SERVER FACES 313
21.1.1. Installing a Jakarta Server Faces Implementation 313
Add the Jakarta Server Faces Implementation JAR File 313
Add the Jakarta Server Faces API JAR File 313
Add the Jakarta Server Faces Injection JAR File 314
Add the commons-digester JAR File for MyFaces 314
Set the Default Jakarta Server Faces Implementation 314
21.1.2. Multi-Jakarta Server Faces Implementation Support 314
21.1.2.1. Working of the Multi-Jakarta Server Faces Implementation 315
21.1.2.2. Changing the Default Jakarta Server Faces Implementation 315
21.2. DISALLOWING DOCTYPE DECLARATIONS 315
14
Table of Contents
.CHAPTER
. . . . . . . . . . 22.
. . . .CONFIGURING
. . . . . . . . . . . . . . . .BATCH
. . . . . . . .APPLICATIONS
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
...............
22.1. CONFIGURING BATCH JOBS 317
22.1.1. Configure Batch Job Repositories 317
Add an In-memory Job Repository 317
Add a JDBC Job Repository 317
Set a Default Job Repository 318
22.1.2. Configure Batch Thread Pools 318
Configure a Thread Pool 318
Use a Thread Factory 318
Set a Default Thread Pool 319
View Thread Pool Statistics 319
22.2. MANAGING BATCH JOBS 319
Manage Batch Jobs from the Management CLI 319
Restart a Batch Job 319
Start a Batch Job 320
Stop a Batch Job 320
View Batch Job Execution Details 320
Manage Batch Jobs from the Management Console 320
Restart a Batch Job 321
Start a Batch Job 321
Stop a Batch Job 321
View Batch Job Execution Details 321
22.3. CONFIGURE SECURITY FOR BATCH JOBS 321
.CHAPTER
. . . . . . . . . . 23.
. . . .CONFIGURING
. . . . . . . . . . . . . . . .THE
. . . . NAMING
. . . . . . . . . .SUBSYSTEM
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .322
...............
23.1. ABOUT THE NAMING SUBSYSTEM 322
23.2. CONFIGURING GLOBAL BINDINGS 322
Configuring Simple Bindings 322
Binding Object Factories 323
Binding External Contexts 324
Binding Lookup Aliases 325
23.3. DYNAMICALLY CHANGE JNDI BINDINGS 325
23.4. CONFIGURING THE REMOTE JNDI INTERFACE 326
.CHAPTER
. . . . . . . . . . 24.
. . . .CONFIGURING
. . . . . . . . . . . . . . . .HIGH
. . . . . .AVAILABILITY
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .327
...............
24.1. INTRODUCTION TO HIGH AVAILABILITY 327
24.2. CLUSTER COMMUNICATION WITH JGROUPS 328
24.2.1. About JGroups 328
24.2.2. Switch the default JGroups channel to use TCP 328
24.2.3. Configure TCPPING 330
24.2.3.1. Configuring TCPPING in standalone mode 331
24.2.3.2. Configuring TCPPING in domain mode 332
24.2.4. Configure TCPGOSSIP 333
24.2.5. Configure JDBC_PING 334
Related information 335
24.2.6. Binding JGroups to a Network Interface 335
24.2.7. Securing a Cluster 335
24.2.7.1. Configuring Authentication 336
AUTH with a Simple Token 336
AUTH with a Digest Algorithm Token 336
AUTH with an X509 Token 336
24.2.7.2. Configuring Encryption 337
Using Symmetric Encryption 337
15
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
16
Table of Contents
.APPENDIX
. . . . . . . . . . .A.
. . REFERENCE
. . . . . . . . . . . . . .MATERIAL
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
................
A.1. SERVER RUNTIME ARGUMENTS 396
A.2. RPM SERVICE CONFIGURATION FILES 399
A.3. RPM SERVICE CONFIGURATION PROPERTIES 400
A.4. OVERVIEW OF JBOSS EAP SUBSYSTEMS 401
A.5. ADD-USER UTILITY ARGUMENTS 405
A.6. MANAGEMENT AUDIT LOGGING ATTRIBUTES 406
A.7. INTERFACE ATTRIBUTES 408
A.8. SOCKET BINDING ATTRIBUTES 410
A.9. DEFAULT SOCKET BINDINGS 412
A.10. MODULE COMMAND ARGUMENTS 415
A.11. DEPLOYMENT SCANNER MARKER FILES 417
A.12. DEPLOYMENT SCANNER ATTRIBUTES 418
A.13. MANAGED DOMAIN JVM CONFIGURATION ATTRIBUTES 419
A.14. MAIL SUBSYSTEM ATTRIBUTES 420
A.15. ROOT LOGGER ATTRIBUTES 423
A.16. LOG CATEGORY ATTRIBUTES 423
A.17. LOG HANDLER ATTRIBUTES 424
17
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
18
Table of Contents
19
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
20
Table of Contents
21
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Prerequisites
In the Red Hat Customer Portal, view the document in Multi-page HTML format.
Procedure
NOTE
2. Highlight the section of the document where you want to provide feedback.
3. In the prompt menu that displays near the text you selected, click Add Feedback.
A text box opens in the feedback section on the right side of the page.
5. To view the issue, click the issue tracker link in the feedback view.
22
MAKING OPEN SOURCE MORE INCLUSIVE
23
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
CHAPTER 1. INTRODUCTION
Before using this guide to configure JBoss EAP, it is assumed that the latest version of JBoss EAP has
been downloaded and installed. For installation instructions, see the JBoss EAP Installation Guide.
IMPORTANT
Since the installation location of JBoss EAP will vary between host machines, this guide
refers to the installation location as EAP_HOME. The actual location of the JBoss EAP
installation should be used instead of EAP_HOME when performing administrative tasks.
24
CHAPTER 2. STARTING AND STOPPING JBOSS EAP
Servers are initially started in a suspended state and will not accept any requests until all required
services have started, at which time the servers are placed into a normal running state and can start
accepting requests.
$ EAP_HOME/bin/standalone.sh
NOTE
This startup script uses the EAP_HOME/bin/standalone.conf file, or standalone.conf.bat for Windows
Server, to set some default preferences, such as JVM options. You can customize the settings in this
file.
JBoss EAP uses the standalone.xml configuration file by default, but can be started using a different
one. For details on the available standalone configuration files and how to use them, see the Standalone
Server Configuration Files section.
For a complete listing of all available startup script arguments and their purposes, use the --help
argument or see the Server runtime arguments and switches section.
$ EAP_HOME/bin/domain.sh
NOTE
This startup script uses the EAP_HOME/bin/domain.conf file, or domain.conf.bat for Windows Server,
to set some default preferences, such as JVM options. You can customize the settings in this file.
JBoss EAP uses the host.xml host configuration file by default, but can be started using a different one.
For details on the available managed domain configuration files and how to use them, see the Managed
Domain Configuration Files section.
When setting up a managed domain, additional arguments will need to be passed into the startup script.
For a complete listing of all available startup script arguments and their purposes, use the --help
argument or see the Server runtime arguments and switches section.
25
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
$ EAP_HOME/bin/jboss-cli.sh --connect
shutdown
NOTE
When running in a managed domain, you must specify the host name to shut down by
using the --host argument with the shutdown command.
$ EAP_HOME/bin/standalone.sh --start-mode=admin-only
:read-attribute(name=running-mode)
{
"outcome" => "success",
"result" => "ADMIN_ONLY"
}
NOTE
Additionally, you can check the initial running mode in which JBoss EAP was launched by
using the following command.
/core-service=server-environment:read-attribute(name=initial-running-mode)
26
CHAPTER 2. STARTING AND STOPPING JBOSS EAP
reload --start-mode=admin-only
reload --start-mode=normal
Note that if the server was started in admin-only mode and no --start-mode argument is specified to
the reload command, the server will be started in normal mode.
$ EAP_HOME/bin/domain.sh --admin-only
/host=HOST_NAME:read-attribute(name=running-mode)
{
"outcome" => "success",
"result" => "ADMIN_ONLY"
}
Note that if the host controller was started in admin-only mode and no --admin-only argument is
specified to the reload command, the host controller will be started in normal mode.
27
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
operation will wait for active requests to complete. While the server is suspended, management requests
are still processed.
Graceful shutdown is coordinated at a server-wide level, mostly focused on the entry points at which a
request enters the server. The following subsystems support graceful shutdown:
Undertow
The undertow subsystem will wait for all requests to finish.
mod_cluster
The modcluster subsystem will notify the load balancer that the server is suspending in the
PRE_SUSPEND phase.
ejb3
The ejb3 subsystem will wait for all remote Jakarta Enterprise Beans requests and MDB message
deliveries to finish. Delivery to MDBs is stopped in the PRE_SUSPEND phase. Jakarta Enterprise
Beans timers are suspended, and missed timers will be activated when the server is resumed.
Transactions
Once suspended, the server will not accept new requests, but in-flight transactions and requests are
allowed to continue until they complete or until the timeout period expires. This also applies for web
service requests associated with an XTS transaction.
NOTE
By default, transaction graceful shutdown is disabled for the ejb subsystem. You must
enable transaction graceful shutdown if you want the server to wait for Jakarta
Enterprise Beans-related transactions to complete before suspending. For example:
/subsystem=ejb3:write-attribute(name=enable-graceful-txn-shutdown,value=true)
Jakarta Concurrency
The server will wait for all active jobs to finish. All queued jobs will be skipped. Currently, since
Jakarta Concurrency does not have persistence, those queued jobs that were skipped will be lost.
While the server is in a suspended state, scheduled tasks will continue to execute at their scheduled
times but will throw a java.lang.IllegalStateException. Once the server is resumed, scheduled tasks
will continue to execute normally, and in most cases tasks will not need to be rescheduled.
Batch
The server will stop all running jobs within the timeout period and defer all scheduled jobs.
NOTE
Graceful shutdown currently will not reject new inbound Jakarta Messaging messages.
Jakarta Batch jobs and Jakarta Concurrency tasks scheduled by in-flight activity are
currently allowed to proceed; however, Jakarta Concurrency tasks submitted that pass
the timeout window currently error when executed.
Requests are tracked by the request-controller subsystem. Without this subsystem, suspend and
resume capabilities are very limited and the server will not wait for requests to complete before
suspending or shutting down; however, if you do not need this capability, the request-controller
subsystem can be removed for a small performance improvement.
28
CHAPTER 2. STARTING AND STOPPING JBOSS EAP
NOTE
The server can be suspended and resumed using the management console or the management CLI.
:read-attribute(name=suspend-state)
/host=master/server=server-one:read-attribute(name=suspend-state)
Suspend
Use the following management CLI commands to suspend the server, specifying the timeout value, in
seconds, for the server to wait for active requests to complete. The default is 0, which will suspend
immediately. A value of -1 will cause the server to wait indefinitely for all active requests to complete.
:suspend(suspend-timeout=60)
:suspend-servers(suspend-timeout=60)
/host=master/server-config=server-one:suspend(suspend-timeout=60)
/server-group=main-server-group:suspend-servers(suspend-timeout=60)
/host=master:suspend-servers(suspend-timeout=60)
Resume
29
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
The resume command returns the server to a normal running state to accept new requests. You can
initiate the command at the host, server, server group, or domain level. For example:
:resume
$ EAP_HOME/bin/standalone.sh --start-mode=suspend
/host=HOST_NAME/server-config=SERVER_NAME:start(start-mode=suspend)
NOTE
You can also pass the start-mode argument to the reload and restart operations
for a server.
To start all servers in a managed domain server group in a suspended state, pass the start-
mode=suspend argument to the start-servers operation in the management CLI command.
/server-group=SERVER_GROUP_NAME:start-servers(start-mode=suspend)
NOTE
You can also pass the start-mode argument to the reload-servers and restart-
servers operations for a server group.
Use the following management CLI commands to shut down the server gracefully. Specify the timeout
value, in seconds, for the server to wait for active requests to complete. The default is 0, which will shut
down the server immediately. A value of -1 will cause the server to wait indefinitely for all active requests
to complete before shutting down.
Each example waits up to 60 seconds for requests to complete before shutting down.
shutdown --suspend-timeout=60
30
CHAPTER 2. STARTING AND STOPPING JBOSS EAP
:stop-servers(suspend-timeout=60)
/host=master/server-config=server-one:stop(suspend-timeout=60)
/server-group=main-server-group:stop-servers(suspend-timeout=60)
/host=master:shutdown(suspend-timeout=60)
NOTE
IMPORTANT
In a managed domain OS signals should not be used to shut down servers. Instead,
servers should be shut down using the management CLI and through the managing Host
Controller.
Graceful shutdown using an OS signal will not work if the JVM is configured to disable signal handling,
such as if the -Xrs java argument has been passed to the JVM options, or if the signal sent is not one the
process can respond to, such as if a KILL signal is sent.
31
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
This will start JBoss EAP using the standalone.xml configuration file by default. You can start JBoss
EAP with a different standalone server configuration file by setting a property in the RPM service
configuration file. For more information, see the Configure RPM Service Properties section below.
This will start JBoss EAP using the host.xml configuration file by default. You can start JBoss EAP with
a different managed domain configuration file by setting a property in the RPM service configuration
file. For more information, see the Configure RPM Service Properties section below.
For a listing of all available startup options for an RPM installation, see the RPM Service Configuration
Properties section.
IMPORTANT
For Red Hat Enterprise Linux 7 and later, RPM service configuration files are loaded using
systemd, so variable expressions are not expanded.
WILDFLY_SERVER_CONFIG=standalone-full.xml
WILDFLY_BIND=192.168.0.1
NOTE
32
CHAPTER 2. STARTING AND STOPPING JBOSS EAP
NOTE
If you want to bind the management interfaces to a specific IP address, this can
be configured in the JBoss EAP startup configuration file as shown in the next
example.
NOTE
If required, the JBoss EAP bind address must be configured using the
WILDFLY_BIND property and not using the jboss.bind.address standard
property here.
NOTE
If a property has the same name in both the RPM service configuration file, such as
/etc/sysconfig/eap7-standalone, and in the JBoss EAP startup configuration file, such as
EAP_HOME/bin/standalone.conf, the value that takes precedence is the one in the
JBoss EAP startup configuration file. One such property is JAVA_HOME.
33
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
For a listing of all available startup options for an RPM installation, see the RPM Service Configuration
Files section.
IMPORTANT
See Technology Preview Features Support Scope on the Red Hat Customer Portal for
information about the support scope for Technology Preview features.
JBoss EAP includes PowerShell script equivalents for most of the JBoss EAP management scripts. This
includes a PowerShell script to start JBoss EAP on Microsoft Windows Server.
The JBoss EAP PowerShell scripts are designed to work with PowerShell version 2 and newer running on
tested versions of Windows Server.
The JBoss EAP PowerShell scripts are located in EAP_HOME\bin, and are used in mostly the same way
as the JBoss EAP batch scripts.
For example, to start a standalone JBoss EAP server with the standalone-full.xml configuration file, use
the following PowerShell command:
.\standalone.ps1 "-c=standalone-full.xml"
NOTE
34
CHAPTER 3. JBOSS EAP MANAGEMENT
JBoss EAP can be configured using the command-line management CLI, web-based management
console, Java API, or HTTP API. Changes made using these management interfaces persist
automatically, and the XML configuration files are overwritten by the Management API. The
management CLI and management console are the preferred methods, and it is not recommended to
edit the XML configuration files manually.
An extension is a module that extends the core functionality of the server. Extensions are loaded as they
are needed by deployments, and are unloaded when they are no longer needed. See the JBoss EAP
Management CLI Guide for how to add and remove extensions.
A subsystem provides configuration options for a particular extension. For more information on the
available subsystems, see Overview of JBoss EAP Subsystems.
A collection of subsystem configurations makes up a profile, which is configured to satisfy the needs for
the server. A standalone server has a single, unnamed profile. A managed domain can define many
profiles for use by server groups in the domain.
However, you must add a management user if you want to access the management CLI remotely or use
the management console, which is considered remote access even if the traffic originates on the local
host. If you attempt to access the management console before adding a management user, you will
receive an error message.
If JBoss EAP is installed using the graphical installer, then a management user is created during the
installation process.
This guide covers simple user management for JBoss EAP using the add-user script, which is a utility for
adding new users to the properties files for out-of-the-box authentication.
For more advanced authentication and authorization options, such as LDAP or Role-Based Access
Control (RBAC), see the Core Management Authentication section of the JBoss EAP Security
Architecture.
35
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
$ EAP_HOME/bin/add-user.sh
NOTE
3. Enter the desired username and password. You will be prompted to confirm the password.
NOTE
User names can only contain the following characters, in any number and in any
order:
Backslash (\)
Equals (=)
By default, JBoss EAP allows weak passwords but will issue a warning.
See Setting Add-User Utility Password Restrictions for details on changing this default
behavior.
4. Enter a comma-separated list of groups to which the user belongs. If you do not want the user
to belong to any groups, press ENTER to leave it blank.
6. Determine whether this user represents a remote JBoss EAP server instance. For a basic
management user, enter no.
One type of user that may need to be added to the ManagementRealm is a user representing
another instance of JBoss EAP, which must be able to authenticate to join as a member of a
cluster. If this is the case, then answer yes to this prompt and you will be given a hashed secret
value representing the user’s password, which will need to be added to a different configuration
file.
Users can also be created non-interactively by passing parameters to the add-user script. This
approach is not recommended on shared systems, because the passwords will be visible in log and
history files. For more information, see Running the Add-User Utility Non-Interactively .
36
CHAPTER 3. JBOSS EAP MANAGEMENT
You can run the add-user script non-interactively by passing in arguments on the command line. At a
minimum, the username and password must be provided.
WARNING
This approach is not recommended on shared systems, because the passwords will
be visible in log and history files.
EAP_HOME/standalone/configuration/mgmt-users.properties
EAP_HOME/domain/configuration/mgmt-users.properties
EAP_HOME/standalone/configuration/mgmt-groups.properties
EAP_HOME/domain/configuration/mgmt-groups.properties
These default directories and properties file names can be overridden. The following command adds a
new user, specifying a different name and location for the user properties files.
The new user was added to the user properties files located at
/path/to/standaloneconfig/newname.properties and /path/to/domainconfig/newname.properties.
Note that these files must already exist or you will see an error.
For a complete listing of all available add-user arguments and their purposes, use the --help argument
or see the Add-user arguments section.
IMPORTANT
37
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
IMPORTANT
To avoid setting an unintentional password, check that your keyboard’s system keymap is correct. The
default system keymap is en-qwerty. If you change this default setting and create a new password, you
must check that the password meets the criteria located in the class
SimplePasswordStrengthChecker.
By default, JBoss EAP allows weak passwords but issues a warning. To reject passwords that do not
meet the minimum requirements specified, set the password.restriction property to REJECT.
The following table describes the additional password requirement settings that can be configured in
the EAP_HOME/bin/add-user.properties file:
Attribute Description
strength Sets the threshold that a password must meet to be valid. Valid threshold entries
include:
* VERY_WEAK
* WEAK
* MODERATE
* MEDIUM
* STRONG
* VERY_STRONG
* EXCEPTIONAL
The default value is MODERATE. The threshold values are defined and the
default value specified in the class SimplePasswordStrengthChecker.
NOTE: If you do not specify a threshold value, MODERATE becomes the default
value. This value is specified in the class SimplePasswordStrengthChecker.
minAlpha The minimum number of alphabetic characters set for a password. For example,
password.restriction.minAlpha=1 restricts a password to include at least
one alphabetic character.
minDigit The minimum number of numeric characters set for a password. For example,
password.restriction.minDigit=1 restricts a password to include at least one
numerical character.
38
CHAPTER 3. JBOSS EAP MANAGEMENT
Attribute Description
minSymbol The minimum number of symbols set for a password. For example,
password.restriction.minSymbol=1 restricts a password to include at least
one symbol.
forbiddenValue Restricts a user from setting an easily determined password, such as root. For
example, password.restriction.forbidden=root,admin,administrator
restricts setting root, admin, or administrator as the password.
mustNotMatchUsern Restricts the user from setting their user name as the password. For example,
ame password.restriction.mustNotMatchUsername=TRUE restricts the user
from setting their user name as the password. This rule is ignored if set to false.
Additional Resources
See the Configuring Basic System Settings guide on the Red Hat Customer Portal.
$ EAP_HOME/bin/add-user.sh
When you enter a username that already exists, you are presented with several options:
39
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
WARNING
When updating a user using the add-user script non-interactively, the user is
updated automatically with no confirmation prompt.
Make sure you review information in the Performance Tuning Guide for information about how to
optimize the server configuration to avoid common problems when deploying applications in a
production environment. Common optimizations include setting ulimits, enabling garbage collection ,
creating Java heap dumps, and adjusting the thread pool size .
It is also a good idea to apply any existing patches for your release of the product. Each patch for EAP
contains numerous bug fixes. For more information, see Patching JBoss EAP in the Patching and
Upgrading Guide for JBoss EAP.
Use the management CLI to start and stop servers, deploy and undeploy applications, configure system
settings, and perform other administrative tasks. Operations can be performed in batch mode, allowing
multiple tasks to be run as a group.
Many common terminal commands are available, such as ls, cd, and pwd. The management CLI also
supports tab completion.
For detailed information on using the management CLI, including commands and operations, syntax, and
running in batch mode, see the JBoss EAP Management CLI Guide.
$ EAP_HOME/bin/jboss-cli.sh
NOTE
connect
Or you can launch the management CLI and connect in one step by using the EAP_HOME/bin/jboss-
cli.sh --connect command.
40
CHAPTER 3. JBOSS EAP MANAGEMENT
Display Help
Use the following command for general help.
help
Use the --help flag on a command to receive instructions on using that specific command. For instance,
to receive information on using deploy, the following command is executed.
deploy --help
quit
/subsystem=datasources/data-source=ExampleDS:read-attribute(name=enabled)
{
"outcome" => "success",
"result" => true
}
When running in a managed domain, you must specify which profile to update by preceding the
command with /profile=PROFILE_NAME.
/profile=default/subsystem=datasources/data-source=ExampleDS:read-attribute(name=enabled)
/subsystem=datasources/data-source=ExampleDS:write-attribute(name=enabled,value=false)
Start Servers
The management CLI can also be used to start and stop servers when running in a managed domain.
/host=HOST_NAME/server-config=server-one:start
Use the management console to start and stop servers, deploy and undeploy applications, tune system
settings, and make persistent modifications to the server configuration. The management console also
has the ability to perform administrative tasks, with live notifications when any changes performed by
the current user require the server instance to be restarted or reloaded.
In a managed domain, server instances and server groups in the same domain can be centrally managed
from the management console of the domain controller.
For a JBoss EAP instance running on the local host using the default management port, the
management console can be accessed through a web browser at
41
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
The management console provides the following tabs for navigating and managing your JBoss EAP
standalone server or managed domain.
Home
Learn how to accomplish several common configuration and management tasks. Take a tour to
become familiar with the JBoss EAP management console.
Deployments
Add, remove, and enable deployments. In a managed domain, assign deployments to server groups.
Configuration
Configure available subsystems, which provide capabilities such as web services, messaging, or high
availability. In a managed domain, manage the profiles that contain different subsystem
configurations.
Runtime
View runtime information, such as server status, JVM usage, and server logs. In a managed domain,
manage your hosts, server groups, and servers.
Patching
Apply patches to your JBoss EAP instances.
Access Control
Assign roles to users and groups when using Role-Based Access Control.
Once you have navigated to the appropriate section of the management console for the resource that
you want to modify, you can edit its attributes as long as you have the proper permissions.
NOTE
Depending on the attribute type, the input field can be a text field, ON/OFF field,
or drop down. In some text fields, as you type, values from elsewhere in the
configuration may appear as suggestions.
To view the history of recent configuration actions you have performed, click the notification icon in the
top-right of the management console.
You can enable or disable the management console by setting the console-enabled boolean attribute
of the /core-service=management/management-interface=http-interface resource. For the master
host in domain mode, use /host=master/core-service=management/management-interface=http-
interface.
/core-service=management/management-interface=http-interface:write-attribute(name=console-
enabled,value=true)
/core-service=management/management-interface=http-interface:write-attribute(name=console-
enabled,value=false)
By default, the language settings of the management console is English. You can choose to use one of
the following languages instead:
German (de)
French (fr)
Spanish (es)
Japanese (ja)
2. Click the Settings link in the lower-right corner of the management console.
4. Select Save. A confirmation box informs you that you need to reload the application.
5. Click Yes. The system refreshes your web browser automatically to use the selected locale.
You can customize the management console title so that each of your JBoss EAP instances can be
identified at a quick glance.
43
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
4. Click Save.
A confirmation box informs you that you must reload the management console.
5. Click Yes.
The system refreshes your web browser automatically and the new title is displayed on the tab
header.
The HTTP API is used by the JBoss EAP management console but offers integration capabilities for
other clients as well. By default, the HTTP API is accessible at http://HOST_NAME:9990/management.
This URL will display the raw attributes and values exposed to the API.
Read Resources
While you can read, write, or perform other operations using the HTTP POST method, you can perform
some read operations using a GET request. The HTTP GET method uses the following URL format.
http://HOST_NAME:9990/management/PATH_TO_RESOURCE?
operation=OPERATION&PARAMETER=VALUE
Be sure to replace all of the replaceable values with those that are appropriate for your request. The
following values are the available options for the OPERATION replaceable value:
Value Description
The following example URLs show how to perform read operations using the HTTP API.
http://HOST_NAME:9990/management/subsystem/undertow/server/default-server/http-
listener/default
This displays all attributes and their values for the default HTTP listener.
NOTE
44
CHAPTER 3. JBOSS EAP MANAGEMENT
NOTE
http://HOST_NAME:9990/management/subsystem/datasources/data-source/ExampleDS?
operation=attribute&name=enabled
This reads the value of the enabled attribute for the ExampleDS datasource.
Update Resources
You can use the HTTP POST method to update configuration values or perform other operations using
the HTTP API. You must provide authentication for these operations.
The following examples show how to update resources using the HTTP API.
This updates the value of the enabled attribute for the ExampleDS datasource to false.
See Deploying Applications Using the HTTP API for information on how to deploy applications to JBoss
EAP using the HTTP API.
The HTTP management endpoint of JBoss EAP returns a predefined set of HTTP headers in all the
responses that are sent to clients. You can define custom-constant HTTP headers to be returned in
addition to this predefined set of HTTP headers.
JBoss EAP applies the custom-constant HTTP headers by matching a configured prefix against
the request path.
For example, you can map custom-constant HTTP headers to requests on the request path such
as / or /management.
If a request matches multiple prefixes, JBoss EAP applies the custom-constant HTTP headers
from all of the mappings.
For example, a request to the path /management matches mappings for both / and
/management. JBoss EAP applies headers from both of the mappings.
At the end of processing a request, before a response returns to a client, by overriding headers
45
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
At the end of processing a request, before a response returns to a client, by overriding headers
set by the corresponding endpoint.
For example, the management endpoint sets an X-Frame-Options header in each response. If
you define a custom-constant HTTP header with the name X-Frame-Options, the custom-
constant HTTP header overrides the default header.
You can define multiple custom-constant HTTP headers to be returned in the response on a single
mapping.
The following are the rules for defining custom-constant HTTP headers:
The custom-constant HTTP headers can only contain the characters that are supported in RFC-
7231 - Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content.
Connection
Content-Length
Content-Type
Date
Transfer-Encoding
For example, if you attempt to set a custom-constant HTTP header with the name Date, the
following error is returned:
{
"outcome" => "failed",
"failure-description" => "WFLYCTL0458:Disallowed HTTP Header name 'Date'",
"rolled-back" => true
}
JBoss EAP does not verify whether the specified path is reachable.
Subsystems can dynamically add contexts that the HTTP management interface supports.
Custom-constant HTTP headers do not alter how an endpoint handles a response to a request.
Additional resources
Define a custom-constant HTTP header to be returned in every response to requests on the required
46
CHAPTER 3. JBOSS EAP MANAGEMENT
Define a custom-constant HTTP header to be returned in every response to requests on the required
path prefix.
IMPORTANT
Before creating custom-constant HTTP headers, you must understand the following
considerations:
JBoss EAP does not verify whether the specified path is reachable.
Subsystems can dynamically add contexts that the HTTP management interface
supports.
Procedure
/core-service=management/management-interface=http-interface:write-
attribute(name=constant-headers,value=[{path="PATH_PREFIX",headers=
[{name="HEADER_NAME",value="HEADER_VALUE"}]}])
IMPORTANT
reload
Requests to the HTTP management interface now return HTTP header HEADER_NAME with
the value HEADER_VALUE in addition to the predefined set of HTTP headers.
/core-service=management/management-interface=http-interface:write-
attribute(name=constant-headers,value=[{path="/",headers=[{name="X-
Help",value="http://mywebsite.com/help"}]}])
Verification steps
admin:redhat
HTTP/1.1 200 OK
Connection: keep-alive
47
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
X-Frame-Options: SAMEORIGIN
Content-Type: application/json; charset=utf-8
Content-Length: 3312
X-Help: http://mywebsite.com
Date: Tue, 27 Oct 2020 08:13:17 GMT
Additional resources
The following CLI commands define custom-constant HTTP headers in standalone and managed
domain modes.
standalone mode
/core-service=management/management-interface=http-interface:write-
attribute(name=constant-headers,value=[{path=/PREFIX,headers=[{name=X-
HEADER,value=HEADERVALUE}]}])
<management-interfaces>
<http-interface security-realm="ManagementRealm">
<http-upgrade enabled="true"/>
<socket-binding http="management-http"/>
<constant-headers>
<header-mapping path="/PREFIX">
<header name="X-HEADER" value="HEADERVALUE"/>
</header-mapping>
</constant-headers>
</http-interface>
</management-interfaces>
/core-service=management/management-interface=http-interface:write-
attribute(name=constant-headers,value=[{path=/PREFIX1,headers=[{name=X-
HEADER,value=HEADERVALUE-FOR-X}]},{path=/PREFIX2,headers=[{name=Y-
HEADER,value=HEADERVALUE-FOR-Y}]}])
domain mode
48
CHAPTER 3. JBOSS EAP MANAGEMENT
/host=master/core-service=management/management-interface=http-interface:write-
attribute(name=constant-headers,value=[{path=/PREFIX,headers=[{name=X-
HEADER,value=HEADER-VALUE}]}])
<management-interfaces>
<http-interface security-realm="ManagementRealm">
<http-upgrade enabled="true"/>
<socket interface="management" port="${jboss.management.http.port:9990}"/>
<constant-headers>
<header-mapping path="/PREFIX">
<header name="X-HEADER" value="HEADER-VALUE"/>
</header-mapping>
</constant-headers>
</http-interface>
</management-interfaces>
/host=master/core-service=management/management-interface=http-interface:write-
attribute(name=constant-headers,value=[ {path=/PREFIX-1,headers=[{name=X-
HEADER,value=HEADER-VALUE-FOR-X}]},{path=/PREFIX-2,headers=[{name=Y-
HEADER,value=HEADER-VALUE-FOR-Y}]}])
Additional resources
The following Java code shows an example of how to execute management operations from Java code
using the native API.
NOTE
You must add the required JBoss EAP libraries, found in the
EAP_HOME/bin/client/jboss-cli-client.jar file, to your class path.
49
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
standalone.xml This standalone configuration file is the default configuration that is used when
you start your standalone server. It contains all information about the server,
including subsystems, networking, deployments, socket bindings, and other
configurable details. It does not provide the subsystems necessary for messaging
or high availability.
standalone-ha.xml This standalone configuration file includes all of the default subsystems and adds
the modcluster and jgroups subsystems for high availability. It does not provide
the subsystems necessary for messaging.
standalone-full.xml This standalone configuration file includes all of the default subsystems and adds
the messaging-activemq and iiop-openjdk subsystems. It does not provide
the subsystems necessary for high availability.
standalone-full- This standalone configuration file includes support for every possible subsystem,
ha.xml including those for messaging and high availability.
standalone-load- This standalone configuration file includes the minimum subsystems necessary to
balancer.xml use the built-in mod_cluster front-end load balancer to load balance other JBoss
EAP instances.
By default, starting JBoss EAP as a standalone server uses the standalone.xml file. To start JBoss EAP
with a different configuration, use the --server-config argument. For example,
50
CHAPTER 3. JBOSS EAP MANAGEMENT
$ EAP_HOME/bin/standalone.sh --server-config=standalone-full.xml
domain.xml This is the main configuration file for a managed domain. Only the domain master
reads this file. This file contains the configurations for all of the profiles (default,
ha, full, full-ha, load-balancer).
host.xml This file includes configuration details specific to a physical host in a managed
domain, such as network interfaces, socket bindings, the name of the host, and
other host-specific details. The host.xml file includes all of the features of both
host-master.xml and host-slave.xml, which are described below.
host-master.xml This file includes only the configuration details necessary to run a server as the
master domain controller.
host-slave.xml This file includes only the configuration details necessary to run a server as a
managed domain host controller.
By default, starting JBoss EAP in a managed domain uses the host.xml file. To start JBoss EAP with a
different configuration, use the --host-config argument. For example,
$ EAP_HOME/bin/domain.sh --host-config=host-master.xml
EAP_HOME/standalone/configuration/
Back up the entire directory to save user data, server configuration, and logging settings for
standalone servers.
EAP_HOME/domain/configuration/
Back up the entire directory to save user and profile data, domain and host configuration,
and logging settings for managed domains.
EAP_HOME/modules/
EAP_HOME/welcome-content/
51
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
EAP_HOME/bin/
The following examples use the standalone.xml file, but the same process applies to the domain.xml
and host.xml files.
Take a Snapshot
Use the management CLI to take a snapshot of the current configurations.
:take-snapshot
{
"outcome" => "success",
"result" => "EAP_HOME/standalone/configuration/standalone_xml_history/snapshot/20151022-
133109702standalone.xml"
}
List Snapshots
Use the management CLI to list all snapshots that have been taken.
:list-snapshots
{
"outcome" => "success",
"result" => {
"directory" => "EAP_HOME/standalone/configuration/standalone_xml_history/snapshot",
"names" => [
"20151022-133109702standalone.xml",
"20151022-132715958standalone.xml"
]
}
}
Delete a Snapshot
Use the management CLI to delete a snapshot.
:delete-snapshot(name=20151022-133109702standalone.xml)
2. Start the server and point to the selected configuration file. Pass in the file path relative to the
configuration directory, EAP_HOME/standalone/configuration/.
52
CHAPTER 3. JBOSS EAP MANAGEMENT
$ EAP_HOME/bin/standalone.sh --server-
config=standalone_xml_history/snapshot/20151022-133109702standalone.xml
NOTE
When running in a managed domain, use the --host-config argument instead to specify
the configuration file.
IMPORTANT
Changes are stored in memory and are not persisted between server restarts. This
feature is not a replacement for management audit logging .
You can enable tracking and view configuration changes from either the management CLI or the
management console.
/subsystem=core-management/service=configuration-changes:add(max-history=20)
NOTE
In a managed domain, configuration changes are tracked at the host level for host and
server-related modifications. Enabling configuration changes for a host controller enables
it for all of its managed servers. You can track configuration changes per host using the
following command.
/host=HOST_NAME/subsystem=core-management/service=configuration-
changes:add(max-history=20)
To view the list of most recent configuration changes, use the following management CLI command.
/subsystem=core-management/service=configuration-changes:list-changes
NOTE
53
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
NOTE
In a managed domain, you can list the configuration changes for a host using the following
command.
/host=HOST_NAME/subsystem=core-management/service=configuration-
changes:list-changes
You can list the configuration changes that affect a particular server using the following
command.
/host=HOST_NAME/server=SERVER_NAME/subsystem=core-
management/service=configuration-changes:list-changes
This lists each configuration change made, with the date, origin, outcome, and operation details. For
example, the below output from the list-changes command shows configuration changes, with the
most recent displayed first.
{
"outcome" => "success",
"result" => [
{
"operation-date" => "2016-02-12T18:37:00.354Z",
"access-mechanism" => "NATIVE",
"remote-address" => "127.0.0.1/127.0.0.1",
"outcome" => "success",
"operations" => [{
"address" => [],
"operation" => "reload",
"operation-headers" => {
"caller-type" => "user",
"access-mechanism" => "NATIVE"
}
}]
},
{
"operation-date" => "2016-02-12T18:34:16.859Z",
"access-mechanism" => "NATIVE",
"remote-address" => "127.0.0.1/127.0.0.1",
"outcome" => "success",
"operations" => [{
"address" => [
("subsystem" => "datasources"),
("data-source" => "ExampleDS")
],
"operation" => "write-attribute",
"name" => "enabled",
"value" => false,
"operation-headers" => {
"caller-type" => "user",
"access-mechanism" => "NATIVE"
}
}]
},
54
CHAPTER 3. JBOSS EAP MANAGEMENT
{
"operation-date" => "2016-02-12T18:24:11.670Z",
"access-mechanism" => "HTTP",
"remote-address" => "127.0.0.1/127.0.0.1",
"outcome" => "success",
"operations" => [{
"operation" => "remove",
"address" => [
("subsystem" => "messaging-activemq"),
("server" => "default"),
("jms-queue" => "ExpiryQueue")
],
"operation-headers" => {"access-mechanism" => "HTTP"}
}]
}
]
}
This example lists the details of three operations performed that impacted the configuration:
The table on this page then lists each configuration change made, with the date, origin, outcome, and
operation details.
The supported sources for resolving expressions are system properties, environment variables, and the
vault. For deployments only, the source can be properties listed in a META-INF/jboss.properties file in
the deployment archive. For deployment types that support subdeployments, the resolution is scoped to
all subdeployments if the properties file is in the outer deployment, for example the EAR. If the
properties file is in the subdeployment, then the resolution is scoped just to that subdeployment.
The example below from the standalone.xml configuration file sets the inet-address for the public
interface to 127.0.0.1 unless the jboss.bind.address parameter is set.
<interface name="public">
<inet-address value="${jboss.bind.address:127.0.0.1}"/>
</interface>
The jboss.bind.address parameter can be set when starting EAP as a standalone server with the
following command:
55
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
$ EAP_HOME/bin/standalone.sh -Djboss.bind.address=IP_ADDRESS
Nested Expressions
Expressions can be nested, which allows for more advanced use of expressions in place of fixed values.
The format of a nested expression is like that of a normal expression, but one expression is embedded in
the other, for example:
${SYSTEM_VALUE_1${SYSTEM_VALUE_2}}
Nested expressions are evaluated recursively, so the inner expression is first evaluated, then the outer
expression is evaluated. Expressions may also be recursive, where an expression resolves to another
expression, which is then resolved. Nested expressions are permitted anywhere that expressions are
permitted, with the exception of management CLI commands.
An example of where a nested expression might be used is if the password used in a datasource
definition is masked. The configuration for the datasource might have the following line:
<password>${VAULT::ds_ExampleDS::password::1}</password>
The value of ds_ExampleDS could be replaced with a system property ( datasource_name) using a
nested expression. The configuration for the datasource could instead have the following line:
<password>${VAULT::${datasource_name}::password::1}</password>
JBoss EAP would first evaluate the expression ${datasource_name}, then input this to the larger
expression and evaluate the resulting expression. The advantage of this configuration is that the name
of the datasource is abstracted from the fixed configuration.
There are several flags in the ee subsystem that control whether property replacement is applied.
jboss-ejb3.xml
jboss-app.xml
jboss-web.xml
jboss-permissions.xml
*-jms.xml
56
CHAPTER 3. JBOSS EAP MANAGEMENT
*-ds.xml
The following management CLI command can be used to enable or disable property replacement in
JBoss-specific descriptors:
/subsystem=ee:write-attribute(name="jboss-descriptor-property-replacement",value=VALUE)
ejb-jar.xml
permissions.xml
persistence.xml
application.xml
web.xml
The following management CLI command can be used to enable or disable property replacement in
Jakarta EE descriptors:
/subsystem=ee:write-attribute(name="spec-descriptor-property-replacement",value=VALUE)
You can choose to use configuration data in a local Git repository or you can pull the data from a
remote Git repository. The Git repository is configured in the jboss.server.base.dir directory, which is
the base directory for standalone server content. Once the jboss.server.base.dir directory is
configured to use Git, JBoss EAP automatically commits every update you make to the configuration
using the management CLI or management console. Any changes made outside of the server by
manually editing the configuration files are not committed or persisted; however, you can use the Git
CLI to add and commit manual changes. You can also use the Git CLI to view the commit history,
manage branching, and manage the content.
To use this feature, pass one or more of the following arguments on the command line when you start
the server.
Argument Description
--git-repo The location of the Git repository that is used to manage and persist server
configuration data. This can be local if you want to store it locally, or the
URL to a remote repository.
57
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Argument Description
--git-branch The branch or tag name in the Git repository to use. This argument should
name an existing branch or tag name as it will not be created if it does not
exist. If you use a tag name, you put the repository in a detached HEAD
state, meaning future commits are not attached to any branches. Tag
names are read-only and are normally used when you need to replicate a
configuration across several nodes.
--git-auth The URL to an Elytron configuration file that contains the credentials to be
used when connecting to a remote Git repository. This argument is required
if your remote Git repository requires authentication. This argument is not
used with a local repository.
The following is an example of a command to start the server using the 1.0.x branch of the local
repository.
If you start the server with the argument to use a local Git repository, JBoss EAP checks whether the
jboss.server.base.dir directory is already configured for Git. If not, JBoss EAP creates and initializes
the Git repository in the jboss.server.base.dir directory using the existing configuration content. JBoss
EAP checks out a branch name passed by the --git-branch argument. If that argument is not passed, it
checks out the master branch. After initialization, you should see a .git/ directory and a .gitignore file in
the base directory for standalone server content.
You can also specify an optional branch or tag name in the remote repository by adding the --git-
branch=GIT_BRANCH_NAME argument when you start the server. This argument should name an
existing branch or tag name as it will not be created if it does not exist. If you use a tag name, you put the
repository in a detached HEAD state, meaning future commits are not attached to any branches.
If your Git repository requires authentication, you must also add the --git-auth=AUTH_FILE_URL
argument when you start the server. This argument should be the URL to an Elytron configuration file
containing the credentials required to connect to the Git repository. The following is an example of an
Elytron configuration file that can be used for authentication.
58
CHAPTER 3. JBOSS EAP MANAGEMENT
<rule use-configuration="test-login">
</rule>
</authentication-rules>
<authentication-configurations>
<configuration name="test-login">
<sasl-mechanism-selector selector="BASIC" />
<set-user-name name="eap-user" />
<credentials>
<clear-password password="my_api_key" />
</credentials>
<set-mechanism-realm name="testRealm" />
</configuration>
</authentication-configurations>
</authentication-client>
</configuration>
The following is an example of a command to start the server with the full profile, using the 1.0.x branch
of the remote eap-configuration repository, and passing the URL to an Elytron configuration file
containing authentication credentials.
If you start the server with the argument to use a remote Git repository, JBoss EAP checks whether the
jboss.server.base.dir directory is already configured for Git. If not, JBoss EAP deletes the existing
configuration files in the jboss.server.base.dir directory and replaces them with the remote Git
configuration data. JBoss EAP checks out a branch name passed by the --git-branch argument. If that
argument is not passed, it checks out the master branch. Once this process is complete, you should see
a .git/ directory and a .gitignore file in the base directory for standalone server content.
WARNING
If you later start the server passing a different --git-repo URL or --git-branch name
than was originally used, you will see the error message
java.lang.RuntimeException: WFLYSRV0268: Failed to pull the repository
GIT_REPO_NAME when you attempt to start the server. This is because JBoss
EAP attempts to pull configuration data from a different repository and branch than
the one that is currently configured in the jboss.server.base.dir directory and the
Git pull results in conflicts.
You can also use the WildFly Elytron tool, which you can access using the elytron-tool.sh script, to
generate an SSH keypair and store it in a credential store. The WildFly Elytron tool is useful to use if you
have not previously specified SSH credentials for your server.
When you add your credentials to the elytron configuration file, you can connect to the remote Git SSH
59
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
When you add your credentials to the elytron configuration file, you can connect to the remote Git SSH
repository.
Prerequisite
You have added your credentials to the elytron configuration file. See Use a stored key pair in
the elytron configuration file and see Using OpenSSH keys in the elytron configuration file .
Procedure
Connect to the remote git SSH repository by issuing the following command in your terminal:
Your standalone server starts and the configuration file history of the server is now managed by
the remote Git SSH repository.
Additional resources
For more information about generating an SSH key pair with the elytron-tool.sh script, see
Manage key pairs in the credential store by using the WildFly Elytron tool in the How to
Configure Server Security guide.
For more information about generating and using an OpenSSH key pair, see Using OpenSSH
keys in the elytron configuration file .
The elytron subsystem supports SSH key pairs generated by using the OpenSSH command-line tool.
This tool uses RSA, DSA, and ECDSA algorithms.
You can generate an SSH key pair with the ssh-keygen command.
Additionally, you can use one of three element types to specify your password:
clear-password
masked-password
credential-store-reference
Prerequisites
You have generated an SSH key pair. The following example shows the generation of an ECDSA
key of size 256 megabytes. The passphrase is set as secret.
60
CHAPTER 3. JBOSS EAP MANAGEMENT
Procedure
Specify your key pair in the elytron configuration file by choosing one of the following two
methods:
Use a key pair credential to specify your key pair in the configuration file. For example:
<authentication-configurations>
<configuration name="example">
<credentials>
<key-pair>
<openssh-private-key pem="-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAACmFlczI1Ni1jdHIAAAAGYmNyeXB0AAAAGAAAABDaZzGp
GV
922xmrL+bMHioPAAAAEAAAAAEAAABoAAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIb
mlz
dHAyNTYAAABBBIMTU1m6pmpnSTZ2k/cbKnxXkRpXUmWwqN1SSNLpRswGsUhmLG2
H21br1Z
lEHRiRn6zQmA4YCtCw2hLuz8M8WVoAAADAQk+bMNWFfaI4Ej1AQdlLl6v4RDa2HGjDS
3V4
39h0pOx4Ix7YZKydTN4SPkYRt78CNK0AhhtKsWo2lVNwyfh8/6SeqowhgCG9MJYW8yRR
1R
3DX/eQTx6MV/gSSRLDTpcVWUY0jrBGpMaEvylKoNcabiEo44flkIYlG6E/YtFXsmXsoBsj
nFcjvmfE7Lzyin5Fowwpbqj9f0XOARu9wsUzeyJVAwT7+YCU3mWJ3dnO1bOxK4TuLsxD6
j
RB7bJemsfr
-----END OPENSSH PRIVATE KEY-----">
<clear-password password="secret"/>
</openssh-private-key>
</key-pair>
</credentials>
</configuration>
</authentication-configurations>
The example shows the key pair in OpenSSH format. A passphrase of secret is set as a
clear-password type, and it is required to decrypt the private key.
IMPORTANT
The elytron subsystem supports key pairs in PKCS8 format. However, you
must not encrypt key pairs in the PKCS8 format with a passphrase, because
you might experience issues when you need to decrypt the key pair back to
its original format.
Specify the location of a file that contains your private key in the <ssh-credential> element
of your configuration file. For example:
<authentication-configurations>
61
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
<configuration name="example">
<credentials>
<ssh-credential ssh-directory="/user/home/example/.ssh" private-key-
file="id_test_ecdsa" known-hosts-file="known_hosts_test"> 1 2 3
<clear-password password="secret"/>
</ssh-credential>
</credentials>
</configuration>
</authentication-configurations>
1 The ssh-directory attribute specifies the location of the key and the known host file.
2 The private-key-file attribute specifies the name of the file containing your private
key.
3 The known-hosts-file attribute specifies the name of the file containing the known
SSH hosts.
Additional resources
For information about OpenSSH and its features, see the OpenSSH documentation.
The following management CLI operation publishes the configuration data to the remote eap-
configuration repository.
:publish-configuration(location="=https://github.com/MY_GIT_ID/eap-configuration.git")
{"outcome" => "success"}
The following management CLI operation takes a snapshot and names the tag "snapshot-01".
62
CHAPTER 3. JBOSS EAP MANAGEMENT
:list-snapshots
{
"outcome" => "success",
"result" => {
"directory" => "",
"names" => [
"snapshot : 1st snapshot",
"refs/tags/snapshot-01",
"snapshot2 : 2nd snapshot",
"refs/tags/snapshot-02"
]
}
}
The following management CLI operation deletes the snapshot with the tag name "snapshot-01".
:delete-snapshot(name="snapshot-01")
{"outcome" => "success"}
For example, the default logging subsystem configuration declares jboss.server.log.dir as the logical
name for the server log directory.
JBoss EAP automatically provides a number of standard paths without any need for the user to
configure them in a configuration file.
Property Description
jboss.controller.temp.dir A common alias for standalone servers and managed domains. The
directory to be used for temporary file storage. Equivalent to
jboss.domain.temp.dir in a managed domain, and
jboss.server.temp.dir on a standalone server.
63
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Property Description
jboss.domain.data.dir The directory that the domain will use for persistent data file storage.
jboss.domain.log.dir The directory that the domain will use for persistent log file storage.
jboss.domain.temp.dir The directory that the domain will use for temporary file storage.
jboss.domain.deployment.dir The directory that the domain will use for storing deployed content.
jboss.domain.servers.dir The directory that the domain will use for storing outputs of the
managed domain instances.
jboss.server.data.dir The directory the standalone server will use for persistent data file
storage.
jboss.server.log.dir The directory the standalone server will use for log file storage.
jboss.server.temp.dir The directory the standalone server will use for temporary file storage.
jboss.server.deploy.dir The directory that the standalone server will use for storing deployed
content.
ls /path
NOTE
64
CHAPTER 3. JBOSS EAP MANAGEMENT
NOTE
In a managed domain, you can list the file system paths for a specific server using the
following management CLI command:
ls /host=HOST_NAME/server=SERVER_NAME/path
Use the following management CLI command to read the value of a file system path:
/path=PATH_NAME:read-resource
NOTE
In a managed domain, you can read the value of a file system path for a specific server
using the following management CLI command:
/host=HOST_NAME/server=SERVER_NAME/path=PATH_NAME:read-resource
Pass in the command-line argument when you start the server. For example:
$ EAP_HOME/bin/standalone.sh -Djboss.server.log.dir=/var/log
Modify the JAVA_OPTS variable in the server configuration file, either standalone.conf or
domain.conf, to contain the new location. For example:
JAVA_OPTS="$JAVA_OPTS -Djboss.server.log.dir=/var/log"
To achieve this configuration, you would override several system properties when starting JBoss EAP.
$ EAP_HOME/bin/domain.sh -Djboss.domain.temp.dir=/opt/jboss_eap/domain_data/all_temp -
Djboss.domain.log.dir=/opt/jboss_eap/domain_data/all_logs -
Djboss.domain.data.dir=/opt/jboss_eap/domain_data/all_data -
Djboss.domain.servers.dir=/opt/jboss_eap/domain_data/all_servers
65
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
/opt/jboss_eap/domain_data/
├── all_data
├── all_logs
├── all_servers
│ ├── server-one
│ │ ├── data
│ │ ├── log
│ │ └── tmp
│ └── server-two
│ ├── data
│ ├── log
│ └── tmp
└── all_temp
From the management CLI, you can add a new path using the following management CLI
command.
/path=my.custom.path:add(path=/my/custom/path)
From the management console, you can configure file system paths by navigating to the
Configuration tab, selecting Paths, and clicking View. From there, you can add, modify, and
remove paths.
You can then use this custom path in your configuration. For example, the below log handler uses a
custom path for its relative path.
<subsystem xmlns="urn:jboss:domain:logging:6.0">
...
<periodic-rotating-file-handler name="FILE" autoflush="true">
<formatter>
<named-formatter name="PATTERN"/>
</formatter>
<file relative-to="my.custom.path" path="server.log"/>
<suffix value=".yyyy-MM-dd"/>
<append value="true"/>
</periodic-rotating-file-handler>
...
</subsystem>
66
CHAPTER 3. JBOSS EAP MANAGEMENT
If JBoss EAP is installed using the ZIP installation method, the default directory structure (grouped by
server) will be as follows.
EAP_HOME/domain
└─ servers
├── server-one
│ ├── data
│ ├── tmp
│ └── log
└── server-two
├── data
├── tmp
└── log
To group domain directories by server, enter the following management CLI command:
/host=HOST_NAME:write-attribute(name=directory-grouping,value=by-server)
<servers directory-grouping="by-server">
<server name="server-one" group="main-server-group"/>
<server name="server-two" group="main-server-group" auto-start="true">
<socket-bindings port-offset="150"/>
</server>
</servers>
If JBoss EAP is installed using the ZIP installation method and the domain’s files are grouped by type,
the directory structure will be as follows.
EAP_HOME/domain
├── data
│ └── servers
│ ├── server-one
│ └── server-two
├── log
│ └── servers
│ ├── server-one
│ └── server-two
└── tmp
└── servers
├── server-one
└── server-two
To group domain directories by type, enter the following management CLI command:
/host=HOST_NAME:write-attribute(name=directory-grouping,value=by-type)
67
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
<servers directory-grouping="by-type">
<server name="server-one" group="main-server-group"/>
<server name="server-two" group="main-server-group" auto-start="true">
<socket-bindings port-offset="150"/>
</server>
</servers>
System properties can be used to override default values in the JBoss EAP configuration. For example,
the following XML configuration for the public interface bind address shows that it can be set by the
jboss.bind.address system property, but if the system property is not provided, it will default to
127.0.0.1.
<inet-address value="${jboss.bind.address:127.0.0.1}"/>
There are a few ways you can set system properties in JBoss EAP, including:
If you use a JBoss EAP managed domain, system properties can be applied to either the whole domain, a
specific server group, a specific host and all its server instances, or just to one specific server instance.
As with most other JBoss EAP domain settings, a system property set at a more specific level will
override a more abstract one. See the Domain Management chapter for more information.
$ EAP_HOME/bin/standalone.sh -Djboss.bind.address=192.168.1.2
This method of setting the system property is especially useful for JBoss EAP options that need to be
set before JBoss EAP starts.
/system-property=PROPERTY_NAME:add(value=PROPERTY_VALUE)
For example:
/system-property=jboss.bind.address:add(value=192.168.1.2)
When setting system properties using the management CLI, some JBoss EAP options, including the
above example of jboss.bind.address, will only take effect after the next server restart.
68
CHAPTER 3. JBOSS EAP MANAGEMENT
For a managed domain, the above example configures a system property for the entire domain, but you
can also set or override system properties at more specific levels of the domain configuration.
For a standalone JBoss EAP server, you can configure system properties in the management
console under the Configuration tab. Select System Properties, and click the View button.
Domain-level system properties can be set in the Configuration tab. Select System
Properties, and click the View button.
Server group and server-level system properties can be set in the Runtime tab. Select the
server group or server you want to configure, click the View button next to the server group
or server name, and select the System Properties tab.
Host-level system properties can be set in the Runtime tab. Select the host you want to
configure, then using the drop-down menu next to the host name, select Properties.
For a standalone server, this file is EAP_HOME/bin/standalone.conf, or, for a managed domain, it is
EAP_HOME/bin/domain.conf. For Microsoft Windows systems these files have a .bat extension.
NOTE
For an RPM installation, the RPM service configuration file is the preferred location to
modify JAVA_OPTS to configure system properties. For more information, see
Configure RPM Service Properties .
Add your system property definition to JAVA_OPTS in the relevant configuration file. The examples
below demonstrate setting the bind address on a Red Hat Enterprise Linux system.
For standalone.conf, add your JAVA_OPTS system property definition at the end of the file.
For example:
...
# Set the bind address
JAVA_OPTS="$JAVA_OPTS -Djboss.bind.address=192.168.1.2"
For domain.conf, JAVA_OPTS must be set before the process controller JAVA_OPTS setting.
For example:
...
# Set the bind address
JAVA_OPTS="$JAVA_OPTS -Djboss.bind.address=192.168.1.2"
69
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
In a standalone server, you can set the MODULE_OPTS environment variable in the following files:
On your Windows server, at the command prompt, use the EAP_HOME\bin\standalone.bat file.
For servers in a domain, you can add the module-options attribute to a host JVM configuration or a
server JVM configuration.
NOTE
Login and logout events cannot be audited as there is no authenticated session in JBoss
EAP. Instead, audit messages are logged when an operation is received from the user.
<audit-log>
<formatters>
<json-formatter name="json-formatter"/>
</formatters>
<handlers>
<file-handler name="file" formatter="json-formatter" path="audit-log.log" relative-
to="jboss.server.data.dir"/>
</handlers>
<logger log-boot="true" log-read-only="false" enabled="false">
<handlers>
<handler name="file"/>
</handlers>
</logger>
</audit-log>
This configuration can be read using the following management CLI command.
/core-service=management/access=audit:read-resource(recursive=true)
See Enable Audit Logging to enable audit logging for a standalone server.
Though disabled by default, the default audit logging configuration writes a file for each host and for
70
CHAPTER 3. JBOSS EAP MANAGEMENT
Though disabled by default, the default audit logging configuration writes a file for each host and for
each server.
<audit-log>
<formatters>
<json-formatter name="json-formatter"/>
</formatters>
<handlers>
<file-handler name="host-file" formatter="json-formatter" relative-to="jboss.domain.data.dir"
path="audit-log.log"/>
<file-handler name="server-file" formatter="json-formatter" relative-to="jboss.server.data.dir"
path="audit-log.log"/>
</handlers>
<logger log-boot="true" log-read-only="false" enabled="false">
<handlers>
<handler name="host-file"/>
</handlers>
</logger>
<server-logger log-boot="true" log-read-only="false" enabled="false">
<handlers>
<handler name="server-file"/>
</handlers>
</server-logger>
</audit-log>
This configuration can be read using the following management CLI command.
/host=HOST_NAME/core-service=management/access=audit:read-resource(recursive=true)
See Enable Audit Logging to enable audit logging for a managed domain.
The following instructions enable NATIVE and HTTP audit logging. To configure Jakarta Management
audit logging, see Enable Jakarta Management Management Audit Logging .
To set up syslog audit logging, see Send Management Audit Logging to a Syslog Server .
/core-service=management/access=audit/logger=audit-log:write-attribute(name=enabled,value=true)
Audit logging for each host can be enabled using the following command.
71
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
/host=HOST_NAME/core-service=management/access=audit/logger=audit-log:write-
attribute(name=enabled,value=true)
Audit logging for each server can be enabled using the following command.
/host=HOST_NAME/core-service=management/access=audit/server-logger=audit-log:write-
attribute(name=enabled,value=true)
To configure NATIVE or HTTP audit logging, see Enable Management Audit Logging .
/subsystem=jmx/configuration=audit-log:add()
/subsystem=jmx/configuration=audit-log/handler=file:add()
This enables Jakarta Management audit logging, and then uses the defined file handler to write these
logs to EAP_HOME/standalone/data/audit-log.log.
/host=HOST_NAME/subsystem=jmx/configuration=audit-log:add()
2. Once audit logging for the jmx subsystem has been enabled, a handler can be defined for the
host with the following command.
/host=HOST_NAME/subsystem=jmx/configuration=audit-log/handler=host-file:add()
/profile=PROFILE_NAME/subsystem=jmx/configuration=audit-log:add()
72
CHAPTER 3. JBOSS EAP MANAGEMENT
2. Once audit logging for the jmx subsystem has been enabled, a handler can be defined for the
profile with the following command.
/profile=PROFILE_NAME/subsystem=jmx/configuration=audit-log/handler=server-file:add()
By default, audit logging is preconfigured to output to a file when enabled. Use the following steps to set
up and enable audit logging to a syslog server. See Management Audit Logging Attributes for syslog
handler attributes.
batch
/core-service=management/access=audit/syslog-
handler=SYSLOG_HANDLER_NAME:add(formatter=json-formatter)
/core-service=management/access=audit/syslog-
handler=SYSLOG_HANDLER_NAME/protocol=udp:add(host=HOST_NAME,port=PORT)
run-batch
NOTE
To configure the handler to use TLS to communicate securely with the syslog
server, you must also configure the authentication, for example:
/core-service=management/access=audit/syslog-
handler=SYSLOG_HANDLER_NAME/protocol=tls/authentication=truststore:ad
d(keystore-path=PATH_TO_TRUSTSTORE,keystore-
password=TRUSTSTORE_PASSWORD)
/core-service=management/access=audit/logger=audit-
log/handler=SYSLOG_HANDLER_NAME:add
IMPORTANT
73
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
IMPORTANT
Enabling audit logging to a syslog server in JBoss EAP will not work unless logging is
enabled in the operating system as well.
For more information on rsyslog configurations on Red Hat Enterprise Linux, see the
Basic Configuration of Rsyslog section of the System Administrator’s Guide for Red Hat
Enterprise Linux at https://access.redhat.com/documentation/en/red-hat-enterprise-
linux/.
NOTE
Using a text editor for viewing log files is not recommended as some may prevent further
log entries being written to the log file.
The audit log entries are stored in JSON format. Each log entry begins with an optional timestamp,
followed by the fields in the below table.
booting Has the value true if the operation was executed during the bootup process, or
false if it was executed once the server is up and running.
domainUUID An ID to link together all operations as they are propagated from the domain
controller to its servers, slave host controllers, and slave host controller servers.
ops The operations being executed. This is a list of the operations serialized to JSON.
At boot, this is the operations resulting from parsing the XML. Once booted, the
list typically contains a single entry.
r/o Has the value true if the operation does not change the management model, or
false if it does.
success Has the value true if the operation was successful, orfalse if it was rolled back.
74
CHAPTER 3. JBOSS EAP MANAGEMENT
type This can have the value core, meaning it is a management operation, orjmx,
meaning it comes from the jmx subsystem.
user The username of the authenticated user. If the operation occurred using the
management CLI on the same machine as the running server, the special user
$local is used.
The server runtime configuration states for JBoss EAP are STARTING, RUNNING,
RELOAD_REQUIRED, RESTART_REQUIRED, STOPPING, and STOPPED.
The server running states for JBoss EAP are STARTING, NORMAL, ADMIN_ONLY, PRE_SUSPEND,
SUSPENDING, SUSPENDED, STOPPING, and STOPPED.
3.11.1. Monitor Server Lifecycle Events Using the Core Management Subsystem
You can register a listener to the JBoss EAP core-management subsystem to monitor for server
lifecycle events. The following steps show how to create and register an example listener that logs the
events to a file.
package org.simple.lifecycle.events.listener;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import org.wildfly.extension.core.management.client.ProcessStateListener;
import org.wildfly.extension.core.management.client.ProcessStateListenerInitParameters;
import org.wildfly.extension.core.management.client.RunningStateChangeEvent;
import
org.wildfly.extension.core.management.client.RuntimeConfigurationStateChangeEvent;
75
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
NOTE
76
CHAPTER 3. JBOSS EAP MANAGEMENT
NOTE
In the event of a server reload, listeners stop listening while the server
attempts to stop, and the listeners are reloaded when the server starts.
Because of this, implementations must ensure that they can be loaded,
initialized, and removed properly several times inside the same JVM.
Each listener instance is executed in its own thread and the order is not
guaranteed.
IMPORTANT
Using the module management CLI command to add and remove modules is
provided as Technology Preview only. This command is not appropriate for use in
a managed domain or when connecting to the management CLI remotely.
Modules should be added and removed manually in a production environment.
Technology Preview features are not supported with Red Hat production service
level agreements (SLAs), might not be functionally complete, and Red Hat does
not recommend to use them for production. These features provide early access
to upcoming product features, enabling customers to test functionality and
provide feedback during the development process.
See Technology Preview Features Support Scope on the Red Hat Customer
Portal for information about the support scope for Technology Preview features.
/subsystem=core-management/process-state-listener=my-simple-
listener:add(class=org.simple.lifecycle.events.listener.SimpleListener,
module=org.simple.lifecycle.events.listener,properties={file=/path/to/my-listener-output.txt})
Now, server lifecycle events will be logged to the my-listener-output.txt file based on the
SimpleListener class above. For example, issuing a :suspend command in the management CLI will
output the following to the my-listener-output.txt file.
77
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
This shows that the running state changed from normal to suspending, and then from suspending to
suspended.
import java.io.BufferedWriter;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
import javax.management.AttributeChangeNotification;
import javax.management.Notification;
import javax.management.NotificationListener;
import org.jboss.logging.Logger;
public StateNotificationListener() {
this.targetFile = Paths.get("notifications/data").toAbsolutePath();
init(targetFile);
}
if (!Files.exists(targetFile.resolve(RUNTIME_CONFIGURATION_FILENAME))) {
78
CHAPTER 3. JBOSS EAP MANAGEMENT
Files.createFile(targetFile.resolve(RUNTIME_CONFIGURATION_FILENAME));
}
if (!Files.exists(targetFile.resolve(RUNNING_FILENAME))) {
Files.createFile(targetFile.resolve(RUNNING_FILENAME));
}
} catch (IOException ex) {
Logger.getLogger(StateNotificationListener.class).error("Problem handling JMX
Notification", ex);
}
}
@Override
public void handleNotification(Notification notification, Object handback) {
AttributeChangeNotification attributeChangeNotification = (AttributeChangeNotification)
notification;
if ("RuntimeConfigurationState".equals(attributeChangeNotification.getAttributeName())) {
writeNotification(attributeChangeNotification, getRuntimeConfigurationTargetFile());
} else {
writeNotification(attributeChangeNotification, getRunningConfigurationTargetFile());
}
}
Server lifecycle events are now logged to a file based on the StateNotificationListener class above. For
example, issuing a :suspend command in the management CLI outputs the following to the running-
notifications.txt file.
79
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
This shows that the running state changed from normal to suspending, and then from suspending to
suspended.
80
CHAPTER 4. NETWORK AND PORT CONFIGURATION
4.1. INTERFACES
JBoss EAP references named interfaces throughout the configuration. This allows the configuration to
reference individual interface declarations with logical names, rather than requiring the full details of the
interface at each use.
This also allows for easier configuration in a managed domain, where network interface details can vary
across multiple machines. Each server instance can correspond to a logical name group.
The standalone.xml, domain.xml, and host.xml files all include interface declarations. There are
several preconfigured interface names, depending on which default configuration is used. The
management interface can be used for all components and services that require the management layer,
including the HTTP management endpoint. The public interface can be used for all application-related
network communications. The unsecure interface is used for IIOP sockets in the standard
configuration. The private interface is used for JGroups sockets in the standard configuration.
<interfaces>
<interface name="management">
<inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
</interface>
<interface name="public">
<inet-address value="${jboss.bind.address:127.0.0.1}"/>
</interface>
<interface name="private">
<inet-address value="${jboss.bind.address.private:127.0.0.1}"/>
</interface>
<interface name="unsecure">
<inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/>
</interface>
</interfaces>
By default, JBoss EAP binds these interfaces to 127.0.0.1, but these values can be overridden at
runtime by setting the appropriate property. For example, the inet-address of the public interface can
be set when starting JBoss EAP as a standalone server with the following command.
$ EAP_HOME/bin/standalone.sh -Djboss.bind.address=IP_ADDRESS
Alternatively, you can use the -b switch on the server start command line. For more information about
server start options, see Server runtime arguments and switches .
IMPORTANT
If you modify the default network interfaces or ports that JBoss EAP uses, you must also
remember to change any scripts that use the modified interfaces or ports. These include
JBoss EAP service scripts, as well as remembering to specify the correct interface and
port when accessing the management console or management CLI.
Network interfaces are declared by specifying a logical name and selection criteria for the physical
81
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Network interfaces are declared by specifying a logical name and selection criteria for the physical
interface. The selection criteria can reference a wildcard address or specify a set of one or more
characteristics that an interface or address must have in order to be a valid match. For a listing of all
available interface selection criteria, see the Interface attributes section.
Interfaces can be configured using the management console or the management CLI. Below are several
examples of adding and updating interfaces. The management CLI command is shown first, followed by
the corresponding configuration XML.
/interface=external:add(nic=eth0)
<interface name="external">
<nic name="eth0"/>
</interface>
/interface=default:add(subnet-match=192.168.0.0/16,up=true,multicast=true,not={point-to-point=true})
<interface name="default">
<subnet-match value="192.168.0.0/16"/>
<up/>
<multicast/>
<not>
<point-to-point/>
</not>
</interface>
/interface=public:write-attribute(name=inet-address,value="${jboss.bind.address:192.168.0.0}")
<interface name="public">
<inet-address value="${jboss.bind.address:192.168.0.0}"/>
</interface>
/host=HOST_NAME/server-config=SERVER_NAME/interface=INTERFACE_NAME:add(inet-
address=127.0.0.1)
<servers>
<server name="SERVER_NAME" group="main-server-group">
<interfaces>
<interface name="INTERFACE_NAME">
<inet-address value="127.0.0.1"/>
82
CHAPTER 4. NETWORK AND PORT CONFIGURATION
</interface>
</interfaces>
</server>
</servers>
This allows other sections of the configuration to reference socket bindings by their logical name, rather
than requiring the full details of the socket configuration at each use.
The declarations for these named configurations can be found in the standalone.xml and domain.xml
configuration files. A standalone server contains only one socket binding group, while a managed domain
can contain multiple groups. You can create a socket binding group for each server group in the
managed domain, or share a socket binding group between multiple server groups.
The ports JBoss EAP uses by default depend on which socket binding groups are used and the
requirements of your individual deployments.
There are three types of socket bindings that can be defined in a socket binding group in the JBoss EAP
configuration:
83
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
If HTTPS is enabled for the management console, then port 9993 is used by default.
For detailed information about the default socket bindings, such as default ports and descriptions, see
the Default socket bindings section.
IMPORTANT
If you modify the default network interfaces or ports that JBoss EAP uses, you must also
remember to change any scripts that use the modified interfaces or ports. These include
JBoss EAP service scripts, as well as remembering to specify the correct interface and
port when accessing the management console or management CLI.
Standalone Server
When running as a standalone server, only one socket binding group is defined per configuration file.
Each standalone configuration file (standalone.xml, standalone-ha.xml, standalone-full.xml,
standalone-full-ha.xml, standalone-load-balancer.xml) defines socket bindings for the technologies
used by its corresponding profile.
For example, the default standalone configuration file (standalone.xml) specifies the below socket
bindings.
Managed Domain
When running in a managed domain, all socket binding groups are defined in the domain.xml file. There
are five predefined socket binding groups:
standard-sockets
ha-sockets
full-sockets
full-ha-sockets
84
CHAPTER 4. NETWORK AND PORT CONFIGURATION
load-balancer-sockets
Each socket binding group specifies socket bindings for the technologies used by its corresponding
profile. For example, the full-ha-sockets socket binding group defines several jgroups socket bindings,
which are used by the full-ha profile for high availability.
<socket-binding-groups>
<socket-binding-group name="standard-sockets" default-interface="public">
<!-- Needed for server groups using the 'default' profile -->
<socket-binding name="ajp" port="${jboss.ajp.port:8009}"/>
<socket-binding name="http" port="${jboss.http.port:8080}"/>
<socket-binding name="https" port="${jboss.https.port:8443}"/>
<socket-binding name="txn-recovery-environment" port="4712"/>
<socket-binding name="txn-status-manager" port="4713"/>
<outbound-socket-binding name="mail-smtp">
<remote-destination host="localhost" port="25"/>
</outbound-socket-binding>
</socket-binding-group>
<socket-binding-group name="ha-sockets" default-interface="public">
<!-- Needed for server groups using the 'ha' profile -->
...
</socket-binding-group>
<socket-binding-group name="full-sockets" default-interface="public">
<!-- Needed for server groups using the 'full' profile -->
...
</socket-binding-group>
<socket-binding-group name="full-ha-sockets" default-interface="public">
<!-- Needed for server groups using the 'full-ha' profile -->
<socket-binding name="ajp" port="${jboss.ajp.port:8009}"/>
<socket-binding name="http" port="${jboss.http.port:8080}"/>
<socket-binding name="https" port="${jboss.https.port:8443}"/>
<socket-binding name="iiop" interface="unsecure" port="3528"/>
<socket-binding name="iiop-ssl" interface="unsecure" port="3529"/>
<socket-binding name="jgroups-mping" interface="private" port="0" multicast-
address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="45700"/>
<socket-binding name="jgroups-tcp" interface="private" port="7600"/>
<socket-binding name="jgroups-udp" interface="private" port="55200" multicast-
address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="45688"/>
<socket-binding name="modcluster" port="0" multicast-address="224.0.1.105" multicast-
port="23364"/>
<socket-binding name="txn-recovery-environment" port="4712"/>
<socket-binding name="txn-status-manager" port="4713"/>
<outbound-socket-binding name="mail-smtp">
<remote-destination host="localhost" port="25"/>
</outbound-socket-binding>
</socket-binding-group>
<socket-binding-group name="load-balancer-sockets" default-interface="public">
<!-- Needed for server groups using the 'load-balancer' profile -->
...
</socket-binding-group>
</socket-binding-groups>
NOTE
85
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
NOTE
The socket configuration for the management interfaces is defined in the domain
controller’s host.xml file.
Socket bindings can be configured using the management console or the management CLI. The
following steps go through adding a socket binding group, adding a socket binding, and configuring
socket binding settings using the management CLI.
1. Add a new socket binding group. Note that this step cannot be performed when running as a
standalone server.
/socket-binding-group=new-sockets:add(default-interface=public)
/socket-binding-group=new-sockets/socket-binding=new-socket-binding:add(port=1234)
3. Change the socket binding to use an interface other than the default, which is set by the socket
binding group.
/socket-binding-group=new-sockets/socket-binding=new-socket-binding:write-
attribute(name=interface,value=unsecure)
The following example shows how the XML configuration may look after the above steps have been
completed.
<socket-binding-groups>
...
<socket-binding-group name="new-sockets" default-interface="public">
<socket-binding name="new-socket-binding" interface="unsecure" port="1234"/>
</socket-binding-group>
</socket-binding-groups>
running
reload-required
restart-required
To view the socket bindings and the open ports for a server:
86
CHAPTER 4. NETWORK AND PORT CONFIGURATION
2. Click the server to view the socket binding name and the open ports in the right pane.
Below is an example of setting a port offset of 250 for a server in a managed domain using the
management CLI.
/host=master/server-config=server-two/:write-attribute(name=socket-binding-port-offset,value=250)
Port offsets can be used for servers in a managed domain and for running multiple standalone servers
on the same host.
You can pass in a port offset when starting a standalone server using the jboss.socket.binding.port-
offset property.
$ EAP_HOME/bin/standalone.sh -Djboss.socket.binding.port-offset=100
-Djava.net.preferIPv4Stack=false
-Djava.net.preferIPv6Addresses=true
The following example shows how the JVM options in the startup configuration file may look after
making the above changes.
87
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
JAVA_OPTS="$JAVA_OPTS -
Djboss.modules.system.pkgs=$JBOSS_MODULES_SYSTEM_PKGS -Djava.awt.headless=true"
JAVA_OPTS="$JAVA_OPTS -Djava.net.preferIPv6Addresses=true"
else
/interface=management:write-attribute(name=inet-
address,value="${jboss.bind.address.management:[::1]}")
The following example shows how the XML configuration may look after running the above command.
<interfaces>
<interface name="management">
<inet-address value="${jboss.bind.address.management:[::1]}"/>
</interface>
....
</interfaces>
88
CHAPTER 5. JBOSS EAP SECURITY
See the Security Architecture guide for an overview of general security concepts as well as
JBoss EAP-specific security concepts.
See How to Configure Server Security for information on securing JBoss EAP itself.
See How to Configure Identity Management for information on providing security for
applications deployed to JBoss EAP.
See How to Set Up SSO with Kerberos for information on configuring single sign-on for JBoss
EAP using Kerberos.
See How To Set Up SSO with SAML v2 for information on configuring single sign-on for JBoss
EAP using SAML v2.
89
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
The modular class loader separates all Java classes into logical groups called modules. Each module can
define dependencies on other modules in order to have the classes from that module added to its own
class path. Because each deployed JAR and WAR file is treated as a module, developers can control the
contents of their application’s class path by adding module configuration to their application.
6.1. MODULES
A module is a logical grouping of classes used for class loading and dependency management. JBoss
EAP identifies two different types of modules: static and dynamic. The main difference between the two
is how they are packaged.
Static Modules
Static modules are defined in the EAP_HOME/modules/ directory of the application server. Each
module exists as a subdirectory, for example, EAP_HOME/modules/com/mysql/. Each module
directory then contains a slot subdirectory, which defaults to main and contains the module.xml
configuration file and any required JAR files. All the application server-provided APIs are provided as
static modules, including the Jakarta EE APIs as well as other APIs.
The module name, com.mysql, must match the directory structure for the module, excluding the slot
name, main.
Creating custom static modules can be useful if many applications are deployed on the same server that
use the same third-party libraries. Instead of bundling those libraries with each application, a module
containing these libraries can be created and installed by an administrator. The applications can then
declare an explicit dependency on the custom static modules.
The modules provided in JBoss EAP distributions are located in the system directory within the
EAP_HOME/modules directory. This keeps them separate from any modules provided by third parties.
Any Red Hat provided products that layer on top of JBoss EAP also install their modules within the
system directory.
Users must ensure that custom modules are installed into the EAP_HOME/modules directory, using
90
CHAPTER 6. JBOSS EAP CLASS LOADING
one directory per module. This ensures that custom versions of modules that already exist in the
system directory are loaded instead of the shipped versions. In this way, user-provided modules will take
precedence over system modules.
If you use the JBOSS_MODULEPATH environment variable to change the locations in which JBoss
EAP searches for modules, then the product will look for a system subdirectory structure within one of
the locations specified. A system structure must exist somewhere in the locations specified with
JBOSS_MODULEPATH.
NOTE
Starting with JBoss EAP 7.1, the use of absolute paths in the resource-root path element
of the module.xml file is also supported. This way, your resource libraries can be made
accessible without needing to move them to the EAP_HOME/modules directory.
Dynamic Modules
Dynamic modules are created and loaded by the application server for each JAR or WAR deployment, or
for each subdeployment in an EAR. The name of a dynamic module is derived from the name of the
deployed archive. Because deployments are loaded as modules, they can configure dependencies and
be used as dependencies by other deployments.
Modules are only loaded when required. This usually only occurs when an application is deployed that has
explicit or implicit dependencies.
Predefined Modules
Starting with JBoss EAP 7.2, a set of predefined modules is available to you when you use the default
module loader. The special module, org.jboss.modules, which includes all of the JBoss Modules API, is
always available and is provided by JBoss Modules. The standard Java Platform Module System (JPMS)
modules, which are provided in Java 9 and later, are also available by their standard names. When using
JDK 8, the JDK 9 modules are emulated by JBoss Modules.
For a list of platform modules available on Java 9 or later, see the appropriate JDK documentation.
For the list the platform modules provided for Java 8, see Platform Modules Provided for Java 8 .
NOTE
91
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
NOTE
See the Modules section for complete details about modules and the modular class
loading system.
Deployed applications, such as a JAR or WAR, are loaded as dynamic modules and make use of
dependencies to access the APIs provided by JBoss EAP.
Explicit Dependencies
Explicit dependencies are declared by the developer in a configuration file. A static module can
declare dependencies in its module.xml file. A dynamic module can declare dependencies in the
deployment’s MANIFEST.MF or jboss-deployment-structure.xml deployment descriptor.
Implicit Dependencies
Implicit dependencies are added automatically by JBoss EAP when certain conditions or meta-data
are found in a deployment. The Jakarta EE APIs supplied with JBoss EAP are examples of modules
that are added by detection of implicit dependencies in deployments.
Deployments can also be configured to exclude specific implicit dependencies by using the jboss-
deployment-structure.xml deployment descriptor file. This can be useful when an application
bundles a specific version of a library that JBoss EAP will attempt to add as an implicit dependency.
Optional Dependencies
Explicit dependencies can be specified as optional. Failure to load an optional dependency will not cause
a module to fail to load. However, if the dependency becomes available later it will not be added to the
module’s class path. Dependencies must be available when the module is loaded.
Export a Dependency
A module’s class path contains only its own classes and that of its immediate dependencies. A module is
not able to access the classes of the dependencies of one of its dependencies. However, a module can
specify that an explicit dependency is exported. An exported dependency is provided to any module
that depends on the module that exports it.
For example, Module A depends on Module B, and Module B depends on Module C. Module A can
access the classes of Module B, and Module B can access the classes of Module C. Module A cannot
access the classes of Module C unless:
Global Modules
A global module is a module that JBoss EAP provides as a dependency to every application. Any module
can be made global by adding it to JBoss EAP’s list of global modules. It does not require changes to the
module.
Once you create the module, you must add the module as a dependency if its resources need to be
92
CHAPTER 6. JBOSS EAP CLASS LOADING
Once you create the module, you must add the module as a dependency if its resources need to be
made available to applications.
$ cd EAP_HOME/modules/
$ mkdir -p com/mysql/main
2. Copy the JAR files or other necessary resources to the main/ subdirectory.
$ cp /path/to/mysql-connector-java-8.0.12.jar EAP_HOME/modules/com/mysql/main/
3. Create a module.xml file in the main/ subdirectory, specifying the appropriate resources and
dependencies in the file.
IMPORTANT
93
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
IMPORTANT
Using the module management CLI command to add and remove modules is provided as
Technology Preview only. This command is not appropriate for use in a managed domain
or when connecting to the management CLI remotely. Modules should be added and
removed manually in a production environment.
Technology Preview features are not supported with Red Hat production service level
agreements (SLAs), might not be functionally complete, and Red Hat does not
recommend to use them for production. These features provide early access to
upcoming product features, enabling customers to test functionality and provide
feedback during the development process.
See Technology Preview Features Support Scope on the Red Hat Customer Portal for
information about the support scope for Technology Preview features.
$ EAP_HOME/bin/jboss-cli.sh
3. Use the module add management CLI command to add the new core module.
See Module Command Arguments for the available arguments to customize this command,
such as providing your own module.xml file, using an external module directory, or specifying an
alternative slot for the module. You can also execute module --help for more details on using
this command to add and remove modules.
See the Add an Explicit Module Dependency to a Deployment section of the JBoss EAP
Development Guide for adding application-specific dependencies using deployment descriptors.
See the Define Global Modules section for instructions on adding modules as dependencies to
all applications.
As an example, the following steps add a JAR file containing several properties files as a module and
define a global module, so that an application can then load these properties.
94
CHAPTER 6. JBOSS EAP CLASS LOADING
2. Define this module as a global module so that it is made available to all deployments.
/subsystem=ee:list-add(name=global-modules,value={name=myprops})
3. The application can then retrieve the properties from one of the properties files contained
within the JAR.
Thread.currentThread().getContextClassLoader().getResource("my.properties");
To remove a custom module, remove the module’s directory under EAP_HOME/modules/, which
includes its module.xml file and associated JAR files or other resources. For example, remove the
EAP_HOME/modules/com/mysql/main/ directory to remove a custom MySQL JDBC driver module in
the main slot.
IMPORTANT
Using the module management CLI command to add and remove modules is provided as
Technology Preview only. This command is not appropriate for use in a managed domain
or when connecting to the management CLI remotely. Modules should be added and
removed manually in a production environment.
Technology Preview features are not supported with Red Hat production service level
agreements (SLAs), might not be functionally complete, and Red Hat does not
recommend to use them for production. These features provide early access to
upcoming product features, enabling customers to test functionality and provide
feedback during the development process.
See Technology Preview Features Support Scope on the Red Hat Customer Portal for
information about the support scope for Technology Preview features.
$ EAP_HOME/bin/jboss-cli.sh
3. Use the module remove management CLI command to remove the custom module.
Use the --slot argument if the module to remove is in a slot other than main.
95
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Execute module --help for more details on using this command to add and remove modules.
NOTE
You must know the name of the modules that are to be configured as global modules. For
the complete listing of the included modules and whether they are supported, see Red
Hat JBoss Enterprise Application Platform 7 Included Modules on the Red Hat Customer
Portal. See the Dynamic Module Naming section for naming conventions for modules in
deployments.
Use the following management CLI command to define the list of global modules.
/subsystem=ee:write-attribute(name=global-modules,value=[{name=MODULE_NAME_1},
{name=MODULE_NAME_2}]
Use the following management CLI command to add a single module to the list of existing global
modules.
/subsystem=ee:list-add(name=global-modules,value={name=MODULE_NAME})
Global modules can also be added and removed using the management console by navigating to the EE
subsystem from the Configuration tab and selecting the Global Modules section.
If you want a global module to be accessible by external dependencies, you must explicitly make it
available. The following options are available to make the services in a global module available externally.
/subsystem=ee:write-attribute(name=global-modules,value=[{name=module1,services=true}]
/subsystem=ee:write-attribute(name=global-modules,value=[{name=module1,services=true},
{name=module2,services=false}]
/subsystem=ee:list-add(name=global-modules,value={name=module1,services=true})
When defining the global module using the management console, make sure that the value of
the Services property is On.
96
CHAPTER 6. JBOSS EAP CLASS LOADING
When you create a global directory, the EE subsystem configures a global directory and then scans the
directory to create a JBoss Modules module dependency. The module dependency includes the global
directory libraries and JAR files. This module dependency also contains the following resource loaders:
The EE subsystem adds a module dependency as a system dependency on each deployed application.
Prerequisites
Create a standard directory on your operating system. This standard directory must contain all
the JAR files and resources you need deployed to applications. This creates a directory tree.
Example of a common directory showing a list of common libraries that were copied
to applications:
/my-common-libs/log4j2.xml
/my-common-libs/libs/log4j-api-2.14.1.jar
/my-common-libs/libs/log4j-core-2.14.1.jar
NOTE
Since the server deploys an application and loads the global directory, you cannot
configure the global directory to override the server’s library versions. A global
directory cannot replace libraries shipped with the server.
Procedure
1. Depending on your server setup, create a global directory. You can use the optional relative-to
attribute to set the global directory with a relative path.
[standalone@localhost:9990 /] /subsystem=ee/global-directory=my-common-
libs:add(path=my-common-libs, relative-to=jboss.home.dir)
97
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
[domain@localhost:9990 /] /profile=default/subsystem=ee/global-directory=my-common-
libs:add(path=my-common-libs, relative-to=jboss.server.data.dir)
For a server in a managed domain, you can add the global directory under a JBoss EAP profile,
which is defined in domain.xml, by using the relative-path attribute. You can specify either a
system path or a custom system path to this relative-to attribute.
NOTE
When running a server in managed domain, you must ensure the contents of the
global directory are consistent across all server instances. For example, each host
must contain a local file system directory that includes the global directory
contents.
If you change the contents of the global directory, or you change or add JAR files in a global
directory, you must reload the server to make the changes available to the deployed
applications. For example, if you replace a JAR library in a global directory, reload the server to
ensure it re-scans the global directory and updates the deployed applications with the changed
JAR library.
Additional resources
For information about defining global modules in JBoss EAP, see Define Global Modules.
For information about using logical names for file system paths, see File System Paths .
For information about JBoss EAP profiles, see Managing JBoss EAP Profiles.
For information about using a domain controller, see About the Domain Controller.
Procedure
Depending on your server setup, use the read-resource operation to read the current values of
your global directory configuration.
[standalone@localhost:9990 /] /subsystem=ee/global-directory=my-common-libs:read-
resource
{
98
CHAPTER 6. JBOSS EAP CLASS LOADING
[domain@localhost:9990 /] /subsystem=ee/global-directory=my-common-libs:read-resource
{
"outcome" => "success",
"result" => {
"path" => "my-common-libs",
"relative-to" => "jboss.server.data.dir"
}
}
Procedure
To remove a global directory from your standalone server, use the following command:
[standalone@localhost:9990 /] /subsystem=ee/global-directory=my-common-libs:remove()
To remove a global directory on a server in a managed domain, use the following command:
[domain@localhost:9990 /] /profile=default/subsystem=ee/global-directory=my-common-
libs:remove()
If you do not want a subdeployment to be allowed to access classes belonging to other subdeployments,
then strict subdeployment isolation can be enabled in JBoss EAP. This setting will affect all
deployments.
99
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
/subsystem=ee:write-attribute(name=ear-subdeployments-isolated,value=true)
Subdeployments in an EAR will no longer be able to access resources from other subdeployments.
NOTE
JBOSS_MODULEPATH="/path/to/modules/directory/"
To specify a list of directories use a colon (:) to delimit the list of directories.
NOTE
For Windows Server, use the following syntax to set the JBOSS_MODULEPATH
variable:
To specify a list of directories use a semicolon (;) to delimit the list of directories.
Deployments of WAR and JAR files are named using the following format:
deployment.DEPLOYMENT_NAME
For example, inventory.war and store.jar will have the module names of
deployment.inventory.war and deployment.store.jar respectively.
Subdeployments within an Enterprise Archive (EAR) are named using the following format:
deployment.EAR_NAME.SUBDEPLOYMENT_NAME
100
CHAPTER 6. JBOSS EAP CLASS LOADING
For example, the subdeployment of reports.war within the enterprise archive accounts.ear will
have the module name of deployment.accounts.ear.reports.war.
101
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
When deploying applications, you may want to enable validation for deployment descriptors by setting
the org.jboss.metadata.parser.validate system property to true. This can be done one of the following
ways:
$ EAP_HOME/bin/standalone.sh -Dorg.jboss.metadata.parser.validate=true
By adding it to the server configuration with the following management CLI command.
/system-property=org.jboss.metadata.parser.validate:add(value=true)
A successful deployment does not produce any output to the management CLI, but the server log
displays deployment messages.
Use the deployment deploy-cli-archive to deploy the content from a .cli archive file. A CLI
deployment archive is a JAR file with the .cli extension. It contains application archives that
should be deployed and the CLI script files, deploy.scr and undeploy.scr, containing
commands and operations. One script file, deploy.scr, contains the commands and operations
that deploy the application archives and set up the environment; the other script file,
undeploy.scr, contains the commands to undeploy the application archives and clean up the
environment.
102
CHAPTER 7. DEPLOYING APPLICATIONS
You can also enable the disabled applications using the deployment enable command.
Undeploy an Application
From the management CLI, use the deployment undeploy command and specify the deployment
name. This will delete the deployment content from the repository. See Disable an Application for
keeping the deployment content when undeploying.
A successful undeployment does not produce any output to the management CLI, but the server log
displays undeployment messages.
Similarly, you can use the deployment undeploy-cli-archive to undeploy the content from a .cli archive
file. You can also undeploy all deployments using a wildcard (*).
deployment undeploy *
Disable an Application
Disable a deployed application without removing the deployment content from the repository.
You can use the deployment disable-all command to disable all the deployments.
deployment disable-all
Enable an Application
Enable a disabled deployed application.
You can use the deployment enable-all command to enable all the deployments.
deployment enable-all
List Deployments
From the management CLI, use the deployment info command to list deployment information.
deployment info
The output will show details about each deployment, such as the runtime name, status, and whether it is
enabled.
103
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
You can also list all the deployments using the deployment list command.
A successful deployment does not produce any output to the management CLI, but the server log
displays deployment messages for each affected server.
Use the deployment deploy-cli-archive command to deploy the content from a .cli archive file.
A CLI deployment archive is a JAR file with the .cli extension. It contains application archives
that should be deployed and the CLI script files, deploy.scr and undeploy.scr, containing
commands and operations. One script file, deploy.scr, contains the commands and operations
that deploy the application archives and set up the environment; the other script file,
undeploy.scr, contains the commands to undeploy the application archives and clean up the
environment.
Use the deployment deploy-url command to deploy the content referenced by a URL.
You can also enable the disabled applications using the deployment enable command.
Undeploy an Application
From the management CLI, use the deployment undeploy command and specify the deployment
name. You must also specify the server groups from which the application should be undeployed. See
Disable an Application for undeploying from specific server groups.
Undeploy the application from all server groups with that deployment.
A successful undeployment does not produce any output to the management CLI, but the server log
104
CHAPTER 7. DEPLOYING APPLICATIONS
A successful undeployment does not produce any output to the management CLI, but the server log
displays undeployment messages for each affected server.
Similarly, you can use the deployment undeploy-cli-archive command to undeploy the content from a
.cli archive file. You can also undeploy all deployments using a wildcard ( *).
Disable an Application
Disable a deployed application from specific server groups and retain its content in the repository for
other server groups with that deployment.
You can use the deployment disable-all command to disable all the deployments.
Enable an Application
Enable a disabled deployed application.
You can use the deployment enable-all command to enable all the deployments.
List Deployments
From the management CLI, use the deployment info command to list deployment information. You can
list deployment information by deployment name or by server group.
The output will list the deployment and its state in each server group.
NAME RUNTIME-NAME
helloworld.war helloworld.war
SERVER-GROUP STATE
main-server-group enabled
other-server-group added
105
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
The output will list the deployments and their state for the specified server group.
You can also list all deployments in the domain using the deployment list command.
Deploy an Application
Click the Add (+) button. You can choose to deploy an application by uploading a deployment , adding an
unmanaged deployment, or creating an empty deployment . Deployments are enabled by default.
Upload a deployment
Upload an application that will be copied to the server’s content repository and managed by
JBoss EAP.
Undeploy an Application
Select the deployment and choose the Undeploy option. JBoss EAP removes the deployment from the
content repository.
Disable an Application
Select the deployment and choose the Disable option to disable the application. This undeploys the
deployment, but does not remove it from the content repository.
Replace an Application
Select the deployment and choose the Replace option. Select the new version of the deployment, which
must have the same name as the original, and click Finish. This undeploys and removes the original
version of the deployment, and then deploys the new version.
106
CHAPTER 7. DEPLOYING APPLICATIONS
Content Repository
All managed and unmanaged deployments are listed in the Content Repository section.
Deployments can be added and deployed to server groups here.
Server Groups
Deployments that have been deployed to one or more server groups are listed in the Server
Groups section. Deployments can be enabled and added directly to a server group here.
Add an Application
1. From Content Repository, select a deployment and click the Deploy button.
2. Select one or more server groups to which this deployment should be deployed.
3. Optionally, select the option to enable the deployment on the selected server groups.
Deployments can also be undeployed from multiple server groups at once by selecting the Undeploy
button for the deployment in Content Repository.
Remove an Application
1. If the deployment is still deployed to any server groups, be sure to undeploy the deployment.
2. From Content Repository, select the deployment and click the Remove button.
Disable an Application
This undeploys the deployment, but does not remove it from the content repository.
Replace an Application
1. From Content Repository, select the deployment and click the Replace button.
2. Select the new version of the deployment, which must have the same name as the original, and
click Replace.
This undeploys and removes the original version of the deployment, and then deploys the new version.
107
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
While it is recommended to use the management console or management CLI for application
deployment in a production environment, deploying using the deployment scanner is provided for the
convenience of developers. This allows users to build and test applications in a manner suited for rapid
development cycles. Additionally, the deployment scanner should not be used in conjunction with other
deployment methods.
The deployment scanner is only available when running JBoss EAP as a standalone server.
By default, automatic deployment for XML and zipped content is enabled. For details on configuring
automatic deployment for each content type, see Configure the Deployment Scanner.
WARNING
Deploy an Application
Copy the content to the deployment folder.
$ cp /path/to/test-application.war EAP_HOME/standalone/deployments/
If auto-deployment is enabled, this file will be picked up automatically, deployed, and a .deployed
marker file will be created. If auto-deployment is not enabled, then you will need to manually add a
.dodeploy marker file to trigger deployment.
$ touch EAP_HOME/standalone/deployments/test-application.war.dodeploy
Undeploy an Application
Trigger an undeployment by removing the .deployed marker file.
$ rm EAP_HOME/standalone/deployments/test-application.war.deployed
If auto-deployment is enabled, you can also remove the test-application.war file, which will trigger the
undeployment. Note that this does not apply for exploded deployments.
108
CHAPTER 7. DEPLOYING APPLICATIONS
Redeploy an Application
Create a .dodeploy marker file to initiate redeployment.
$ touch EAP_HOME/standalone/deployments/test-application.war.dodeploy
For details on all available deployment scanner attributes, see the Deployment Scanner Attributes
section.
Use the below management CLI commands to configure the default deployment scanner.
/subsystem=deployment-scanner/scanner=default:write-attribute(name=scan-enabled,value=false)
/subsystem=deployment-scanner/scanner=default:write-attribute(name=scan-interval,value=10000)
This updates the scan interval time from 5000 milliseconds (five seconds) to 10000 milliseconds (ten
seconds).
/subsystem=deployment-scanner/scanner=default:write-
attribute(name=path,value=/path/to/deployments)
This changes the location of the deployment folder from the default location of
EAP_HOME/standalone/deployments to /path/to/deployments.
The path value will be treated as an absolute path unless the relative-to attribute is specified, in which
case it will be relative to that path.
/subsystem=deployment-scanner/scanner=default:write-attribute(name=auto-deploy-
exploded,value=true)
This enables the automatic deployment of exploded content, which is disabled by default.
/subsystem=deployment-scanner/scanner=default:write-attribute(name=auto-deploy-
zipped,value=false)
This disables the automatic deployment of zipped content, which is enabled by default.
109
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
/subsystem=deployment-scanner/scanner=default:write-attribute(name=auto-deploy-xml,value=false)
This disables the automatic deployment of XML content, which is enabled by default.
The following management CLI command adds a new deployment scanner that will check
EAP_HOME/standalone/new_deployment_dir every five seconds for deployments.
/subsystem=deployment-scanner/scanner=new-scanner:add(path=new_deployment_dir,relative-
to=jboss.server.base.dir,scan-interval=5000)
NOTE
The specified directory must already exist or this command will fail with an error.
A new deployment scanner has been defined and the specified directory will be monitored for
deployments.
You can use Maven to deploy applications to JBoss EAP using the WildFly Maven Plugin , which provides
simple operations to deploy and undeploy applications to the application server.
See Using the Quickstart Examples in the JBoss EAP Getting Started Guide for more information on the
JBoss EAP quickstarts.
Deploy an Application
Initialize the WildFly Maven Plugin in your Maven pom.xml file. This should already be configured in the
JBoss EAP quickstart pom.xml files.
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>${version.wildfly.maven.plugin}</version>
</plugin>
110
CHAPTER 7. DEPLOYING APPLICATIONS
From the helloworld quickstart directory, execute the following Maven command.
After issuing the Maven command to deploy, the terminal window shows the following output indicating
a successful deployment.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.981 s
[INFO] Finished at: 2015-12-23T15:06:13-05:00
[INFO] Final Memory: 21M/231M
[INFO] ------------------------------------------------------------------------
The deployment can also be confirmed by viewing the server log of the active server instance.
Undeploy an Application
From the helloworld quickstart directory, execute the following Maven command.
$ mvn wildfly:undeploy
After issuing the Maven command to undeploy, the terminal window shows the following output
indicating a successful undeployment.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.237 s
[INFO] Finished at: 2015-12-23T15:09:10-05:00
[INFO] Final Memory: 10M/183M
[INFO] ------------------------------------------------------------------------
The undeployment can also be confirmed by viewing the server log of the active server instance.
See Using the Quickstart Examples in the JBoss EAP Getting Started Guide for more information on the
JBoss EAP quickstarts.
Deploy an Application
When deploying an application in a managed domain, you must specify the server groups to which the
111
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
When deploying an application in a managed domain, you must specify the server groups to which the
application should be deployed. This is configured in the Maven pom.xml file.
The following configuration in the pom.xml initializes the WildFly Maven Plugin and specifies main-
server-group as the server group to which the application should be deployed.
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>${version.wildfly.maven.plugin}</version>
<configuration>
<domain>
<server-groups>
<server-group>main-server-group</server-group>
</server-groups>
</domain>
</configuration>
</plugin>
From the helloworld quickstart directory, execute the following Maven command.
After issuing the Maven command to deploy, the terminal window shows the following output indicating
a successful deployment.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.005 s
[INFO] Finished at: 2016-09-02T14:36:17-04:00
[INFO] Final Memory: 21M/226M
[INFO] ------------------------------------------------------------------------
The deployment can also be confirmed by viewing the server log of the active server instance.
Undeploy an Application
From the helloworld quickstart directory, execute the following Maven command.
$ mvn wildfly:undeploy
After issuing the Maven command to undeploy, the terminal window shows the following output
indicating a successful undeployment.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.750 s
112
CHAPTER 7. DEPLOYING APPLICATIONS
The undeployment can also be confirmed by viewing the server log of the active server instance.
Deploy an Application
Undeploy an Application
See this Red Hat Knowledgebase article to learn more about programmatically generating the JSON
requests.
Deploy an Application
113
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Undeploy an Application
$ EAP_HOME/bin/standalone.sh -Djboss.server.deploy.dir=/path/to/new_deployed_content
NOTE
$ EAP_HOME/bin/domain.sh -Djboss.domain.deployment.dir=/path/to/new_deployed_content
114
CHAPTER 7. DEPLOYING APPLICATIONS
You can use the jboss-all.xml deployment descriptor to declare dependencies between top-level
deployments.
For example, if you have an app.ear that depends on framework.ear being deployed first, then you can
create an app.ear/META-INF/jboss-all.xml file as shown below.
<jboss xmlns="urn:jboss:1.0">
<jboss-deployment-dependencies xmlns="urn:jboss:deployment-dependencies:1.0">
<dependency name="framework.ear" />
</jboss-deployment-dependencies>
</jboss>
NOTE
You can use the deployment’s runtime name as the dependency name in the jboss-
all.xml file.
IMPORTANT
If you create a jboss-all.xml file in app.ear and you do not deploy framework.ear, the
server attempts to deploy app.ear and fails.
This can be useful if you need to adapt a deployment for different environments that need different
configurations or settings. For example, when moving a deployment through the application lifecycle
from development, to testing, to stage, and finally into production, you might want to swap deployment
descriptors, modify static web resources to change the branding of the application, or even replace JAR
libraries with different versions depending on the target environment. It is also a useful feature for
installations that need to change a configuration but can not modify or crack an archive due to policy or
security restrictions.
When defining a deployment overlay, you specify the file on a file system that will replace the file in the
deployment archive. You must also specify which deployments should be affected by the deployment
overlay. Any affected deployments must be redeployed in order for the changes to take effect.
Parameters
You can use any of the following parameters to configure your deployment overlay:
115
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
content:: A comma-separated list that maps the file on the file system to the file in the archive
that it replaces. The format for each entry is ARCHIVE_PATH=FILESYSTEM_PATH.
Procedure
1. Use the deployment-overlay add management CLI command to add a deployment overlay:
NOTE
2. After you created a deployment overlay, you can add content to an existing overlay, link the
overlay to a deployment, or remove the overlay.
3. Optional: You can specify an overlay configuration to link to an external directory that contains
static web resources, such as HTML, images, or videos, in the <overlay> element. The
<overlay> element is located in the application jboss-web.xml file. With this configuration, you
do not need to repackage the application.
The following example shows system property substitution in the <overlay> element, where
${example.path.to.overlay} defines the /PATH/TO/STATIC/WEB/CONTENT location.
<jboss-web>
<overlay>${example.path.to.overlay}</overlay>
</jboss-web>
/subsystem=ee:write-attribute(name=jboss-descriptor-property-replacement,value=true)
This command adds the following XML content to the ee subsystem in the JBoss EAP
configuration:
<subsystem xmlns="urn:jboss:domain:ee:4.0">
<jboss-descriptor-property-replacement>true</jboss-descriptor-property-replacement>
</subsystem>
116
CHAPTER 7. DEPLOYING APPLICATIONS
Below is an example rollout plan involving five server groups. Operations can be applied to server groups
serially, in-series, or concurrently, concurrent-groups. The syntax is described in more detail in Rollout
Plan Syntax.
Looking at the example above, applying the operation to the servers in the domain is done in three
phases. If the policy for any server group triggers a rollback of the operation across the server group, all
other server groups will be rolled back as well.
1. Server groups group-A and group-B will have the operation applied concurrently. The operation
will be applied to the servers in group-A in series, while all servers in group-B will handle the
operation concurrently. If more than 20% of the servers in group-A fail to apply the operation, it
will be rolled back across that group. If any servers in group-B fail to apply the operation it will be
rolled back across that group.
2. Once all servers in group-A and group-B are complete, the operation will be applied to the
servers in group-C. Those servers will handle the operation concurrently. If more than one server
in group-C fails to apply the operation it will be rolled back across that group.
3. Once all servers in group-C are complete, server groups group-D and group-E will have the
operation applied concurrently. The operation will be applied to the servers in group-D in series,
while all servers in group-E will handle the operation concurrently. If more than 20% of the
servers in group-D fail to apply the operation, it will be rolled back across that group. If any
servers in group-E fail to apply the operation it will be rolled back across that group.
117
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
By defining the rollout plan in the deploy command operation headers. See Deploy Using a
Rollout Plan for details.
By storing the rollout plan using the rollout-plan command and then referencing the plan name
in the deploy command operation headers. See Deploy Using a Stored Rollout Plan for details.
Although each method has a different initial command, both methods use the rollout operation header
to define the rollout plan. This uses the following syntax.
PLAN_NAME is the name for the rollout plan that was stored using the rollout-plan command.
SERVER_GROUP_LIST is the list of server groups. Use a comma ( ,) to separate multiple server
groups to indicate that operations should be performed on each server group sequentially. Use
a caret (^) separator to indicate that operations should be performed on each server group
concurrently.
For each server group, set any of the following policies in parentheses. Use a comma to
separate multiple policies.
rolling-to-servers: A boolean that, if set to true, applies the operation to each server in
the group in series. If the value is false or not specified, the operation will be applied to
the servers in the group concurrently.
NOTE
rollback-across-groups: A boolean that indicates whether the need to rollback the operation
on all the servers in one server group triggers a rollback across all the server groups. This
defaults to false.
The following management CLI command deploys an application to the main-server-group server
group using a deployment plan that specifies rolling-to-servers=true for serial deployment.
118
CHAPTER 7. DEPLOYING APPLICATIONS
1. Use the rollout-plan management CLI command to store a rollout plan. See the Rollout Plan
Syntax for more information on the format.
"rollout-plan" => {
"in-series" => [
{"server-group" => {"main-server-group" => {
"rolling-to-servers" => false,
"max-failed-servers" => 1
}}},
{"server-group" => {"other-server-group" => {
"rolling-to-servers" => true,
"max-failure-percentage" => 20
}}}
],
"rollback-across-groups" => true
}
2. Specify the stored rollout plan name when deploying the application.
The following management CLI command deploys an application to all server groups using the
my-rollout-plan stored rollout plan.
There will only be a single high-level phase. All server groups affected by the operation will have
the operation applied concurrently.
Within each server group, the operation will be applied to all servers concurrently.
Failure on any server in a server group will cause rollback across the group.
119
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Failure of any server group will result in rollback of all other server groups.
NOTE
Updates to static files in a deployment, such as JavaScript and CSS files, take effect
immediately. Changes to other files, such as Java classes, might require an application
redeployment for the changes to take effect.
You can either start with an empty deployment or explode an existing archive deployment and then add
or remove content.
See Viewing Deployment Content to browse the files in a deployment or read the contents of the files.
/deployment=DEPLOYMENT_NAME.war:add(content=[{empty=true}])
The empty=true option is required to confirm that you intended to create an empty deployment.
/deployment=ARCHIVE_DEPLOYMENT_NAME.ear:explode
NOTE
You can also explode an existing archive deployment from the management console.
From the Deployments tab, select the deployment and select the Explode drop down
option.
/deployment=DEPLOYMENT_NAME.war:add-content(content=[{target-
path=/path/to/FILE_IN_DEPLOYMENT, input-stream-index=/path/to/LOCAL_FILE_TO_UPLOAD}]
120
CHAPTER 7. DEPLOYING APPLICATIONS
NOTE
When adding content to a deployment using the add-content operation, content in the
deployment is overwritten by default. You can change this behavior by setting the
overwrite option to false.
/deployment=DEPLOYMENT_NAME.war:remove-content(paths=[/path/to/FILE_1, /path/to/FILE_2])
NOTE
You can also browse contents of a deployment from the management console by
navigating to the Deployments tab, selecting the deployment, and selecting View from
the drop down.
/deployment=helloworld.war:browse-content(path=META-INF/)
This displays the files and directories in the META-INF/ directory of the helloworld.war deployment.
{
"outcome" => "success",
"result" => [
{
"path" => "MANIFEST.MF",
"directory" => false,
"file-size" => 827L
},
{
"path" => "maven/org.jboss.eap.quickstarts/helloworld/pom.properties",
"directory" => false,
"file-size" => 106L
},
{
"path" => "maven/org.jboss.eap.quickstarts/helloworld/pom.xml",
"directory" => false,
"file-size" => 2713L
},
{
"path" => "maven/org.jboss.eap.quickstarts/helloworld/",
121
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
You can also specify the following arguments to the browse-content operation.
archive
Whether to only return archive files.
depth
Specify the depth of files to return.
/deployment=helloworld.war:read-content(path=META-INF/MANIFEST.MF)
This returns a file stream, which can be displayed in the management CLI or saved to the file system .
{
"outcome" => "success",
"result" => {"uuid" => "24ba8e06-21bd-4505-b4d4-bdfb16451b95"},
"response-headers" => {"attached-streams" => [{
"uuid" => "24ba8e06-21bd-4505-b4d4-bdfb16451b95",
"mime-type" => "text/plain"
}]}
}
Use the attachment display command to read the contents of the MANIFEST.MF file.
This displays the contents of the MANIFEST.MF file from the helloworld.war deployment to the
management CLI.
122
CHAPTER 7. DEPLOYING APPLICATIONS
ATTACHMENT 8af87836-2abd-423a-8e44-e731cc57bd80:
Manifest-Version: 1.0
Implementation-Title: Quickstart: helloworld
Implementation-Version: 7.4.0.Beta
Java-Version: 1.8.0_131
Built-By: username
Scm-Connection: scm:git:[email protected]:jboss/jboss-parent-pom.git/quic
kstart-parent/helloworld
Specification-Vendor: JBoss by Red Hat
...
Use the attachment save command to save the contents of the MANIFEST.MF file to the file system.
This saves the MANIFEST.MF file from the helloworld.war deployment to the file system at
path/to/MANIFEST.MF. If you do not specify a file path using the --file argument, the file will be named
using its unique attachment ID and saved in the working directory of the management CLI, which by
default is EAP_HOME/bin/.
123
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
For information on securing a managed domain, see the Securing a Managed Domain section of JBoss
EAP How to Configure Server Security .
Centrally-managed JBoss EAP server collections are known as members of a domain. All JBoss EAP
instances in a domain share a common management policy.
A domain consists of one domain controller, one or more host controllers, and zero or more server
groups per host.
A domain controller is the central point from which the domain is controlled. It ensures that each server
is configured according to the management policy of the domain. The domain controller is also a host
controller.
A host controller is a physical or virtual host that interacts with the domain controller to control the
lifecycle of the application server instances running on its host and to assist the domain controller to
manage them. Each host can contain multiple server groups.
A server group is a set of server instances which have JBoss EAP installed on them and are managed
and configured as one. The domain controller manages the configuration of and applications deployed
onto server groups. Consequently, each server in a server group shares the same configuration and
deployments.
Host controllers are tied to specific physical, or virtual, hosts. You can run multiple host controllers on
the same hardware if you use different configurations, ensuring their ports and other resources do not
conflict. It is possible for a domain controller, a single host controller, and multiple servers to run within
124
CHAPTER 8. DOMAIN MANAGEMENT
Assist the host controllers in ensuring that all running JBoss EAP server instances are
configured in accordance with this policy.
The domain.xml file contains profile configurations available for use by the servers in the domain. A
profile contains the detailed settings of the various subsystems available in that profile. The domain
configuration also includes the definition of socket groups and the server group definitions.
NOTE
It is possible for a JBoss EAP 7 domain controller to administer JBoss EAP 6 hosts and
servers, as long as the hosts and servers are running JBoss EAP 6.2 or later. For more
information, see Configure a JBoss EAP 7.x Domain Controller to Administer JBoss
EAP 6 Instances.
For more information, see the Start a Managed Domain and Domain Controller Configuration sections.
It interacts with the domain controller to help manage the communication between the servers and the
domain controller. Multiple host controllers of a domain can interact with only a single domain controller.
Hence, all the host controllers and server instances running on a single domain mode have a single
domain controller and must belong to the same domain.
The names of the server instances meant to run from this installation.
Configurations specific to the local physical installation. For example, named interface
definitions declared in domain.xml can be mapped to an actual machine-specific IP address in
host.xml. And abstract path names in domain.xml can be mapped to actual file system paths in
host.xml.
125
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
How the host controller contacts the domain controller to register itself and access the
domain configuration.
For more information, see the Start a Managed Domain and Host Controller Configuration sections.
The process controller logs to the EAP_HOME/domain/log/process-controller.log file. You can set
JVM options for the process controller in the EAP_HOME/bin/domain.conf file using the
PROCESS_CONTROLLER_JAVA_OPTS variable.
A domain controller and a host controller enforce the standard configuration on all server instances of
every server group in its domain.
A domain can consist of multiple server groups. Different server groups can be configured with different
profiles and deployments. For example, a domain can be configured with different server tiers providing
different services.
Different server groups can also have the same profile and deployments. This can, for example, allow for
rolling application upgrades where the application is upgraded on one server group and then updated on
a second server group, avoiding a complete service outage.
Management Console
The JBoss EAP management console provides a graphical view of your domain and allows you to easily
126
CHAPTER 8. DOMAIN MANAGEMENT
The JBoss EAP management console provides a graphical view of your domain and allows you to easily
manage hosts, servers, deployments, and profiles for your domain.
Configuration
From the Configuration tab, you can configure the subsystems for each profile used in your domain.
Different server groups in your domain may use different profiles depending the capabilities needed.
Once you select the desired profile, all available subsystems for that profile are listed. For more
information on configuring profiles, see Managing JBoss EAP Profiles.
Runtime
From the Runtime tab, you can manage servers and server groups as well as host configuration. You
can browse the domain by host or by server group.
From Hosts, you can configure host properties and JVM settings as well as add and configure
servers for that host.
From Server Groups, you can add new server groups and configure properties and JVM settings as
well as add and configure servers for that server group. You can perform operations such as starting,
stopping, suspending, and reloading all servers in the selected server group.
From either Hosts or Server Groups, you can add new servers and configure server properties and
JVM settings. You can perform operations such as starting, stopping, suspending, and reloading the
selected server. You can also view runtime information, such as JVM usage, server logs, and
subsystem-specific information.
From Topology, you can see an overview and view detailed information for the hosts, server groups,
and servers in your domain. You can perform operations on each of them, such as reloading or
suspending.
Deployments
From the Deployments tab, you can add and deploy deployments to server groups. You can view all
deployments in the content repository or view deployments deployed to a particular server group.
For more information on deploying applications using the management console, see Deploy an
Application in a Managed Domain
Management CLI
The JBoss EAP management CLI provides a command-line interface to manage hosts, servers,
deployments and profiles for your domain.
/profile=PROFILE_NAME/subsystem=SUBSYSTEM_NAME:read-resource(recursive=true)
NOTE
127
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
NOTE
Instructions and examples throughout this guide may contain management CLI
commands for subsystem configuration that apply when running as a standalone server,
for example:
/subsystem=datasources/data-source=ExampleDS:read-resource
To adjust these management CLI commands to be run in a managed domain, you must
specify the appropriate profile to configure, for example:
/profile=default/subsystem=datasources/data-source=ExampleDS:read-resource
After specifying the appropriate host, you can configure host settings and perform operations on
servers on that host.
/host=HOST_NAME/server=SERVER_NAME:read-resource
After specifying the appropriate host, you can configure servers for that host.
/host=HOST_NAME/server-config=SERVER_NAME:write-
attribute(name=ATTRIBUTE_NAME,value=VALUE)
After specifying the appropriate server group, you can configure server group settings and perform
operations on all servers in the selected server group.
/server-group=SERVER_GROUP_NAME:read-resource
You can deploy applications in a managed domain by using the deploy management CLI command and
specifying the appropriate server groups. For instructions, see Deploy an Application in a Managed
Domain.
The domain controller must be started before any slave servers in any server groups in the domain. Start
the domain controller first, then start any other associated host controllers in the domain.
$ EAP_HOME/bin/domain.sh --host-config=host-master.xml
Depending on your domain setup, you will need to make additional configurations to allow host
controllers to connect. Also see the following example domain setups:
128
CHAPTER 8. DOMAIN MANAGEMENT
$ EAP_HOME/bin/domain.sh --host-config=host-slave.xml
Depending on your domain setup, you will need to make additional configurations connect to, and not
conflict with, the domain controller. Also see the following example domain setups:
IMPORTANT
It is not supported to configure multiple domain or host controllers on the same machine
when using the RPM installation method to install JBoss EAP.
Configure a host as the domain controller by adding the <local/> element in the <domain-controller>
declaration. The <domain-controller> should include no other content.
<domain-controller>
<local/>
</domain-controller>
The host acting as the domain controller must expose a management interface that is accessible to
other hosts in the domain. The HTTP interface is the standard management interface.
<management-interfaces>
<http-interface security-realm="ManagementRealm" http-upgrade-enabled="true">
<socket interface="management" port="${jboss.management.http.port:9990}"/>
</http-interface>
</management-interfaces>
IMPORTANT
129
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
IMPORTANT
It is not supported to configure multiple domain or host controllers on the same machine
when using the RPM installation method to install JBoss EAP.
Use the <domain-controller> element of the configuration to configure a connection to the domain
controller.
<domain-controller>
<remote security-realm="ManagementRealm">
<discovery-options>
<static-discovery name="primary" protocol="${jboss.domain.master.protocol:remote}"
host="${jboss.domain.master.address}" port="${jboss.domain.master.port:9990}"/>
</discovery-options>
</remote>
</domain-controller>
$ EAP_HOME/bin/domain.sh --host-config=host-slave.xml -
Djboss.domain.master.address=IP_ADDRESS
For more information on domain controller discovery, see the Domain Controller Discovery and Failover
section.
Depending on your domain setup, you may also need to provide authentication for the host controller to
be authenticated by the domain controller. See Set Up a Managed Domain on Two Machines for details
on generating a management user with a secret value and updating the host controller configuration
with that value.
1. If set, the host element name attribute in the host.xml configuration file.
3. The value that follows the final period (.) character in the jboss.qualified.host.name system
property, or the entire value if there is no final period (.) character.
4. The value that follows the period (.) character in the HOSTNAME environment variable for
POSIX-based operating systems, the COMPUTERNAME environment variable for Microsoft
Windows, or the entire value if there is no final period (.) character.
A host controller’s name is configured in the host element at the top of the relevant host.xml
configuration file, for example:
130
CHAPTER 8. DOMAIN MANAGEMENT
Use the following procedure to update the host name using the management CLI.
$ EAP_HOME/bin/domain.sh --host-config=host-slave.xml
$ EAP_HOME/bin/jboss-cli.sh --connect --
controller=DOMAIN_CONTROLLER_IP_ADDRESS
/host=EXISTING_HOST_NAME:write-attribute(name=name,value=NEW_HOST_NAME)
This modifies the host name attribute in the host-slave.xml file as follows:
4. Reload the host controller in order for the changes to take effect.
reload --host=EXISTING_HOST_NAME
If a host controller does not have a name set in the configuration file, you can also pass in the host name
at runtime.
Server groups can be configured using the management CLI or from the management console Runtime
tab.
131
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
/server-group=SERVER_GROUP_NAME:add(profile=PROFILE_NAME,socket-binding-
group=SOCKET_BINDING_GROUP_NAME)
/server-group=SERVER_GROUP_NAME:write-attribute(name=ATTRIBUTE_NAME,value=VALUE)
/server-group=SERVER_GROUP_NAME:remove
socket-binding-group: The default socket binding group used for servers in the group. This can
be overridden on a per-server basis.
socket-binding-default-interface: The socket binding group default interface for this server.
socket-binding-port-offset: The default offset to be added to the port values given by the
socket binding group.
jvm: The default JVM settings for all servers in the group. The host controller merges these
settings with any other configuration provided in host.xml to derive the settings used to launch
the server’s JVM.
<servers>
<server name="server-one" group="main-server-group">
</server>
<server name="server-two" group="main-server-group" auto-start="true">
<socket-bindings port-offset="150"/>
</server>
132
CHAPTER 8. DOMAIN MANAGEMENT
A server instance named server-one is associated with main-server-group and inherits the subsystem
configuration and socket bindings specified by that server group. A server instance named server-two is
also associated with main-server-group, but also defines a socket binding port-offset value, so as not
to conflict with the port values used by server-one. A server instance named server-three is associated
with other-server-group and uses that group’s configurations. It also defines a port-offset value and
sets auto-start to false so that this server does not start when the host controller starts.
Servers can be configured using the management CLI or from the management console Runtime tab.
Add a Server
The following management CLI command can be used to add a server.
/host=HOST_NAME/server-config=SERVER_NAME:add(group=SERVER_GROUP_NAME)
Update a Server
The following management CLI command can be used to update server attributes.
/host=HOST_NAME/server-config=SERVER_NAME:write-
attribute(name=ATTRIBUTE_NAME,value=VALUE)
Remove a Server
The following management CLI command can be used to remove a server.
/host=HOST_NAME/server-config=SERVER_NAME:remove
Server Attributes
A server requires the following attributes:
auto-start: Whether or not this server should be started when the host controller starts.
interface: A list of fully-specified named network interfaces available for use on the server.
jvm: The JVM settings for this server. If not declared, the settings are inherited from the parent
server group or host.
133
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
See the below commands for performing these operations using the management CLI.
Start Servers
You can start a single server on a particular host.
/host=HOST_NAME/server-config=SERVER_NAME:start
/server-group=SERVER_GROUP_NAME:start-servers
Stop Servers
You can stop a single server on a particular host.
/host=HOST_NAME/server-config=SERVER_NAME:stop
/server-group=SERVER_GROUP_NAME:stop-servers
Reload Servers
You can reload a single server on a particular host.
/host=HOST_NAME/server-config=SERVER_NAME:reload
/server-group=SERVER_GROUP_NAME:reload-servers
Kill Servers
You can kill all server processes in a specified server group.
/server-group=SERVER_GROUP_NAME:kill-servers
A backup host controller can be promoted to domain contoller if there is a problem with the primary
domain controller. This allows host controllers to automatically fail over to the new domain controller
once it has been promoted.
134
CHAPTER 8. DOMAIN MANAGEMENT
<domain-controller>
<remote security-realm="ManagementRealm">
<discovery-options>
<static-discovery name="primary" protocol="${jboss.domain.master.protocol:remote}"
host="172.16.81.100" port="${jboss.domain.master.port:9990}"/>
<static-discovery name="backup" protocol="${jboss.domain.master.protocol:remote}"
host="172.16.81.101" port="${jboss.domain.master.port:9990}"/>
</discovery-options>
</remote>
</domain-controller>
name
The name for this domain controller discovery option.
host
The remote domain controller’s host name.
port
The remote domain controller’s port.
In the example above, the first discovery option is the one expected to succeed. The second can be
used in failover situations.
NOTE
By default, using the --cached-dc option only caches configuration used by this host
controller, which means that it cannot be promoted to domain controller for the entire
domain. See Cache the Domain Configuration for information on caching the entire
domain configuration to allow a host controller to act as the domain controller.
If the domain controller is unavailable when starting this host controller with --cached-dc, the host
135
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
If the domain controller is unavailable when starting this host controller with --cached-dc, the host
controller will start using the cached configuration saved in the domain.cached-remote.xml file. Note
that this file must exist or the host controller will fail to start.
While in this state, the host controller cannot modify the domain configuration, but can launch servers
and manage deployments.
Once started with the cached configuration, the host controller will continue to attempt to reconnect to
the domain controller. Once the domain controller becomes available, the host controller will
automatically reconnect to it and synchronize the domain configuration. Note that some configuration
changes may require you to reload the host controller to take effect. A warning will be logged on the
host controller if this occurs.
NOTE
The --backup argument defaults this attribute to false to cache the entire domain.
However, if you set this attribute in the host.xml file, that value is used.
You can also use the --cached-dc option alone to create a copy of the domain
configuration, but must set ignore-unused-configuration to false in the host.xml to
cache the entire domain. For example:
<domain-controller>
<remote username="$local" security-realm="ManagementRealm" ignore-unused-
configuration="false">
<discovery-options>
...
</discovery-options>
</remote>
</domain-controller>
136
CHAPTER 8. DOMAIN MANAGEMENT
2. Use the management CLI to connect to the host controller that is to become the new domain
controller.
3. Execute the following command to configure the host controller to act as the new domain
controller.
/host=backup:write-attribute(name=domain-controller.local, value={})
reload --host=HOST_NAME
IMPORTANT
It is not supported to configure more than one JBoss EAP host controller as a system
service on a single machine.
$ cp -r EAP_HOME/domain /path/to/domain1
$ cp -r EAP_HOME/domain /path/to/host1
$ EAP_HOME/bin/domain.sh --host-config=host-master.xml -
Djboss.domain.base.dir=/path/to/domain1
$ EAP_HOME/bin/domain.sh --host-config=host-slave.xml -
Djboss.domain.base.dir=/path/to/host1 -Djboss.domain.master.address=IP_ADDRESS -
Djboss.management.http.port=PORT
NOTE
137
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
NOTE
When starting a host controller, you must specify the address of the domain
controller using the jboss.domain.master.address property.
Additionally, since this host controller is running on the same machine as the
domain controller, you must change the management interface so that it does
not conflict with the domain controller’s management interface. This command
sets the jboss.management.http.port property.
Each instance started in this manner will share the rest of the resources in the base installation directory,
for example, EAP_HOME/modules/, but use the domain configuration from the directory specified by
jboss.domain.base.dir.
NOTE
You can create managed domain on two machines, where one machine is a domain controller and the
other machine is a host. For more information, see About the Domain Controller.
1. On Machine 1
a. Add a management user so that the host can be authenticated by the domain controller.
Use the add-user.sh script to add the management user for the host controller,
HOST_NAME. Make sure to answer yes to the last prompt and note the secret value
provided. This secret value will be used in the host controller configuration, and will appear
similar to the line below:
$ EAP_HOME/bin/domain.sh --host-config=host-master.xml -
Djboss.bind.address.management=IP1
2. On Machine 2
138
CHAPTER 8. DOMAIN MANAGEMENT
<management>
<security-realms>
<security-realm name="ManagementRealm">
<server-identities>
<secret value="SECRET_VALUE" />
</server-identities>
...
$ EAP_HOME/bin/domain.sh --host-config=host-slave.xml -
Djboss.domain.master.address=IP1 -Djboss.bind.address=IP2
You can now manage the domain from the management CLI by specifying the domain controller
address with the --controller parameter when launching.
Or you can manage the domain from the management console at http://IP1:9990.
Configure a JBoss EAP 7.x Domain Controller to Administer JBoss EAP 6 Instances
Configure a JBoss EAP 7.4 domain controller to administer previous minor releases of JBoss
EAP
8.7.1. Configure a JBoss EAP 7.x Domain Controller to Administer JBoss EAP 6
Instances
A JBoss EAP 7.1 domain controller can manage hosts and servers running JBoss EAP 6 as long as they
are JBoss EAP 6.2 or later.
NOTE
For a JBoss EAP 7.0 domain controller managing JBoss EAP 7.0 hosts that are on a
different patch release, there are no configuration changes needed. However, the JBoss
EAP 7.0 domain controller must be running a patch release that is equal to or higher than
the versions on the host controllers that it manages.
Complete the following tasks to successfully manage JBoss EAP 6 instances in a JBoss EAP 7 managed
domain.
1. Add the JBoss EAP 6 configuration to the JBoss EAP 7 domain controller .
139
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
4. Prevent the JBoss EAP 6 instances from receiving JBoss EAP 7 updates .
Once these tasks are complete, you can manage your JBoss EAP 6 servers and configurations from the
JBoss EAP 7 domain controller using the management CLI. Note that JBoss EAP 6 hosts will not be able
to take advantage of new JBoss EAP 7 features, such as batch processing.
WARNING
Because the management console is optimized for the latest version of JBoss EAP,
you should not use it to update your JBoss EAP 6 hosts, servers, and profiles. Use
the management CLI instead when managing your JBoss EAP 6 configurations from
a JBoss EAP 7 managed domain.
8.7.1.1. Add the JBoss EAP 6 Configuration to the JBoss EAP 7 Domain Controller
To allow the domain controller to manage your JBoss EAP 6 servers, you must provide the JBoss EAP 6
configuration details in the JBoss EAP 7 domain configuration. You can do this by copying the JBoss
EAP 6 profiles, socket binding groups, and server groups to the JBoss EAP 7 domain.xml configuration
file.
You will need to rename resources if any conflict with the existing names in the JBoss EAP 7
configuration. There are also some additional adjustments to make to ensure the proper behavior.
The following procedure uses the JBoss EAP 6 default profile, standard-sockets socket binding group,
and main-server-group server group.
1. Edit the JBoss EAP 7 domain.xml configuration file. It is recommended to back up this file
before editing.
2. Copy the applicable JBoss EAP 6 profiles to the JBoss EAP 7 domain.xml file.
This procedure assumes that the JBoss EAP 6 default profile was copied and renamed to eap6-
default.
<profiles>
...
<profile name="eap6-default">
...
</profile>
</profiles>
140
CHAPTER 8. DOMAIN MANAGEMENT
<extensions>
...
<extension module="org.jboss.as.configadmin"/>
<extension module="org.jboss.as.threads"/>
<extension module="org.jboss.as.web"/>
<extensions>
4. Copy the applicable JBoss EAP 6 socket binding groups to the JBoss EAP 7 domain.xml file.
This procedure assumes that the JBoss EAP 6 standard-sockets socket binding group was
copied and renamed to eap6-standard-sockets.
<socket-binding-groups>
...
<socket-binding-group name="eap6-standard-sockets" default-interface="public">
...
</socket-binding-group>
</socket-binding-groups>
5. Copy the applicable JBoss EAP 6 server groups to the JBoss EAP 7 domain.xml file.
This procedure assumes that the JBoss EAP 6 main-server-group server group was copied and
renamed to eap6-main-server-group. You must also update this server group to use the JBoss
EAP 6 profile, eap6-default, and the JBoss EAP 6 socket binding group, eap6-standard-
sockets.
<server-groups>
...
<server-group name="eap6-main-server-group" profile="eap6-default">
...
<socket-binding-group ref="eap6-standard-sockets"/>
</server-group>
</server-groups>
Additional updates to the profiles used by your JBoss EAP 6 instances are necessary depending on the
JBoss EAP version and desired behavior. You may require additional changes depending on the
subsystems and configuration that your existing JBoss EAP 6 instances use.
Start the JBoss EAP 7 domain controller and launch its management CLI to perform the following
updates. These examples assume that the JBoss EAP 6 profile is eap6-default.
/profile=eap6-default/subsystem=bean-validation:remove
141
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
/profile=eap6-default/subsystem=weld:write-attribute(name=require-bean-
descriptor,value=true)
/profile=eap6-default/subsystem=weld:write-attribute(name=non-portable-mode,value=true)
/profile=eap6-default/subsystem=datasources/data-source=ExampleDS:write-
attribute(name=statistics-enabled,value=true)
8.7.1.3. Set the Server Group for the JBoss EAP 6 Servers
If you renamed the server groups, you need to update the JBoss EAP 6 host configuration to use the
new server groups specified in the JBoss EAP 7 configuration. This example uses the eap6-main-
server-group server group specified in the JBoss EAP 7 domain.xml.
<servers>
<server name="server-one" group="eap6-main-server-group"/>
<server name="server-two" group="eap6-main-server-group">
<socket-bindings port-offset="150"/>
</server>
</servers>
NOTE
A host cannot use features or configuration settings that were introduced in a newer
version of JBoss EAP than the one the host is running.
8.7.1.4. Prevent the JBoss EAP 6 Instances from Receiving JBoss EAP 7 Updates
The domain controller in a managed domain forwards configuration updates to its host controllers. You
must use the host-exclude configuration to specify the resources that should be hidden from particular
versions. Choose the appropriate preconfigured host-exclude option for your JBoss EAP 6 version:
EAP62, EAP63, EAP64, or EAP64z.
142
CHAPTER 8. DOMAIN MANAGEMENT
The active-server-groups attribute of the host-exclude configuration specifies the list of server
groups that are used by a particular version. These server groups and their associated profiles, socket
binding groups, and deployment resources will be available to hosts of this version, but all others will be
hidden from these hosts.
This example assumes that the version is JBoss EAP 6.4.z and adds the JBoss EAP 6 server group
eap6-main-server-group as an active server group.
/host-exclude=EAP64z:write-attribute(name=active-server-groups,value=[eap6-main-server-group])
If necessary, you can specify additional socket binding groups used by your servers using the active-
socket-binding-groups attribute. This is only required for socket binding groups that are not associated
with the server groups specified in active-server-groups.
8.7.2. Configure a JBoss EAP 7.4 Domain Controller to Administer Previous Minor
Releases of JBoss EAP
A JBoss EAP 7.4 domain controller can manage hosts and servers running from a previous minor release
of JBoss EAP.
NOTE
For a JBoss EAP 7.4 domain controller that manages hosts with JBoss EAP 7.4 or earlier
on different minor versions or patch releases, you don’t need to make any configuration
changes. However, you must run the JBoss EAP 7.4 domain controller on a patch release
that’s equal to or higher than the versions on the host controllers it manages, in case the
hosts run JBoss EAP 7.4.
Complete the following tasks to successfully manage JBoss EAP 7.3 instances in a JBoss EAP 7.4
managed domain.
1. Add the JBoss EAP 7.3 configuration to the JBoss EAP 7.4 domain controller .
2. Set the server group for the JBoss EAP 7.3 servers .
3. Prevent the JBoss EAP 7.3 instances from receiving JBoss EAP 7.4 updates .
After you complete these tasks, you can manage your JBoss EAP 7.3 servers and configurations from
the JBoss EAP 7.4 domain controller using the management CLI.
WARNING
Because the management console is optimized for the latest version of JBoss EAP,
you must use the CLI to manage your JBoss EAP 7.3 configurations from a JBoss
EAP 7.4 managed domain. Do not use the management console to update JBoss
EAP 7.3 hosts, servers, and profiles.
143
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
8.7.2.1. Add the JBoss EAP 7.3 Configuration to the JBoss EAP 7.4 Domain Controller
To enable the domain controller to manage your JBoss EAP 7.3 servers, you must provide the JBoss
EAP 7.3 configuration details in the JBoss EAP 7.4 domain configuration. You can do this by copying the
JBoss EAP 7.3 profiles, socket binding groups, and server groups to the JBoss EAP 7.4 domain.xml
configuration file.
You must rename a resource if its name conflicts with resource names in the JBoss EAP 7.4
configuration.
The following procedure uses the JBoss EAP 7.3 default profile, standard-sockets socket binding
group, and main-server-group server group.
Prerequisites
You have copied and renamed the JBoss EAP 7.3 default profile to eap73-default.
You have copied and renamed the JBoss EAP 7.3 standard-sockets socket binding group to
eap73-standard-sockets.
You have copied and renamed the JBoss EAP 7.3 main-server-group server group to eap73-
main-server-group.
You have updated the server group to use the JBoss EAP 7.3 profile, eap73-default, and to
use the JBoss EAP 7.3 socket binding group, eap73-standard-sockets.
Procedures
IMPORTANT
Back up the JBoss EAP 7.4 domain.xml configuration file before you edit the
file.
2. Copy the applicable JBoss EAP 7.3 profiles to the JBoss EAP 7.4 domain.xml file. For example:
<profiles>
...
<profile name="eap73-default">
...
</profile>
</profiles>
3. Copy the applicable JBoss EAP 7.3 socket binding groups to the JBoss EAP 7.4 domain.xml
file. For example:
<socket-binding-groups>
...
<socket-binding-group name="eap73-standard-sockets" default-interface="public">
...
</socket-binding-group>
</socket-binding-groups>
4. Copy the applicable JBoss EAP 7.3 server groups to the JBoss EAP 7.4 domain.xml file:
144
CHAPTER 8. DOMAIN MANAGEMENT
<server-groups>
...
<server-group name="eap73-main-server-group" profile="eap73-default">
...
<socket-binding-group ref="eap73-standard-sockets"/>
</server-group>
</server-groups>
8.7.2.2. Set the Server Group for the JBoss EAP7.3 Servers
If you renamed the server groups, you need to update the JBoss EAP 7.3 host configuration to use the
new server groups specified in the JBoss EAP 7.4 configuration. This example uses the eap73-main-
server-group server group specified in the JBoss EAP 7.4 domain.xml.
<servers>
<server name="server-one" group="eap73-main-server-group"/>
<server name="server-two" group="eap73-main-server-group">
<socket-bindings port-offset="150"/>
</server>
</servers>
NOTE
A host cannot use features or configuration settings that were introduced in a newer
version of JBoss EAP than the one the host is running.
8.7.2.3. Prevent the JBoss EAP 7.3 Instances from Receiving JBoss EAP 7.4 Updates
A managed domain controller forwards configuration updates to its host controllers, so that a JBoss
EAP 7.3 host does not receive configuration and resources that are specific to JBoss EAP 7.4. You must
configure the JBoss EAP 7.3 host to ignore those resources. You can do this by setting the ignore-
unused-configuration attribute on the JBoss EAP 7.3 host.
NOTE
You can also use the host-exclude configuration to instruct the domain controller to
hide certain resources from hosts running certain JBoss EAP versions. For an example of
how to use the host-exclude configuration, see Prevent the JBoss EAP 6 Instances from
Receiving JBoss EAP 7 Updates. For JBoss EAP 7.3, you use the EAP73 host-exclude
option.
Set the ignore-unused-configuration attribute to true in the JBoss EAP 7.3 host controller connection
configuration to the remote domain controller.
<domain-controller>
<remote security-realm="ManagementRealm" ignore-unused-configuration="true">
<discovery-options>
<static-discovery name="primary" protocol="${jboss.domain.master.protocol:remote}"
host="${jboss.domain.master.address}" port="${jboss.domain.master.port:9990}"/>
145
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
</discovery-options>
</remote>
</domain-controller>
With this setting, only the server groups used by this host, and their associated profiles, socket binding
groups, and deployment resources, are made available to the host. All other resources are ignored.
JBoss EAP comes with five predefined profiles that should satisfy most use cases:
default
Includes commonly used subsystems, such as logging, security, datasources, infinispan,
webservices, ee, ejb3, transactions, and so on.
ha
Includes the subsystems provided in the default profile with the addition of the jgroups and
modcluster subsystems for high availability
full
Includes the subsystems provided in the default profile with the addition of the messaging-
activemq and iiop-openjdk subsystems
full-ha
Includes the subsystems provided in the full profile with the addition of the jgroups and modcluster
subsystems for high availability
load-balancer
Includes the minimum subsystems necessary to use the built-in mod_cluster front-end load balancer
to load balance other JBoss EAP instances.
NOTE
JBoss EAP offers the ability to disable extensions or unload drivers and other services
manually by removing the subsystems from the configuration of existing profiles.
However, for most cases this is unnecessary. Since JBoss EAP dynamically loads
subsystems as they are needed, if the server or an application never use a subsystem, it
will not be loaded.
In cases where the existing profiles do not provide the necessary capabilities, JBoss EAP also provides
the ability to define custom profiles as well.
A profile can be cloned using the management CLI by using the clone operation on the desired profile
146
CHAPTER 8. DOMAIN MANAGEMENT
A profile can be cloned using the management CLI by using the clone operation on the desired profile
to clone.
/profile=full-ha:clone(to-profile=cloned-profile)
You can also clone a profile from the management console by selecting the desired profile to clone and
clicking Clone.
The managed domain defines several profiles in domain.xml. If multiple profiles use the same
configuration for a particular subsystem, you can configure it in just one place instead of different
profiles. The values in parent profiles cannot be overridden.
In addition, each profile must be self-sufficient. If an element or subsystem is referenced, then it must be
defined in the profile where it is referenced.
A profile can include other profiles in a hierarchy using the management CLI by using the list-add
operation and providing the profile to include.
/profile=new-profile:list-add(name=includes, value=PROFILE_NAME)
147
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
For a standalone JBoss EAP server instance, the server startup processes pass JVM settings to the
JBoss EAP server at startup. These can be declared from the command line before launching JBoss
EAP, or using the System Properties page under Configuration in the management console.
In a managed domain, JVM settings are declared in the host.xml and domain.xml configuration files,
and can be configured at host, server group, or server levels.
NOTE
$ export JAVA_OPTS="-Xmx1024M"
set JAVA_OPTS="Xmx1024M"
Alternatively, JVM settings can be added to the standalone.conf file, or standalone.conf.bat for
Windows Server, in the EAP_HOME/bin folder, which contains examples of options to pass to the JVM.
Besides setting the JAVA_OPTS environment variable, you can set system properties using one of the
following alternative ways:
$ EAP_HOME/bin/standalone.sh -Dmyproperty=value
148
CHAPTER 9. CONFIGURING JVM SETTINGS
WARNING
If system properties are set using multiple ways, the values in the JBoss profile
configuration file, standalone*.xml or domain.xml override the other values, which
may cause JBoss EAP startup issues. For example, if you have defined system
settings in the JAVA_OPTS environment variable and in the JBoss profile
configuration file, the values in JBoss profile configuration override the values in
JAVA_OPTS.
By default, server groups and individual servers will inherit the JVM settings from their parent, but you
can choose to override JVM settings at each level.
NOTE
The JVM settings in domain.conf, or domain.conf.bat for Windows Server, are applied
to the Java process of the JBoss EAP host controller, and not the individual JBoss EAP
server instances controlled by that host controller.
See Managed Domain JVM Configuration Attributes for descriptions of all available options.
You can also create and edit JVM settings in the JBoss EAP management console by navigating to
Runtime → Hosts, choosing a host and clicking View, and selecting the JVMs tab.
These settings are stored in the within the <jvm> tag in host.xml.
/server-group=groupA:add(profile=default, socket-binding-group=standard-sockets)
/server-group=groupA/jvm=production_jvm:add
149
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
All servers in the server group will inherit JVM settings from production_jvm.
You can also override specific JVM settings at the server group level. For example, to set a different
heap size, you can use the following command:
/server-group=groupA/jvm=production_jvm:write-attribute(name=heap-size,value="1024m")
After applying the above command, the server group groupA will inherit the JVM settings from
production_jvm, except for the heap size which has an overridden value of 1024m.
See Managed Domain JVM Configuration Attributes for descriptions of all available options.
You can also edit server group JVM settings in the JBoss EAP management console by navigating to
Runtime → Server Groups, choosing a server group and clicking View, and selecting the JVMs tab.
For example, the following command overrides the JVM definition of the server group in the previous
example, and sets the JVM settings for server-one to the default JVM definition:
/host=HOST_NAME/server-config=server-one/jvm=default:add
Also, similar to server groups, you can override specific JVM settings at the server level. For example, to
set a different heap size, you can use the following command:
/host=HOST_NAME/server-config=server-one/jvm=default:write-attribute(name=heap-
size,value="1024m")
See Managed Domain JVM Configuration Attributes for descriptions of all available options.
You can also edit server JVM settings in the JBoss EAP management console by navigating to Runtime
→ Hosts, choosing the host, clicking View on the server, and selecting the JVMs tab.
Navigate to the Runtime tab, select the server, and select Status.
To display the JVM status for a JBoss EAP server in a managed domain:
Navigate to Runtime → Hosts, select the host and server, and select Status.
150
CHAPTER 9. CONFIGURING JVM SETTINGS
Max
The maximum amount of memory that can be used for memory management.
Used
The amount of used memory.
Committed
The amount of memory that is committed for the Java Virtual Machine to use.
Other information, such as JVM uptime and thread usage, is also available.
151
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
1. Configure the SMTP server and the outbound socket binding using the following CLI
commands, for example:
/socket-binding-group=standard-sockets/remote-destination-outbound-socket-binding=my-
smtp:add(host=localhost, port=25)
/subsystem=mail/mail-session=mySession:add(jndi-name=java:jboss/mail/MySession)
/subsystem=mail/mail-session=mySession/server=smtp:add(outbound-socket-binding-
ref=my-smtp, username=user, password=pass, tls=true)
@Resource(lookup="java:jboss/mail/MySession")
private Session session;
For a full list of the attributes available for configuring mail sessions and servers, see Mail Subsystem
Attributes.
Defining the outbound-socket-binding-ref may not be the most effective solution for users who have
their host configuration using multiple hosts for load balancing purposes. Standard Jakarta Mail does
not support host configuration using multiple hosts for load balancing. Therefore, users who have this
configuration using multiple hosts are required to implement custom mail transports. These custom mail
transports do not require the outbound-socket-binding-ref and allow custom host property formats.
You can configure custom mail transports from the management CLI.
/subsystem=mail/mail-session=mySession:add(jndi-name=java:jboss/mail/MySession)
2. Add an outbound socket binding and specify the host and port.
/socket-binding-group=standard-sockets/remote-destination-outbound-socket-binding=my-
smtp-binding:add(host=localhost, port=25)
152
CHAPTER 10. MAIL SUBSYSTEM
3. Add an SMTP server and specify the outbound socket binding, username, and password.
/subsystem=mail/mail-session=mySession/server=smtp:add(outbound-socket-binding-
ref=my-smtp-binding, username=user, password=pass, tls=true)
NOTE
POP3 Server
/socket-binding-group=standard-sockets/remote-destination-outbound-socket-
binding=my-pop3-binding:add(host=localhost, port=110)
/subsystem=mail/mail-session=mySession/server=pop3:add(outbound-socket-binding-
ref=my-pop3-binding, username=user, password=pass)
IMAP Server
/socket-binding-group=standard-sockets/remote-destination-outbound-socket-
binding=my-imap-binding:add(host=localhost, port=143)
/subsystem=mail/mail-session=mySession/server=imap:add(outbound-socket-binding-
ref=my-imap-binding, username=user, password=pass)
To use a custom server, create a custom mail server without an outbound socket binding. You can
specify the host information in the properties definition of the custom mail server. For example:
/subsystem=mail/mail-
session=mySession/custom=myCustomServer:add(username=user,password=pass, properties=
{"host" => "myhost", "my-property" =>"value"})
If you define a custom protocol, any property name that includes a period (.) is considered a fully-
qualified name and is passed directly. Any other format, such as my-property, is translated in the
following format: mail.server-name.my-property.
The following XML is an example mail configuration that includes custom servers.
<subsystem xmlns="urn:jboss:domain:mail:3.0">
<mail-session name="default" jndi-name="java:jboss/mail/Default">
<smtp-server outbound-socket-binding-ref="mail-smtp"/>
</mail-session>
<mail-session name="myMail" from="[email protected]" jndi-name="java:/Mail">
<smtp-server password="password" username="user" tls="true" outbound-socket-binding-
ref="mail-smtp"/>
<pop3-server outbound-socket-binding-ref="mail-pop3"/>
<imap-server password="password" username="nobody" outbound-socket-binding-ref="mail-
imap"/>
</mail-session>
<mail-session name="custom" jndi-name="java:jboss/mail/Custom" debug="true">
<custom-server name="smtp" password="password" username="username">
<property name="host" value="mail.example.com"/>
</custom-server>
</mail-session>
<mail-session name="custom2" jndi-name="java:jboss/mail/Custom2" debug="true">
153
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
/subsystem=mail/mail-session=mySession/server=smtp:add(outbound-socket-binding-ref=my-smtp-
binding, username=user, credential-reference={store=exampleCS, alias=mail-session-pw}, tls=true)
NOTE
credential-reference={clear-text="MASK-Ewcyuqd/nP9;A1B2C3D4;351"}
1. Access the management console. For more information, see the Management Console.
4. Select Server and choose the appropriate mail session server. You can configure the credential
reference in the Credential Reference tab and edit other attributes in the Attributes tab.
154
CHAPTER 11. LOGGING WITH JBOSS EAP
This file is often referred to as the server log. For more information, see the Root Logger section.
Bootup logging configuration is specified in the logging.properties configuration file, which is active
until the JBoss EAP logging subsystem is started and takes over. The location of this file depends on
your operating mode.
Managed domain:
There is a logging.properties file for the domain controller and for each server.
Server: EAP_HOME/domain/servers/SERVER_NAME/data/logging.properties
WARNING
It is recommended that you do not directly edit the logging.properties file unless
you know of a specific use case that requires it. Before doing so, it is recommended
that you open a support case from the Red Hat Customer Portal .
When troubleshooting JBoss EAP, checking for errors that occurred during bootup should be one of the
155
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
When troubleshooting JBoss EAP, checking for errors that occurred during bootup should be one of the
first steps taken. You can then use the information provided to diagnose and resolve their causes. Open
a support case for assistance in troubleshooting bootup errors.
There are two methods of viewing bootup errors, each with its advantages. You can examine the
server.log file or read the boot errors using the read-boot-errors management CLI command .
This method allows you to see each error message together with possibly related messages, allowing you
to get more information about why an error might have occurred. It also allows you to see error
messages in plain text format.
3. Search backward for the WFLYSRV0049 message identifier, which marks the start of the latest
bootup sequence.
4. Search the log from that point onward for instances of ERROR. Each instance will include a
description of the error and list the modules involved.
The following is an example error description from the server.log log file.
This method does not require access to the server’s file system, which is useful for anyone responsible
for monitoring for errors who does not have file system access. Since it is a management CLI command,
it can be used in a script. For example, you could write a script that starts multiple JBoss EAP instances,
then checks for errors that occurred on bootup.
/core-service=management:read-boot-errors
{
"outcome" => "success",
156
CHAPTER 11. LOGGING WITH JBOSS EAP
"result" => [
{
"failed-operation" => {
"operation" => "add",
"address" => [
("subsystem" => "undertow"),
("server" => "default-server"),
("http-listener" => "default")
]
},
"failure-description" => "{\"WFLYCTL0080: Failed services\" =>
{\"jboss.undertow.listener.default\" => \"org.jboss.msc.service.StartException in service
jboss.undertow.listener.default: Could not start http listener
Caused by: java.net.BindException: Address already in use\"}}",
"failed-services" => {"jboss.undertow.listener.default" =>
"org.jboss.msc.service.StartException in service jboss.undertow.listener.default: Could not start http
listener
Caused by: java.net.BindException: Address already in use"}
}
...
]
}
$ export GC_LOG=false
$ EAP_HOME/bin/standalone.sh
157
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
NOTE
For Windows Server, the JBoss EAP startup configuration files are standalone.conf.bat
and domain.conf.bat.
Log messages that have been internationalized and localized will use this default locale. See the JBoss
EAP Development Guide for information on creating internationalized log messages .
JAVA_OPTS="$JAVA_OPTS -Duser.language=fr"
Log messages that have been internationalized and localized will now output in French.
Log messages that have been internationalized and localized will now output in Brazilian Portuguese.
To start the JBoss EAP server with a different locale than the system default, you can edit
EAP_HOME/bin/standalone.conf or the EAP_HOME/bin/domain.conf file, depending on your
operating mode, and append the following command to set the JVM parameter for the required locale.
158
CHAPTER 11. LOGGING WITH JBOSS EAP
The value of the property must be specified in the BCP 47 format. For example, to set Brazilian
Portuguese, use pt-BR.
JAVA_OPTS="$JAVA_OPTS -Dorg.jboss.logging.locale=pt-BR"
For a log to be accessible from one of the management interfaces, it must be located in the directory
specified by the server’s jboss.server.log.dir property and be defined as a file, periodic rotating, size
rotating, or periodic size rotating log handler. RBAC role assignments are also honored, so a user logged
in to the management console or CLI can only view logs that they are authorized to access.
2. Select Log Files and choose a log file from the list.
3. Click View to view and search log contents, or choose Download from the drop down to
download the log file to your local file system.
WARNING
The management console log viewer is not intended to be a text editor replacement
for viewing very large log files, for example, greater than 100MB. You will be
prompted for confirmation if you attempt to open a log file that is larger than 15MB.
Opening a very large file in the management console could crash your browser, so
you should always download large log files locally and open them in a text editor.
/subsystem=logging/log-file=LOG_FILE_NAME:read-log-file
NOTE
You can use the following parameters to customize the log output.
159
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
encoding
The character encoding used to read the file.
lines
The number of lines to read from the file. A value of -1 will read all log lines. The default is 10.
skip
The number of lines to skip before reading. The default is 0.
tail
Whether to read from the end of the file. Defaults to true.
For example, the following management CLI command reads the first 5 lines from the top of the
server.log log file.
/subsystem=logging/log-file=server.log:read-log-file(lines=5,tail=false)
{
"outcome" => "success",
"result" => [
"2016-03-24 08:49:26,612 INFO [org.jboss.modules] (main) JBoss Modules version 1.5.1.Final-
redhat-1",
"2016-03-24 08:49:26,788 INFO [org.jboss.msc] (main) JBoss MSC version 1.2.6.Final-redhat-
1",
"2016-03-24 08:49:26,863 INFO [org.jboss.as] (MSC service thread 1-7) WFLYSRV0049:
JBoss EAP 7.0.0.GA (WildFly Core 2.0.13.Final-redhat-1) starting",
"2016-03-24 08:49:27,973 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0039:
Creating http management service using socket-binding (management-http)",
"2016-03-24 08:49:27,994 INFO [org.xnio] (MSC service thread 1-1) XNIO version 3.3.4.Final-
redhat-1"
]
}
Logging profiles allow uniquely-named sets of logging configuration to be created and assigned to
applications independent of any other logging configuration. The configuration of logging profiles is
almost identical to the main logging subsystem.
By default, the root logger is configured to use a console and a periodic log handler. The periodic log
handler is configured to write to the server.log file. This file is often referred to as the server log.
160
CHAPTER 11. LOGGING WITH JBOSS EAP
The log messages to capture are defined by the specified Java package of origin and log level.
Messages from classes in that package and of that log level or higher are captured by the log category
and sent to the specified log handlers.
NOTE
Although the log category is typically the Java package and class name, it can be any
name specified by the Logger.getLogger(LOGGER_NAME) method.
Log categories can optionally use the log handlers of the root logger instead of their own handlers.
NOTE
Console
A console log handler writes log messages to either the host operating system’s standard out,
stdout, or standard error, stderr, stream. These messages are displayed when JBoss EAP is run from
a command line prompt. The messages from a console log handler are not saved unless the operating
system is configured to capture the standard out or standard error stream.
File
A file log handler writes log messages to a specified file.
Periodic
A periodic log handler writes log messages to a named file until a specified period of time has
elapsed. Once the time period has passed, the file is renamed by appending the specified timestamp
and the handler continues to write into a newly created log file with the original name.
Size
A size log handler writes log messages to a named file until the file reaches a specified size. When the
file reaches a specified size, it is renamed with a numeric suffix and the handler continues to write
into a newly created log file with the original name. Each size log handler must specify the maximum
number of files to be kept in this fashion.
Periodic Size
A periodic size log handler writes log messages to a named file until the file reaches the specified size
or the specified time period has passed. Then, the file is renamed and the handler continues to write
to a newly created log file with the original name.
This is a combination of the periodic and size log handlers and supports their combined attributes.
161
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Syslog
A syslog handler can be used to send messages to a remote logging server. This allows multiple
applications to send their log messages to the same server, where they can all be parsed together.
Socket
A socket log handler can be used to send log messages over a socket to a remote logging server. This
can be a TCP or UDP socket.
Custom
A custom log handler enables you to configure new types of log handlers that have been
implemented. A custom handler must be implemented as a Java class that extends
java.util.logging.Handler and be contained in a module. You can also use a Log4J appender as a
custom log handler.
Async
An async log handler is a wrapper log handler that provides asynchronous behavior for one or more
other log handlers. This is useful for log handlers that may have high latency or other performance
problems such as writing a log file to a network file system.
For details on configuring each of these log handlers, see the Configuring Log Handlers section.
JBoss EAP supports all the log levels used by the supported application logging frameworks. The most
commonly used log levels from lowest to highest are TRACE, DEBUG, INFO, WARN, ERROR, and
FATAL.
Log levels are used by log categories and handlers to limit the messages they are responsible for. Each
log level has an assigned numeric value that indicates its order relative to other log levels. Log
categories and handlers are assigned a log level, and they only process log messages of that level or
higher. For example a log handler with the level of WARN will only record messages of the levels WARN,
ERROR, and FATAL.
FINEST 300 -
FINER 400 -
TRACE 400 TRACE level log messages provide detailed information about the running
state of an application and are usually only captured during debugging.
DEBUG 500 DEBUG level log messages indicate the progress of individual requests or
application activities and are usually only captured during debugging.
162
CHAPTER 11. LOGGING WITH JBOSS EAP
FINE 500 -
CONFIG 700 -
INFO 800 INFO level log messages indicate the overall progress of the application.
Often used for application startup, shutdown, and other major lifecycle
events.
WARN 900 WARN level log messages indicate a situation that is not in error, but is not
considered ideal. WARN log messages can indicate circumstances that
could lead to errors in the future.
WARNING 900 -
ERROR 1000 ERROR level log messages indicate an error that has occurred that could
prevent the current activity or request from completing but will not prevent
the application from running.
SEVERE 1000 -
FATAL 1100 FATAL level log messages indicate events that could cause critical service
failure and application shutdown and could cause JBoss EAP to shutdown.
NOTE
ALL is the lowest log level and includes messages of all log levels. This provides the most
amount of logging.
FATAL is the highest log level and only includes messages of that level. This provides the
least amount of logging.
Pattern Formatter
JSON Formatter
XML Formatter
Custom Formatter
163
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Pattern Formatter
A pattern formatter is used to format log messages in plain text. In addition to using the formatter as the
named-formatter attribute of log handlers, it can also be used as a formatter attribute, without the need
to create the formatter resource first. See Format Characters for Pattern Formatter for more
information on the pattern syntax.
See Configure a Pattern Formatter for information on how to configure a pattern formatter.
JSON Formatter
A JSON formatter is used to format log messages in JSON.
See Configure a JSON Log Formatter for information on how to configure a JSON formatter.
XML Formatter
The XML log formatter is used to format log messages in XML.
See Configure an XML Log Formatter for information on how to configure an XML log formatter.
Custom Formatter
A custom formatter to be used with handlers. Note that most log records are formatted in the printf
format. Formatters may require invocation of the
org.jboss.logmanager.ExtLogRecord#getFormattedMessage() for the message to be properly
formatted.
See Configure a Custom Log Formatter for information on how to configure a custom log formatter.
NOTE
A filter-spec specified for the root logger is not inherited by other loggers. Instead a
filter-spec must be specified per handler.
not[filter expression] Returns the inverted value of a single filter expression. For
example:
not(match("WFLY"))
all(match("WFLY"),match("WELD"))
164
CHAPTER 11. LOGGING WITH JBOSS EAP
any(match("WFLY"),match("WELD"))
levelChange[level] Updates the log record with the specified level. For example:
levelChange(WARN)
levels(DEBUG,INFO,WARN,ERROR)
levelRange[minLevel,maxLevel] Filters log messages within the specified level range. The [ and ]
characters are used to indicate an inclusive level. The ( and )
characters are used to indicate an exclusive level. For example:
levelRange[INFO,ERROR]
The minimum level must be greater than or equal
to INFO and the maximum level must be less than
or equal to ERROR .
levelRange[DEBUG,ERROR)
The minimum level must be greater than or equal
to DEBUG and the maximum level must be less
than ERROR .
match["pattern"] Filters log messages using the provided regular expression. For
example:
match("WFLY\d+")
substitute["pattern","replacement value"] A filter that replaces the first match to the pattern (first
argument) with the replacement text (second argument). For
example:
substitute("WFLY","EAP")
substituteAll("WFLY","EAP")
NOTE
165
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
NOTE
When configuring the filter expression using the management CLI, be sure to escape
commas and quotation marks in the filter text so that the value is correctly processed as a
string. You must precede commas and quotation marks with a backslash (\) and wrap the
entire expression in quotation marks. Below is an example that properly escapes
substituteAll("WFLY","YLFW").
/subsystem=logging/console-handler=CONSOLE:write-attribute(name=filter-spec,
value="substituteAll(\"WFLY\"\,\"YLFW\")")
Using the management CLI, you can set the add-logging-api-dependencies attribute to false so that
the implicit logging API dependencies will not be added to deployments.
/subsystem=logging:write-attribute(name=add-logging-api-dependencies, value=false)
For information on the implicit dependencies for the logging subsystem, see the Implicit Module
Dependencies section in the JBoss EAP Development Guide.
The main tasks you will perform to configure a log category are:
IMPORTANT
If you are configuring this log category for a logging profile, the start of the command
would be /subsystem=logging/logging-profile=LOGGING_PROFILE_NAME/ instead
of /subsystem=logging/.
Additionally, if you are running in a managed domain, precede the commands with
/profile=PROFILE_NAME.
/subsystem=logging/logger=LOG_CATEGORY:add
166
CHAPTER 11. LOGGING WITH JBOSS EAP
/subsystem=logging/logger=LOG_CATEGORY:write-attribute(name=level,value=LEVEL)
Set whether this category should use the log handlers of the root logger.
By default, log categories will use the handlers of the root logger in addition to its own. Set the
use-parent-handlers attribute to false if the log category should use only its assigned
handlers.
/subsystem=logging/logger=LOG_CATEGORY:write-attribute(name=use-parent-
handlers,value=USE_PARENT_HANDLERS)
/subsystem=logging/logger=LOG_CATEGORY:write-attribute(name=filter-spec,
value=FILTER_EXPRESSION)
See the Filter Expressions section for more information on available filter expressions.
Assign a Handler
Assign a log handler to the log category.
/subsystem=logging/logger=LOG_CATEGORY:add-handler(name=LOG_HANDLER_NAME)
/subsystem=logging/logger=LOG_CATEGORY:remove
167
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Syslog handler
The main tasks you will perform to configure a console log handler are:
IMPORTANT
If you are configuring this log handler for a logging profile, the start of the command
would be /subsystem=logging/logging-profile=LOGGING_PROFILE_NAME/ instead
of /subsystem=logging/.
Additionally, if you are running in a managed domain, precede the commands with
/profile=PROFILE_NAME.
/subsystem=logging/console-handler=CONSOLE_HANDLER_NAME:add
/subsystem=logging/console-handler=CONSOLE_HANDLER_NAME:write-
attribute(name=level,value=LEVEL)
/subsystem=logging/console-handler=CONSOLE_HANDLER_NAME:write-
attribute(name=target,value=TARGET)
168
CHAPTER 11. LOGGING WITH JBOSS EAP
/subsystem=logging/console-handler=CONSOLE_HANDLER_NAME:write-
attribute(name=encoding,value=ENCODING)
/subsystem=logging/console-handler=CONSOLE_HANDLER_NAME:write-
attribute(name=formatter,value=FORMAT)
NOTE
/subsystem=logging/console-handler=CONSOLE_HANDLER_NAME:write-
attribute(name=autoflush,value=AUTO_FLUSH)
/subsystem=logging/console-handler=CONSOLE_HANDLER_NAME:write-
attribute(name=filter-spec, value=FILTER_EXPRESSION)
See the Filter Expressions section for more information on available filter expressions.
The following management CLI command assigns the console log handler to the root logger.
/subsystem=logging/root-logger=ROOT:add-handler(name=CONSOLE_HANDLER_NAME)
The following management CLI command assigns the console log handler to a logger whose name is
specified by CATEGORY.
/subsystem=logging/logger=CATEGORY:add-handler(name=CONSOLE_HANDLER_NAME)
/subsystem=logging/console-handler=CONSOLE_HANDLER_NAME:remove
169
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
The main tasks you will perform to configure a file log handler are:
IMPORTANT
If you are configuring this log handler for a logging profile, the start of the command
would be /subsystem=logging/logging-profile=LOGGING_PROFILE_NAME/ instead
of /subsystem=logging/.
Additionally, if you are running in a managed domain, precede the commands with
/profile=PROFILE_NAME.
/subsystem=logging/file-handler=FILE_HANDLER_NAME:add(file={path=FILE_PATH,relative-
to=RELATIVE_TO_PATH})
/subsystem=logging/file-handler=FILE_HANDLER_NAME:write-
attribute(name=level,value=LEVEL)
/subsystem=logging/file-handler=FILE_HANDLER_NAME:write-
attribute(name=append,value=APPEND)
170
CHAPTER 11. LOGGING WITH JBOSS EAP
/subsystem=logging/file-handler=FILE_HANDLER_NAME:write-
attribute(name=encoding,value=ENCODING)
/subsystem=logging/file-handler=FILE_HANDLER_NAME:write-
attribute(name=formatter,value=FORMAT)
NOTE
/subsystem=logging/file-handler=FILE_HANDLER_NAME:write-
attribute(name=autoflush,value=AUTO_FLUSH)
/subsystem=logging/file-handler=FILE_HANDLER_NAME:write-attribute(name=filter-spec,
value=FILTER_EXPRESSION)
See the Filter Expressions section for more information on available filter expressions.
The following management CLI command assigns the file log handler to the root logger.
/subsystem=logging/root-logger=ROOT:add-handler(name=FILE_HANDLER_NAME)
The following management CLI command assigns the file log handler to a logger whose name is
specified by CATEGORY.
/subsystem=logging/logger=CATEGORY:add-handler(name=FILE_HANDLER_NAME)
/subsystem=logging/file-handler=FILE_HANDLER_NAME:remove
171
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
This section shows you how to configure a periodic rotating log handler using the management CLI. You
can also configure periodic log handlers using the management console by navigating to Configuration
→ Subsystems → Logging → Configuration, clicking View, and selecting Handler → Periodic Handler.
The main tasks you will perform to configure a periodic log handler are:
IMPORTANT
If you are configuring this log handler for a logging profile, the start of the command
would be /subsystem=logging/logging-profile=LOGGING_PROFILE_NAME/ instead
of /subsystem=logging/.
Additionally, if you are running in a managed domain, precede the commands with
/profile=PROFILE_NAME.
You must also set the suffix for rotated logs using the suffix attribute. This must be in a format that can
be understood by java.text.SimpleDateFormat, for example .yyyy-MM-dd-HH. The period of the
rotation is automatically calculated based on this suffix.
/subsystem=logging/periodic-rotating-file-handler=PERIODIC_HANDLER_NAME:add(file=
{path=FILE_PATH,relative-to=RELATIVE_TO_PATH},suffix=SUFFIX)
/subsystem=logging/periodic-rotating-file-handler=PERIODIC_HANDLER_NAME:write-
attribute(name=level,value=LEVEL)
/subsystem=logging/periodic-rotating-file-handler=PERIODIC_HANDLER_NAME:write-
attribute(name=append,value=APPEND)
172
CHAPTER 11. LOGGING WITH JBOSS EAP
/subsystem=logging/periodic-rotating-file-handler=PERIODIC_HANDLER_NAME:write-
attribute(name=encoding,value=ENCODING)
/subsystem=logging/periodic-rotating-file-handler=PERIODIC_HANDLER_NAME:write-
attribute(name=formatter,value=FORMAT)
NOTE
/subsystem=logging/periodic-rotating-file-handler=PERIODIC_HANDLER_NAME:write-
attribute(name=autoflush,value=AUTO_FLUSH)
/subsystem=logging/periodic-rotating-file-handler=PERIODIC_HANDLER_NAME:write-
attribute(name=filter-spec, value=FILTER_EXPRESSION)
See the Filter Expressions section for more information on available filter expressions.
The following management CLI command assigns the periodic log handler to the root logger.
/subsystem=logging/root-logger=ROOT:add-handler(name=PERIODIC_HANDLER_NAME)
The following management CLI command assigns the periodic log handler to a logger whose name is
specified by CATEGORY.
/subsystem=logging/logger=CATEGORY:add-handler(name=PERIODIC_HANDLER_NAME)
/subsystem=logging/periodic-rotating-file-handler=PERIODIC_HANDLER_NAME:remove
173
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
The main tasks you will perform to configure a size log handler are:
IMPORTANT
If you are configuring this log handler for a logging profile, the start of the command
would be /subsystem=logging/logging-profile=LOGGING_PROFILE_NAME/ instead
of /subsystem=logging/.
Additionally, if you are running in a managed domain, precede the commands with
/profile=PROFILE_NAME.
/subsystem=logging/size-rotating-file-handler=SIZE_HANDLER_NAME:add(file=
{path=FILE_PATH,relative-to=RELATIVE_TO_PATH})
/subsystem=logging/size-rotating-file-handler=SIZE_HANDLER_NAME:write-
attribute(name=level,value=LEVEL)
/subsystem=logging/size-rotating-file-handler=SIZE_HANDLER_NAME:write-
attribute(name=suffix, value=SUFFIX)
Set the maximum size that the file can reach before being rotated. The default is 2m for 2
174
CHAPTER 11. LOGGING WITH JBOSS EAP
Set the maximum size that the file can reach before being rotated. The default is 2m for 2
megabytes.
/subsystem=logging/size-rotating-file-handler=SIZE_HANDLER_NAME:write-
attribute(name=rotate-size, value=ROTATE_SIZE)
/subsystem=logging/size-rotating-file-handler=SIZE_HANDLER_NAME:write-
attribute(name=max-backup-index, value=MAX_BACKUPS)
/subsystem=logging/size-rotating-file-handler=SIZE_HANDLER_NAME:write-
attribute(name=rotate-on-boot, value=ROTATE_ON_BOOT)
/subsystem=logging/size-rotating-file-handler=SIZE_HANDLER_NAME:write-
attribute(name=append,value=APPEND)
/subsystem=logging/size-rotating-file-handler=SIZE_HANDLER_NAME:write-
attribute(name=encoding,value=ENCODING)
/subsystem=logging/size-rotating-file-handler=SIZE_HANDLER_NAME:write-
attribute(name=formatter,value=FORMAT)
NOTE
/subsystem=logging/size-rotating-file-handler=SIZE_HANDLER_NAME:write-
attribute(name=autoflush,value=AUTO_FLUSH)
175
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Set the expression for filtering log messages for the handler. Be sure to escape any commas
and quotation marks and surround with quotation marks. For example, the
FILTER_EXPRESSION replaceable variable below would need to be replaced with
"not(match(\"WFLY\"))" for a filter expression of not(match("WFLY")).
/subsystem=logging/size-rotating-file-handler=SIZE_HANDLER_NAME:write-
attribute(name=filter-spec, value=FILTER_EXPRESSION)
See the Filter Expressions section for more information on available filter expressions.
The following management CLI command assigns the size log handler to the root logger.
/subsystem=logging/root-logger=ROOT:add-handler(name=SIZE_HANDLER_NAME)
The following management CLI command assigns the size log handler to a logger whose name is
specified by CATEGORY.
/subsystem=logging/logger=CATEGORY:add-handler(name=SIZE_HANDLER_NAME)
/subsystem=logging/size-rotating-file-handler=SIZE_HANDLER_NAME:remove
The main tasks you will perform to configure a periodic size log handler are:
IMPORTANT
If you are configuring this log handler for a logging profile, the start of the command
would be /subsystem=logging/logging-profile=LOGGING_PROFILE_NAME/ instead
of /subsystem=logging/.
Additionally, if you are running in a managed domain, precede the commands with
/profile=PROFILE_NAME.
When adding a periodic size log handler, you must specify the file path using the file attribute, which is
176
CHAPTER 11. LOGGING WITH JBOSS EAP
When adding a periodic size log handler, you must specify the file path using the file attribute, which is
comprised of the path and relative-to attributes. Use the path attribute to set the file path for the log,
including the name, for example my-log.log. Optionally, use the relative-to attribute to set that the
path is relative to a named path, for example jboss.server.log.dir.
You must also set the suffix for rotated logs using the suffix attribute. This must be in a format that can
be understood by java.text.SimpleDateFormat, for example .yyyy-MM-dd-HH. The period of the
rotation is automatically calculated based on this suffix.
/subsystem=logging/periodic-size-rotating-file-handler=PERIODIC_SIZE_HANDLER_NAME:add(file=
{path=FILE_PATH,relative-to=RELATIVE_TO_PATH},suffix=SUFFIX)
/subsystem=logging/periodic-size-rotating-file-
handler=PERIODIC_SIZE_HANDLER_NAME:write-attribute(name=level,value=LEVEL)
/subsystem=logging/periodic-size-rotating-file-
handler=PERIODIC_SIZE_HANDLER_NAME:write-attribute(name=rotate-size,
value=ROTATE_SIZE)
/subsystem=logging/periodic-size-rotating-file-
handler=PERIODIC_SIZE_HANDLER_NAME:write-attribute(name=max-backup-index,
value=MAX_BACKUPS)
/subsystem=logging/periodic-size-rotating-file-
handler=PERIODIC_SIZE_HANDLER_NAME:write-attribute(name=rotate-on-boot,
value=ROTATE_ON_BOOT)
/subsystem=logging/periodic-size-rotating-file-
handler=PERIODIC_SIZE_HANDLER_NAME:write-attribute(name=append,value=APPEND)
177
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
/subsystem=logging/periodic-size-rotating-file-
handler=PERIODIC_SIZE_HANDLER_NAME:write-
attribute(name=encoding,value=ENCODING)
/subsystem=logging/periodic-size-rotating-file-
handler=PERIODIC_SIZE_HANDLER_NAME:write-
attribute(name=formatter,value=FORMAT)
NOTE
/subsystem=logging/periodic-size-rotating-file-
handler=PERIODIC_SIZE_HANDLER_NAME:write-
attribute(name=autoflush,value=AUTO_FLUSH)
/subsystem=logging/periodic-size-rotating-file-
handler=PERIODIC_SIZE_HANDLER_NAME:write-attribute(name=filter-spec,
value=FILTER_EXPRESSION)
See the Filter Expressions section for more information on available filter expressions.
The following management CLI command assigns the periodic size log handler to the root logger.
/subsystem=logging/root-logger=ROOT:add-handler(name=PERIODIC_SIZE_HANDLER_NAME)
The following management CLI command assigns the periodic size log handler to a logger whose name
is specified by CATEGORY.
/subsystem=logging/logger=CATEGORY:add-handler(name=PERIODIC_SIZE_HANDLER_NAME)
178
CHAPTER 11. LOGGING WITH JBOSS EAP
A log handler can be removed with the remove operation. A log handler cannot be removed if it is
currently assigned to a logger or async log handler.
/subsystem=logging/periodic-size-rotating-file-handler=PERIODIC_SIZE_HANDLER_NAME:remove
The main tasks you will perform to configure a syslog handler are:
IMPORTANT
If you are configuring this log handler for a logging profile, the start of the command
would be /subsystem=logging/logging-profile=LOGGING_PROFILE_NAME/ instead
of /subsystem=logging/.
Additionally, if you are running in a managed domain, precede the commands with
/profile=PROFILE_NAME.
/subsystem=logging/syslog-handler=SYSLOG_HANDLER_NAME:add
Set the log level for the handler. The default level is ALL. See Log Levels for all available
options.
/subsystem=logging/syslog-handler=SYSLOG_HANDLER_NAME:write-
attribute(name=level,value=LEVEL)
Set the name of the application that is logging. The default name is java.
/subsystem=logging/syslog-handler=SYSLOG_HANDLER_NAME:write-attribute(name=app-
name,value=APP_NAME)
Set the address of the syslog server. The default address is localhost.
/subsystem=logging/syslog-handler=SYSLOG_HANDLER_NAME:write-
attribute(name=server-address,value=SERVER_ADDRESS)
179
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Set the port of the syslog server. The default port is 514.
/subsystem=logging/syslog-handler=SYSLOG_HANDLER_NAME:write-
attribute(name=port,value=PORT)
Set the syslog format, as defined by an RFC specification. The default format is RFC5424.
/subsystem=logging/syslog-handler=SYSLOG_HANDLER_NAME:write-
attribute(name=syslog-format,value=SYSLOG_FORMAT)
Specify the named-formatter attribute to format the message of the syslog payload.
/subsystem=logging/syslog-handler=SYSLOG_HANDLER_NAME:write-
attribute(name=named-formatter, value=FORMATTER_NAME)
The following management CLI command assigns the syslog handler to the root logger.
/subsystem=logging/root-logger=ROOT:add-handler(name=SYSLOG_HANDLER_NAME)
The following management CLI command assigns the syslog handler to a logger whose name is
specified by CATEGORY.
/subsystem=logging/logger=CATEGORY:add-handler(name=SYSLOG_HANDLER_NAME)
/subsystem=logging/syslog-handler=SYSLOG_HANDLER_NAME:remove
NOTE
The main tasks you will perform to configure a socket log handler are:
180
CHAPTER 11. LOGGING WITH JBOSS EAP
IMPORTANT
If you are configuring this log handler for a logging profile, the start of the command
would be /subsystem=logging/logging-profile=LOGGING_PROFILE_NAME/ instead
of /subsystem=logging/.
Additionally, if you are running in a managed domain, precede the commands with
/profile=PROFILE_NAME.
/socket-binding-group=SOCKET_BINDING_GROUP/remote-destination-outbound-socket-
binding=SOCKET_BINDING_NAME:add(host=HOST, port=PORT)
/subsystem=logging/json-formatter=FORMATTER:add
/subsystem=logging/socket-handler=SOCKET_HANDLER_NAME:add(outbound-socket-binding-
ref=SOCKET_BINDING_NAME,named-formatter=FORMATTER)
/subsystem=logging/socket-handler=SOCKET_HANDLER_NAME:write-
attribute(name=protocol,value=PROTOCOL)
/subsystem=logging/socket-handler=SOCKET_HANDLER_NAME:write-
attribute(name=level,value=LEVEL)
NOTE
During server startup, log messages handled by a socket log handler are queued
until the socket binding is configured and the logging subsystem is initialized. If
the log level is set to a low level, such as TRACE or DEBUG, this can result in
large memory consumption during startup.
181
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
/subsystem=logging/socket-handler=SOCKET_HANDLER_NAME:write-
attribute(name=encoding,value=ENCODING)
/subsystem=logging/socket-handler=SOCKET_HANDLER_NAME:write-
attribute(name=autoflush,value=AUTO_FLUSH)
/subsystem=logging/socket-handler=SOCKET_HANDLER_NAME:write-attribute(name=filter-
spec, value=FILTER_EXPRESSION)
See the Filter Expressions section for more information on available filter expressions.
The following management CLI command assigns the socket log handler to the root logger.
/subsystem=logging/root-logger=ROOT:add-handler(name=SOCKET_HANDLER_NAME)
The following management CLI command assigns the socket log handler to a logger whose name is
specified by CATEGORY.
/subsystem=logging/logger=CATEGORY:add-handler(name=SOCKET_HANDLER_NAME)
/subsystem=logging/socket-handler=SOCKET_HANDLER_NAME:remove
For more information on configuring Elytron components, see Elytron Subsystem in How to Configure
Server Security for JBoss EAP.
182
CHAPTER 11. LOGGING WITH JBOSS EAP
/subsystem=elytron/key-store=log-server-ks:add(path=/path/to/keystore.jks, type=JKS,
credential-reference={clear-text=mypassword})
/subsystem=elytron/trust-manager=log-server-tm:add(key-store=log-server-ks)
/subsystem=elytron/client-ssl-context=log-server-context:add(trust-manager=log-server-
tm, protocols=["TLSv1.2"])
/socket-binding-group=standard-sockets/remote-destination-outbound-socket-binding=log-
server:add(host=localhost, port=4560)
/subsystem=logging/json-formatter=json:add
/subsystem=logging/socket-handler=log-server-handler:add(named-formatter=json,
level=INFO, outbound-socket-binding-ref=log-server, protocol=SSL_TCP, ssl-context=log-
server-context)
/subsystem=logging/root-logger=ROOT:add-handler(name=log-server-handler)
The main tasks you will perform to configure a custom log handler are:
IMPORTANT
If you are configuring this log handler for a logging profile, the start of the command
would be /subsystem=logging/logging-profile=LOGGING_PROFILE_NAME/ instead
of /subsystem=logging/.
Additionally, if you are running in a managed domain, precede the commands with
/profile=PROFILE_NAME.
183
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
NOTE
You must have already created a module containing the custom logger or this command
will fail.
/subsystem=logging/custom-
handler=CUSTOM_HANDLER_NAME:add(class=CLASS_NAME,module=MODULE_NAME)
/subsystem=logging/custom-handler=CUSTOM_HANDLER_NAME:write-
attribute(name=level,value=LEVEL)
/subsystem=logging/custom-handler=CUSTOM_HANDLER_NAME:write-
attribute(name=properties.PROPERTY_NAME,value=PROPERTY_VALUE)
/subsystem=logging/custom-handler=CUSTOM_HANDLER_NAME:write-
attribute(name=encoding,value=ENCODING)
/subsystem=logging/custom-handler=CUSTOM_HANDLER_NAME:write-
attribute(name=formatter,value=FORMAT)
NOTE
184
CHAPTER 11. LOGGING WITH JBOSS EAP
and quotation marks and surround with quotation marks. For example, the
FILTER_EXPRESSION replaceable variable below would need to be replaced with
"not(match(\"WFLY\"))" for a filter expression of not(match("WFLY")).
/subsystem=logging/custom-handler=CUSTOM_HANDLER_NAME:write-
attribute(name=filter-spec, value=FILTER_EXPRESSION)
See the Filter Expressions section for more information on available filter expressions.
The following management CLI command assigns the custom log handler to the root logger.
/subsystem=logging/root-logger=ROOT:add-handler(name=CUSTOM_HANDLER_NAME)
The following management CLI command assigns the custom log handler to a logger whose name is
specified by CATEGORY.
/subsystem=logging/logger=CATEGORY:add-handler(name=CUSTOM_HANDLER_NAME)
/subsystem=logging/custom-handler=CUSTOM_HANDLER_NAME:remove
The main tasks you will perform to configure an async log handler are:
IMPORTANT
If you are configuring this log handler for a logging profile, the start of the command
would be /subsystem=logging/logging-profile=LOGGING_PROFILE_NAME/ instead
of /subsystem=logging/.
Additionally, if you are running in a managed domain, precede the commands with
/profile=PROFILE_NAME.
When adding an async log handler, you must specify the queue length. This is the maximum number of
185
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
When adding an async log handler, you must specify the queue length. This is the maximum number of
log requests that can be held in queue.
/subsystem=logging/async-handler=ASYNC_HANDLER_NAME:add(queue-
length=QUEUE_LENGTH)
Add a Sub-handler
You can add one or more handlers as sub-handlers for this async log handler. Note that the handlers
must already exist in the configuration or this command will fail.
/subsystem=logging/async-handler=ASYNC_HANDLER_NAME:add-
handler(name=HANDLER_NAME)
/subsystem=logging/async-handler=ASYNC_HANDLER_NAME:write-
attribute(name=level,value=LEVEL)
/subsystem=logging/async-handler=ASYNC_HANDLER_NAME:write-
attribute(name=overflow-action,value=OVERFLOW_ACTION)
/subsystem=logging/async-handler=ASYNC_HANDLER_NAME:write-attribute(name=filter-
spec, value=FILTER_EXPRESSION)
See the Filter Expressions section for more information on available filter expressions.
The following management CLI command assigns the async log handler to the root logger.
/subsystem=logging/root-logger=ROOT:add-handler(name=ASYNC_HANDLER_NAME)
The following management CLI command assigns the async log handler to a logger whose name is
specified by CATEGORY.
186
CHAPTER 11. LOGGING WITH JBOSS EAP
/subsystem=logging/logger=CATEGORY:add-handler(name=ASYNC_HANDLER_NAME)
/subsystem=logging/async-handler=ASYNC_HANDLER_NAME:remove
This section shows you how to configure the root logger using the management CLI. You can also
configure the root logger using the management console by navigating to Configuration →
Subsystems → Logging → Configuration, clicking View, and selecting Root Logger.
IMPORTANT
If you are configuring this log handler for a logging profile, the start of the command
would be /subsystem=logging/logging-profile=LOGGING_PROFILE_NAME/ instead
of /subsystem=logging/.
Additionally, if you are running in a managed domain, precede the commands with
/profile=PROFILE_NAME.
/subsystem=logging/root-logger=ROOT:add-handler(name=LOG_HANDLER_NAME)
/subsystem=logging/root-logger=ROOT:remove-handler(name=LOG_HANDLER_NAME)
/subsystem=logging/root-logger=ROOT:write-attribute(name=level,value=LEVEL)
For a full list of available root logger attributes and their descriptions, see Root Logger Attributes .
Pattern Formatter
187
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
IMPORTANT
If you are configuring this log formatter for a logging profile, the start of the command
would be /subsystem=logging/logging-profile=LOGGING_PROFILE_NAME/ instead
of /subsystem=logging/.
Additionally, if you are running in a managed domain, precede the commands with
/profile=PROFILE_NAME.
/subsystem=logging/pattern-formatter=PATTERN_FORMATTER_NAME:add(pattern=PATTERN)
For example, the default configuration uses the following log formatter string for logging messages to
the server log: %d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n. This creates log messages
formatted like the one below.
You can also define a color map to assign a color to different log levels. The format is a comma-
separated list of LEVEL:COLOR.
Valid levels: finest, finer, fine, config, trace, debug, info, warning, warn, error, fatal, severe
Valid colors: black, green, red, yellow, blue, magenta, cyan, white, brightblack, brightred,
brightgreen, brightblue, brightyellow, brightmagenta, brightcyan, brightwhite
/subsystem=logging/pattern-formatter=PATTERN_FORMATTER_NAME:write-attribute(name=color-
map,value="LEVEL:COLOR,LEVEL:COLOR")
You can also configure pattern log formatters using the management console:
IMPORTANT
If you are configuring this log formatter for a logging profile, the start of the command
would be /subsystem=logging/logging-profile=LOGGING_PROFILE_NAME/ instead
of /subsystem=logging/.
Additionally, if you are running in a managed domain, precede the commands with
/profile=PROFILE_NAME.
/subsystem=logging/json-formatter=JSON_FORMATTER_NAME:add(pretty-print=true, exception-
output-type=formatted)
{
"timestamp": "2018-10-18T13:53:43.031-04:00",
"sequence": 62,
"loggerClassName": "org.jboss.as.server.logging.ServerLogger_$logger",
"loggerName": "org.jboss.as",
"level": "INFO",
"message": "WFLYSRV0025: JBoss EAP 7.4.0.Beta (WildFly Core 10.0.0.Final-redhat-20190924)
started in 5672ms - Started 495 of 679 services (331 services are lazy, passive or on-demand)",
"threadName": "Controller Boot Thread",
"threadId": 22,
"mdc": {
},
"ndc": "",
"hostName": "localhost.localdomain",
"processName": "jboss-modules.jar",
"processId": 7461
}
NOTE
You can modify the JSON log formatter output keys and add static metadata. The
primary purpose of the JSON log formatter is to format log messages in JSON. Logstash
consumes this JSON output and searches for the fields, @timestamp and @version.
The following example creates a JSON log formatter that formats messages for
Logstash.
/subsystem=logging/json-formatter=logstash:add(exception-output-type=formatted, key-overrides=
[timestamp="@timestamp"], meta-data=[@version=1])
The key-overrides attribute can be used to override the names of the keys defined.
189
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
The exception stack trace can be included by setting the exception-output-type attribute to
detailed.
The exceptions can be formatted as objects and stack traces can be included by setting the
exception-output-type to detailed-and-formatted.
The metadata can be added to log records using the meta-data attribute.
For more information on the JSON formatter attributes, see JSON Log Formatter Attributes.
You can also configure JSON log formatters using the management console:
IMPORTANT
If you are configuring this log formatter for a logging profile, the start of the command
would be /subsystem=logging/logging-profile=LOGGING_PROFILE_NAME/ instead
of /subsystem=logging/.
Additionally, if you are running in a managed domain, precede the commands with
/profile=PROFILE_NAME.
/subsystem=logging/xml-formatter=XML_FORMATTER_NAME:add(pretty-print=true, exception-
output-type=detailed-and-formatted)
<record>
<timestamp>2018-10-18T13:55:53.419-04:00</timestamp>
<sequence>62</sequence>
<loggerClassName>org.jboss.as.server.logging.ServerLogger_$logger</loggerClassName>
<loggerName>org.jboss.as</loggerName>
<level>INFO</level>
<message>WFLYSRV0025: {ProductCurrentVersionExamples} (WildFly Core 10.0.0.Final-redhat-
20190924) started in 6271ms - Started 495 of 679 services (331 services are lazy, passive or on-
demand)</message>
<threadName>Controller Boot Thread</threadName>
<threadId>22</threadId>
<mdc>
</mdc>
<ndc></ndc>
<hostName>localhost.localdomain</hostName>
190
CHAPTER 11. LOGGING WITH JBOSS EAP
<processName>jboss-modules.jar</processName>
<processId>7790</processId>
</record>
/subsystem=logging/xml-formatter=XML_FORMATTER_NAME:add(pretty-print=true, print-
namespace=true, namespace-uri="urn:custom:1.0", key-overrides={message=msg,
record=logRecord, timestamp=date}, print-details=true)
The key-overrides attribute can be used to override the names of the keys defined.
The exception stack trace can be included by setting the exception-output-type attribute to
detailed.
The exceptions can be formatted as objects and stack traces can be included by setting the
exception-output-type to detailed-and-formatted.
The metadata can be added to log records using the meta-data attribute.
For more information on the XML formatter attributes, see XML Log Formatter Attributes.
You can also configure XML log formatters using the management console:
This section shows you how to configure a custom log formatter using the management CLI.
IMPORTANT
If you are configuring this log formatter for a logging profile, the start of the command
would be /subsystem=logging/logging-profile=LOGGING_PROFILE_NAME/ instead
of /subsystem=logging/.
Additionally, if you are running in a managed domain, precede the commands with
/profile=PROFILE_NAME.
When adding a custom log formatter, you must specify the Java class of the formatter and the
191
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
When adding a custom log formatter, you must specify the Java class of the formatter and the
JBoss EAP module in which it is contained. The class must extend java.util.logging.Formatter.
NOTE
You must have already created a module containing the custom formatter or this
command will fail.
/subsystem=logging/custom-
formatter=CUSTOM_FORMATTER_NAME:add(class=CLASS_NAME,
module=MODULE_NAME)
/subsystem=logging/custom-formatter=CUSTOM_FORMATTER_NAME:write-
attribute(name=properties.PROPERTY_NAME,value=PROPERTY_VALUE)
/subsystem=logging/periodic-rotating-file-handler=FILE_HANDLER_NAME:write-
attribute(name=named-formatter, value=CUSTOM_FORMATTER_NAME)
/subsystem=logging/custom-formatter=custom-xml-
formatter:add(class=java.util.logging.XMLFormatter, module=org.jboss.logmanager)
/subsystem=logging/console-handler=CONSOLE:write-attribute(name=named-formatter,
value=custom-xml-formatter)
<record>
<date>2016-03-23T12:58:13</date>
<millis>1458752293091</millis>
<sequence>93963</sequence>
<logger>org.jboss.as</logger>
<level>INFO</level>
<class>org.jboss.as.server.BootstrapListener</class>
<method>logAdminConsole</method>
<thread>22</thread>
<message>WFLYSRV0051: Admin console listening on http://%s:%d</message>
<param>127.0.0.1</param>
<param>9990</param>
</record>
192
CHAPTER 11. LOGGING WITH JBOSS EAP
See About the Logging Subsystem for using JBoss EAP log categories and handlers for capturing log
messages.
For more information on application logging, such as supported application logging frameworks and
configuring per-deployment logging, see the Logging chapter in the JBoss EAP Development Guide.
NOTE
If the per-deployment logging configuration is not done, the configuration from logging
subsystem is used for all the applications as well as the server.
This approach has advantages and disadvantages over using system-wide logging. An advantage is that
the administrator of the JBoss EAP instance does not need to configure any other logging than the
server logging. A disadvantage is that the per-deployment logging configuration is read only on server
startup, and so cannot be changed at runtime.
For instructions on using per-deployment logging in your applications, see Add Per-deployment
Logging to an Application in the JBoss EAP Development Guide.
/subsystem=logging:write-attribute(name=use-deployment-logging-config,value=false)
193
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Logging profiles allow administrators to create logging configurations that are specific to one or more
applications without affecting any other logging configurations. Because each profile is defined in the
server configuration, the logging configuration can be changed without requiring that the affected
applications be redeployed.
An application can specify a logging profile to use in its MANIFEST.MF file, using the Logging-Profile
attribute.
A logging profile can be configured with log handlers, categories, and a root logger. Configuring a
logging profile uses the same syntax as configuring the logging subsystem, except for the following
differences:
The logging subsystem has the following attributes that are not available for a logging profile:
add-logging-api-dependencies
use-deployment-logging-config
/subsystem=logging/logging-profile=PROFILE_NAME:add
/subsystem=logging/logging-profile=PROFILE_NAME/file-
handler=FILE_HANDLER_NAME:add(file={path=>"LOG_NAME.log", "relative-
to"=>"jboss.server.log.dir"})
194
CHAPTER 11. LOGGING WITH JBOSS EAP
/subsystem=logging/logging-profile=PROFILE_NAME/file-
handler=FILE_HANDLER_NAME:write-attribute(name="level", value="DEBUG")
See File Log Handler Attributes for the list of file handler attributes.
/subsystem=logging/logging-
profile=PROFILE_NAME/logger=CATEGORY_NAME:add(level=TRACE)
See Log Category Attributes for the list of log category attributes.
/subsystem=logging/logging-profile=PROFILE_NAME/logger=CATEGORY_NAME:add-
handler(name="FILE_HANDLER_NAME")
You can then set the logging profile to use by an application in its MANIFEST.MF file. For more
information, see Specify a Logging Profile in an Application in the JBoss EAP Development Guide.
This example shows the configuration of a logging profile and the application that uses it. It shows the
management CLI commands, the resulting XML, and the application’s MANIFEST.MF file.
/subsystem=logging/logging-profile=accounts-app-profile:add
/subsystem=logging/logging-profile=accounts-app-profile/file-handler=ejb-trace-file:add(file=
{path=>"ejb-trace.log", "relative-to"=>"jboss.server.log.dir"})
/subsystem=logging/logging-profile=accounts-app-profile/file-handler=ejb-trace-file:write-
attribute(name="level", value="DEBUG")
/subsystem=logging/logging-profile=accounts-app-
profile/logger=com.company.accounts.ejbs:add(level=TRACE)
/subsystem=logging/logging-profile=accounts-app-profile/logger=com.company.accounts.ejbs:add-
handler(name="ejb-trace-file")
XML Configuration
<logging-profiles>
195
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
<logging-profile name="accounts-app-profile">
<file-handler name="ejb-trace-file">
<level name="DEBUG"/>
<file relative-to="jboss.server.log.dir" path="ejb-trace.log"/>
</file-handler>
<logger category="com.company.accounts.ejbs">
<level name="TRACE"/>
<handlers>
<handler name="ejb-trace-file"/>
</handlers>
</logger>
</logging-profile>
</logging-profiles>
Manifest-Version: 1.0
Logging-Profile: accounts-app-profile
/deployment=DEPLOYMENT_NAME/subsystem=logging/configuration=CONFIG:read-resource
The logging configuration value, CONFIG, for a deployment can be one of three values:
default, if the deployment is using the logging subsystem. This will output the logging
subsystem configuration.
The path to the configuration file being used, for example, myear.ear/META-
INF/logging.properties.
For example, the below management CLI command displays the configuration for the MYPROFILE
logging profile, which is used by the specified deployment.
/deployment=mydeployment.war/subsystem=logging/configuration=profile-MYPROFILE:read-
resource(recursive=true,include-runtime=true)
{
"outcome" => "success",
"result" => {
"error-manager" => undefined,
"filter" => undefined,
"formatter" => {
"MYFORMATTER" => {
"class-name" => "org.jboss.logmanager.formatters.PatternFormatter",
"module" => undefined,
196
CHAPTER 11. LOGGING WITH JBOSS EAP
You could also use a recursive read-resource operation to read the logging configuration and other
information about a deployment.
/deployment=DEPLOYMENT_NAME/subsystem=logging:read-resource(include-runtime=true,
recursive=true)
197
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Supported Databases
See JBoss EAP supported configurations for the list of JDBC-compliant databases supported by JBoss
EAP 7.
Datasource Types
The two general types of resources are referred to as datasources and XA datasources.
Non-XA datasources
Used for applications that do not use transactions, or applications that use transactions with a single
database.
XA datasources
Used by applications that use multiple databases or other XA resources as part of one XA
transaction. XA datasources introduce additional overhead.
You specify which type of datasource to use when creating the datasource using the JBoss EAP
management interfaces.
WARNING
198
CHAPTER 12. DATASOURCE MANAGEMENT
To install a JDBC driver as a core module, you must first add the JDBC driver as a core module and then
register the JDBC driver in the datasources subsystem.
JDBC drivers can be installed as a core module using the management CLI using the following steps.
Make sure to extract the archive if the JDBC driver JAR file is contained within a ZIP or TAR
archive.
$ EAP_HOME/bin/jboss-cli.sh
4. Use the module add management CLI command to add the new core module.
For example, the following command adds a MySQL JDBC driver module.
IMPORTANT
Using the module management CLI command to add and remove modules is
provided as Technology Preview only. This command is not appropriate for use in
a managed domain or when connecting to the management CLI remotely.
Modules should be added and removed manually in a production environment.
Technology Preview features are not supported with Red Hat production service
level agreements (SLAs), might not be functionally complete, and Red Hat does
not recommend to use them for production. These features provide early access
to upcoming product features, enabling customers to test functionality and
provide feedback during the development process.
See Technology Preview Features Support Scope on the Red Hat Customer
Portal for information about the support scope for Technology Preview features.
Execute module --help for more details on using this command to add and remove modules.
You must next register it as a JDBC driver for it to be referenced by application datasources.
After the driver has been installed as a core module , you must register it as a JDBC driver using the
199
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
After the driver has been installed as a core module , you must register it as a JDBC driver using the
following management CLI command. When running in a managed domain, be sure to precede this
command with /profile=PROFILE_NAME.
/subsystem=datasources/jdbc-driver=DRIVER_NAME:add(driver-name=DRIVER_NAME,driver-
module-name=MODULE_NAME,driver-xa-datasource-class-
name=XA_DATASOURCE_CLASS_NAME, driver-class-name=DRIVER_CLASS_NAME)
NOTE
The driver-class-name parameter is only required if the JDBC driver jar defines more
than one class in its /META-INF/services/java.sql.Driver file.
com.mysql.cj.jdbc.Driver
com.mysql.fabric.jdbc.FabricMySQLDriver
/subsystem=datasources/jdbc-driver=mysql:add(driver-name=mysql,driver-module-
name=com.mysql,driver-xa-datasource-class-name=com.mysql.cj.jdbc.MysqlXADataSource, driver-
class-name=com.mysql.cj.jdbc.Driver)
The following steps describe how to install a JDBC driver using the management CLI.
NOTE
The recommended installation method for JDBC drivers is to install them as a core
module.
Make sure to extract the archive if the JDBC driver JAR file is contained within a ZIP or TAR
archive.
2. If the JDBC driver is not JDBC 4-compliant, see the steps to Update a JDBC Driver JAR to be
JDBC 4-Compliant.
200
CHAPTER 12. DATASOURCE MANAGEMENT
deploy PATH_TO_JDBC_JAR
NOTE
deploy /path/to/mysql-connector-java-8.0.12.jar
A message will be displayed in the JBoss EAP server log that displays the deployed driver name,
which will be used when defining datasources.
4. Create a META-INF/services/java.sql.Driver file and add one line to indicate the fully-qualified
class name of the JDBC driver.
For example, the below line would be added for a MySQL JDBC driver.
com.mysql.cj.jdbc.Driver
5. Use the JAR command-line tool to add this new file to the JAR.
NOTE
These links point to third-party websites which are not controlled or actively monitored by
Red Hat. For the most up-to-date drivers for your database, check your database
vendor’s documentation and website.
201
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
MySQL http://www.mysql.com/products/connector/
PostgreSQL http://jdbc.postgresql.org/
Oracle http://www.oracle.com/technetwork/database/featu
res/jdbc/index-091264.html
IBM http://www-01.ibm.com/support/docview.wss?
uid=swg21363866
Sybase The jConnect JDBC driver is part of the SDK for SAP
ASE installation. Currently there is not a separate
download site for this driver by itself.
Microsoft http://msdn.microsoft.com/data/jdbc/
WARNING
This is advanced usage. Only applications that need functionality not found in the
JDBC API should implement this procedure.
IMPORTANT
This process is required when using the reauthentication mechanism, and accessing
vendor-specific classes.
You can define a dependency for an application using either the MANIFEST.MF file or a jboss-
deployment-structure.xml file.
If you have not yet done so, install a JDBC driver as a core module .
Dependencies: com.mysql
202
CHAPTER 12. DATASOURCE MANAGEMENT
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="com.mysql"/>
</dependencies>
</deployment>
</jboss-deployment-structure>
import java.sql.Connection;
...
Connection c = ds.getConnection();
if (c.isWrapperFor(com.mysql.jdbc.Connection.class)) {
com.mysql.jdbc.Connection mc = c.unwrap(com.mysql.jdbc.Connection.class);
}
IMPORTANT
Follow the vendor-specific API guidelines closely, as the connection is being controlled by
the IronJacamar container.
JBoss EAP 7 allows you to use expressions in datasource attribute values, such as the enabled attribute.
See the Property Replacement section for details on using expressions in the configuration.
3. It opens the Add Datasource wizard where you can choose the datasource type and click Next.
This creates a template for your database. The following pages of the wizard are prefilled with
values specific for the selected datasource. This makes the datasource creation process easy.
4. You can test your connection on the Test Connection page before finishing the datasource
203
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
4. You can test your connection on the Test Connection page before finishing the datasource
creation process.
1. If you have not yet done so, install and register the appropriate JDBC Driver as a Core Module .
2. Define the datasource using the data-source add command, specifying the appropriate
argument values.
NOTE
See the Datasource Parameters section below for tips on these parameter values.
For detailed examples, see the Example Datasource Configurations for the supported databases.
Datasource Parameters
jndi-name
The JNDI name for the datasource must start with java:/ or java:jboss/. For example,
java:jboss/datasources/ExampleDS.
driver-name
The driver name value depends on whether the JDBC driver was installed as a core module or a JAR
deployment.
1. For a core module, the driver name value will be the name given to the JDBC driver when it
was registered.
2. For a JAR deployment, the driver name is the name of the JAR if there is only one class
listed in its /META-INF/services/java.sql.Driver file. If there are multiple classes listed, then
the value is JAR_NAME + "_" + DRIVER_CLASS_NAME + "_" + MAJOR_VERSION + "_" +
MINOR_VERSION (for example mysql-connector-java-5.1.36-
bin.jar_com.mysql.cj.jdbc.Driver_5_1).
You can also see the driver name listed in the JBoss EAP server log when the JDBC JAR is
deployed.
connection-url
For details on the connection URL formats for the supported databases, see the list of Datasource
Connection URLs.
For a complete listing of all available datasource attributes, see the Datasource Attributes section.
204
CHAPTER 12. DATASOURCE MANAGEMENT
3. It opens the Add XA Datasource wizard where you can choose the datasource type and click
Next. This creates a template for your database. The following pages of the wizard are prefilled
with values specific for the selected datasource. This makes the datasource creation process
easy.
4. You can test your connection on the Test Connection page before finishing the datasource
creation process.
NOTE
In a managed domain, you will need to specify the profile to use. Depending on the format
of the management CLI command, you will either precede the command with
/profile=PROFILE_NAME or pass in the --profile=PROFILE_NAME argument.
1. If you have not yet done so, install and register the appropriate JDBC Driver as a Core Module .
2. Define the datasource using the xa-data-source add command, specifying the appropriate
argument values.
See the Datasource Parameters section below for tips on these parameter values.
/subsystem=datasources/xa-data-source=XA_DATASOURCE_NAME/xa-datasource-
properties=ServerName:add(value=HOST_NAME)
/subsystem=datasources/xa-data-source=XA_DATASOURCE_NAME/xa-datasource-
properties=DatabaseName:add(value=DATABASE_NAME)
205
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
For detailed examples, see the Example Datasource Configurations for the supported databases.
Datasource Parameters
jndi-name
The JNDI name for the datasource must start with java:/ or java:jboss/. For example,
java:jboss/datasources/ExampleDS.
driver-name
The driver name value depends on whether the JDBC driver was installed as a core module or a JAR
deployment.
1. For a core module, the driver name value will be the name given to the JDBC driver when it
was registered.
2. For a JAR deployment, the driver name is the name of the JAR if there is only one class
listed in its /META-INF/services/java.sql.Driver file. If there are multiple classes listed, then
the value is JAR_NAME + "_" + DRIVER_CLASS_NAME + "_" + MAJOR_VERSION + "_" +
MINOR_VERSION, for example, mysql-connector-java-5.1.36-
bin.jar_com.mysql.cj.jdbc.Driver_5_1.
You can also see the driver name listed in the JBoss EAP server log when the JDBC JAR is
deployed.
xa-datasource-class
Specify the XA datasource class for the JDBC driver’s implementation of the
javax.sql.XADataSource class.
xa-datasource-properties
At least one XA datasource property is required when defining an XA datasource or you will receive an
error when attempting to add it. Additional properties can also be added to the XA datasource after
it has been defined.
For a complete listing of all available datasource attributes, see the Datasource Attributes section.
JBoss EAP 7 allows you to use expressions in datasource attribute values, such as the enabled attribute.
See the Property Replacement section for details on using expressions in the configuration.
NOTE
206
CHAPTER 12. DATASOURCE MANAGEMENT
NOTE
Settings for a datasource can be updated by using the following management CLI command.
NOTE
Settings for an XA datasource can be updated by using the following management CLI
command.
xa-data-source --name=XA_DATASOURCE_NAME -
-ATTRIBUTE_NAME=ATTRIBUTE_VALUE
NOTE
An XA datasource property can be added using the following management CLI command.
/subsystem=datasources/xa-data-source=XA_DATASOURCE_NAME/xa-datasource-
properties=PROPERTY:add(value=VALUE)
NOTE
Non-XA datasources can be removed using the data-source remove management CLI command. You
207
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Non-XA datasources can be removed using the data-source remove management CLI command. You
can also use the management console to remove datasources by navigating to Configuration →
Subsystems → Datasources & Drivers → Datasources.
NOTE
NOTE
/subsystem=datasources/data-source=DATASOURCE_NAME:test-connection-in-pool
NOTE
Once a datasource has been added, you can test the connection by navigating to Configuration →
Subsystems → Datasources & Drivers → Datasources, selecting the datasource, and choosing Test
Connection from the drop down.
208
CHAPTER 12. DATASOURCE MANAGEMENT
NOTE
/subsystem=datasources/data-source=DATASOURCE_NAME:flush-all-connection-in-pool
/subsystem=datasources/data-source=DATASOURCE_NAME:flush-gracefully-connection-in-
pool
The server will wait until connections become idle before flushing them.
/subsystem=datasources/data-source=DATASOURCE_NAME:flush-idle-connection-in-pool
/subsystem=datasources/data-source=DATASOURCE_NAME:flush-invalid-connection-in-
pool
The server will flush all connections that it determines to be invalid, for example, by the valid-
connection-checker-class-name or check-valid-connection-sql validation mechanism
discussed in Database Connection Validation.
You can also flush connections using the management console. From the Runtime tab, select the server,
select Datasources, choose a datasource, and use the drop down to select the appropriate action.
XA recovery is the process of ensuring that all resources affected by a transaction are updated or rolled
back, even if any of the resources or transaction participants crash or become unavailable. XA recovery
happens without user intervention.
Each XA resource needs to have a recovery module associated with its configuration. The recovery
module is the code that is executed when recovery is being performed. JBoss EAP automatically
registers recovery modules for JDBC XA resources. You can register a custom module with your XA
datasource if you wish to implement custom recovery code. The recovery module must extend class
com.arjuna.ats.jta.recovery.XAResourceRecovery.
209
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
The following table describes the XA datasource parameters specific to XA recovery. Each of these
configuration attributes can be set during datasource creation or afterward. You can set them using
either the management console or the management CLI. See Modify an XA Datasource for information
on configuring XA datasources.
Attribute Description
recovery-username The user name to use to connect to the resource for recovery. Note that if
this is not specified, the datasource security settings will be used.
recovery-password The password to use to connect to the resource for recovery. Note that if
this is not specified, the datasource security settings will be used.
recovery-security-domain The security domain to use to connect to the resource for recovery.
recovery-plugin-class-name If you need to use a custom recovery module, set this attribute to the fully-
qualified class name of the module. The module should extend class
com.arjuna.ats.jta.recovery.XAResourceRecovery.
recovery-plugin-properties If you use a custom recovery module which requires properties to be set, set
this attribute to the list of comma-separated KEY=VALUE pairs for the
properties.
Disable XA Recovery
If multiple XA datasources connect to the same physical database, then XA recovery typically needs to
be configured for only one of them.
Use the following management CLI command to disable recovery for an XA datasource:
/subsystem=datasources/xa-data-source=XA_DATASOURCE_NAME:write-attribute(name=no-
recovery,value=true)
MySQL
No special configuration is required. For more information, see the MySQL documentation.
PostgreSQL and Postgres Plus Advanced Server
210
CHAPTER 12. DATASOURCE MANAGEMENT
If the Oracle user does not have the proper permissions, you may see an error such as the following:
MariaDB
No special configuration is required. For more information, see the MariaDB documentation.
Known Issues
These known issues with handling XA transactions are for the specific database and JDBC driver
versions supported with JBoss EAP 7. For up-to-date information on the supported databases, see
JBoss EAP supported configurations .
MySQL
MySQL is not fully capable of handling XA transactions. If a client is disconnected from MySQL, then
all the information about such transactions is lost. See this MySQL bug for more information. Note
that this issue was fixed in MySQL 5.7.
PostgreSQL and Postgres Plus Advanced Server
The JDBC driver returns the XAER_RMERR XAException error code when a network failure occurs
during the commit phase of two-phase commit (2PC). This error signals an unrecoverable
catastrophic event to the transaction manager, but the transaction is left in the in-doubt state on
the database side and could be easily corrected after network connection is established again. The
211
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
correct return code should be XAER_RMFAIL or XAER_RETRY. The incorrect error code causes
the transaction to be left in the Heuristic state on the JBoss EAP side and holding locks in the
database which requires manual intervention. See this PostgreSQL bug for more information.
If a connection failure happens when the one-phase commit optimization is used, the JDBC driver
returns XAER_RMERR, but the XAER_RMFAIL error code should be returned. This could lead to
data inconsistency if the database commits data during one-phase commit and the connection goes
down at that moment, then the client is informed that transaction was rolled back.
The Postgres Plus JDBC driver returns XIDs for all prepared transactions that exist in the Postgres
Plus Server, so there is no way to determine the database to which the XID belongs. If you define
more than one data source for the same database in JBoss EAP, an in-doubt transaction recovery
attempt could be run under wrong account, which causes the recovery to fail.
Oracle
The JDBC driver returns XIDs belonging to all users on the database instance, when the Recovery
Manager calls recovery using datasource configured with some user credentials. The JDBC driver
throws the exception ORA-24774: cannot switch to specified transaction because it tries to
recover XIDs belonging to other users.
The workaround for this issue is to grant FORCE ANY TRANSACTION privilege to the user whose
credentials are used in recovery datasource configuration. More information about configuring the
privilege can be found here:
http://docs.oracle.com/database/121/ADMIN/ds_txnman.htm#ADMIN12259.
IBM DB2
If a connection failure happens during a one-phase commit, the JDBC driver returns XAER_RETRY,
but the XAER_RMFAIL error code should be returned. This could lead to data inconsistency if the
database commits data during one-phase commit and the connection goes down at that moment,
then the client is informed that transaction was rolled back.
Sybase
The JDBC driver returns the XAER_RMERR XAException error code when a network failure occurs
during the commit phase of two-phase commit (2PC). This error signals an unrecoverable
catastrophic event to the transaction manager, but the transaction is left in the in-doubt state on
the database side and could be easily corrected after network connection is established again. The
correct return code should be XAER_RMFAIL or XAER_RETRY. The incorrect error code causes
the transaction to be left in the Heuristic state on the JBoss EAP side and holding locks in the
database which requires manual intervention.
If a connection failure happens when the one-phase commit optimization is used, the JDBC driver
returns XAER_RMERR, but the XAER_RMFAIL error code should be returned. This could lead to
data inconsistency if the database commits data during one-phase commit and the connection goes
212
CHAPTER 12. DATASOURCE MANAGEMENT
down at that moment, then the client is informed that transaction was rolled back.
If an XA transaction that includes an insert to a Sybase 15.7 or 16 database fails before the Sybase
transaction branch is in a prepared state, then repeating the XA transaction and inserting the same
record with the same primary key will fail with an error of
com.sybase.jdbc4.jdbc.SybSQLException: Attempt to insert duplicate key row. This exception
will be thrown until the original unfinished Sybase transaction branch is rolled back.
MariaDB
MariaDB is not fully capable of handling XA transactions. If a client is disconnected from MariaDB,
then all the information about such transactions is lost.
MariaDB Galera Cluster
XA transactions are not supported in MariaDB Galera Cluster.
To configure database connection validation, you specify the validation timing method to define when
the validation occurs, the validation mechanism to determine how the validation is performed, and the
exception sorter to define how exceptions are handled.
validate-on-match
When the validate-on-match option is set to true, the database connection is validated
every time it is checked out from the connection pool using the validation mechanism
specified in the next step.
If a connection is not valid, a warning is written to the log and the next connection in the pool
is retrieved. This process continues until a valid connection is found. If you prefer not to cycle
through every connection in the pool, you can use the use-fast-fail option. If a valid
connection is not found in the pool, a new connection is created. If the connection creation
fails, an exception is returned to the requesting application.
This setting results in the quickest recovery but creates the highest load on the database.
However, this is the safest selection if the minimal performance hit is not a concern.
background-validation
When the background-validation option is set to true, connections are validated
periodically in a background thread prior to use. The frequency of the validation is specified
by the background-validation-millis property. The default value of background-
validation-millis is 0, meaning that it is disabled.
When determining the value of the background-validation-millis property, consider the
following:
This value should not be set to the same value as your idle-timeout-minutes setting.
The lower the value, the more frequently the pool is validated and the sooner invalid
connections are removed from the pool.
Lower values take more database resources. Higher values result in less frequent
213
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Lower values take more database resources. Higher values result in less frequent
connection validation checks and use less database resources, but dead connections are
undetected for longer periods of time.
NOTE
valid-connection-checker-class-name
Using valid-connection-checker-class-name is the preferred validation mechanism. This
specifies a connection checker class that is used to validate connections for the particular
database in use. JBoss EAP provides the following connection checkers:
org.jboss.jca.adapters.jdbc.extensions.db2.DB2ValidConnectionChecker
org.jboss.jca.adapters.jdbc.extensions.mssql.MSSQLValidConnectionChecker
org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLReplicationValidConnectionC
hecker
org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker
org.jboss.jca.adapters.jdbc.extensions.novendor.JDBC4ValidConnectionChecker
org.jboss.jca.adapters.jdbc.extensions.novendor.NullValidConnectionChecker
org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker
org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLValidConnectionChec
ker
org.jboss.jca.adapters.jdbc.extensions.sybase.SybaseValidConnectionChecker
check-valid-connection-sql
Using check-valid-connection-sql, you provide the SQL statement that will be used to
validate the connection.
The following is an example SQL statement that you might use to validate Oracle
connections.
The following is an example SQL statement that you might use to validate MySQL or
PostgreSQL connections.
select 1
214
CHAPTER 12. DATASOURCE MANAGEMENT
detect and clean up after fatal connection exceptions. Choose the appropriate JBoss EAP
exception sorter for your datasource type.
org.jboss.jca.adapters.jdbc.extensions.db2.DB2ExceptionSorter
org.jboss.jca.adapters.jdbc.extensions.informix.InformixExceptionSorter
org.jboss.jca.adapters.jdbc.extensions.mssql.MSSQLExceptionSorter
org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter
org.jboss.jca.adapters.jdbc.extensions.novendor.NullExceptionSorter
org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter
org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLExceptionSorter
org.jboss.jca.adapters.jdbc.extensions.sybase.SybaseExceptionSorter
There are several methods you can use for datasource security. Examples of each are included below.
/subsystem=security/security-domain=DsRealm:add(cache-type=default)
/subsystem=security/security-domain=DsRealm/authentication=classic:add(login-modules=
[{code=ConfiguredIdentity,flag=required,module-options={userName=sa,
principal=sa, password=sa}}])
A security domain for the datasource is defined. The following XML extract is the result of
calling CLI commands.
215
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
reload
NOTE
If you are using a security domain with multiple datasources, disable caching on the
security domain. This can be accomplished by setting the value of the cache-type
attribute to none or by removing the attribute altogether; however, if caching is desired,
use a separate security domain for each datasource.
The following XML extract shows the datasource secured with the DsRealm.
<datasources>
<datasource jndi-name="java:jboss/datasources/securityDs"
pool-name="securityDs">
<connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url>
<driver>h2</driver>
<new-connection-sql>select current_user()</new-connection-sql>
<security>
<security-domain>DsRealm</security-domain>
</security>
</datasource>
</datasources>
For more information on using Security Domains, see How to Configure Identity Management .
data-source --name=ExampleDS
--
password=${VAULT::ds_ExampleDS::password::N2NhZDYzOTMtNWE0OS00ZGQ0LWE4M
mEtMWNlMDMyNDdmNmI2TElORV9CUkVBS3ZhdWx0}
reload
The following XML security element is added to the ExampleDS datasource secured with password
vault.
<security>
<user-name>admin</user-name>
216
CHAPTER 12. DATASOURCE MANAGEMENT
<password>${VAULT::ds_ExampleDS::password::N2NhZDYzOTMtNWE0OS00ZGQ0LWE4MmEtMW
NlMDMyNDdmNmI2TElORV9CUkVBS3ZhdWx0}</password>
</security>
For more information on using the Password Vault, see the Password Vault section in the JBoss EAP
How to Configure Server Security guide.
/subsystem=datasources/data-source=ExampleDS:write-attribute(name=credential-reference,value=
{store=exampleCS, alias=example-ds-pw})
Use the following steps to configure and use an authentication context for datasource security.
/subsystem=datasources/data-source=ExampleDS:undefine-attribute(name=password)
/subsystem=datasources/data-source=ExampleDS:undefine-attribute(name=user-name)
/subsystem=datasources/data-source=ExampleDS:write-attribute(name=elytron-
enabled,value=true)
reload
/subsystem=elytron/authentication-configuration=exampleAuthConfig:add(authentication-
name=sa,credential-reference={clear-text=sa})
4. Create an authentication-context.
/subsystem=elytron/authentication-context=exampleAuthContext:add(match-rules=
[{authentication-configuration=exampleAuthConfig}])
/subsystem=datasources/data-source=ExampleDS:write-attribute(name=authentication-
context,value=exampleAuthContext)
217
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
reload
NOTE
JBoss EAP host server has a keytab entry for the database server.
/system-property=java.security.krb5.conf:add(value="/path/to/krb5.conf")
/system-property=sun.security.krb5.debug:add(value="false")
/system-property=sun.security.spnego.debug:add(value="false")
2. Configure security.
You can use legacy security or Elytron security to secure a datasource.
batch
/subsystem=infinispan/cache-container=security:add(default-cache=auth-cache)
/subsystem=infinispan/cache-container=security/local-cache=auth-cache:add()
/subsystem=infinispan/cache-container=security/local-cache=auth-
cache/expiration=EXPIRATION:add(lifespan=3540000,max-idle=3540000)
/subsystem=infinispan/cache-container=security/local-cache=auth-
cache/memory=object:add(size=1000)
run-batch
lifespan: Interval, in milliseconds, at which new certificates are requested from the
KDC. Set the value of the lifespan attribute to be just smaller than the lifespan
defined by the KDC.
max-entries: The maximum number copies of the kerberos tickets to keep in cache.
The value corresponds to the number of configured connections in your datasource.
218
CHAPTER 12. DATASOURCE MANAGEMENT
batch
/subsystem=security/security-domain=KerberosDatabase:add(cache-type=infinispan)
/subsystem=security/security-domain=KerberosDatabase/authentication=classic:add
/subsystem=security/security-
domain=KerberosDatabase/authentication=classic/login-
module="KerberosDatabase-
Module":add(code="org.jboss.security.negotiation.KerberosLoginModule",module="org.
jboss.security.negotiation",flag=required, module-options={ "debug" => "false",
"storeKey" => "false", "useKeyTab" => "true", "keyTab" => "/path/to/eap.keytab",
"principal" => "[email protected]", "doNotPrompt" => "true",
"refreshKrb5Config" => "true", "isInitiator" => "true", "addGSSCredential" => "true",
"credentialLifetime" => "-1"})
run-batch
When using Microsoft JDBC driver for SQL server, add attribute and value
"wrapGSSCredential" ⇒ "true" in module-options.
/subsystem=elytron/kerberos-security-factory=krbsf:add(debug=false,
[email protected], path=/path/to/keytab, request-lifetime=-1,
obtain-kerberos-ticket=true, server=false)
/subsystem=elytron/authentication-configuration=kerberos-conf:add(kerberos-
security-factory=krbsf)
/subsystem=elytron/authentication-context=ds-context:add(match-rules=
[{authentication-configuration=kerberos-conf}])
/subsystem=datasources/data-source=KerberosDS:add(connection-url="URL", min-
pool-size=0, max-pool-size=10, jndi-name="java:jboss/datasource/KerberosDS",
driver-name=<jdbc-driver>.jar, security-domain=KerberosDatabase, allow-multiple-
users=false, pool-prefill=false, pool-use-strict-min=false, idle-timeout-minutes=2)
219
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
/subsystem=datasources/data-source=KerberosDS/connection-properties=
<connection-property-name>:add(value="(<kerberos-value>)")
/subsystem=datasources/data-source=KerberosDS/connection-
properties=oracle.net.authentication_services:add(value="(KERBEROS5)")
/subsystem=datasources/data-source=KerberosDS:add(connection-url="URL", min-
pool-size=0, max-pool-size=10, jndi-name="java:jboss/datasource/KerberosDS",
driver-name=<jdbc-driver>.jar, elytron-enabled=true, authentication-context=ds-
context, allow-multiple-users=false, pool-prefill=false, pool-use-strict-min=false, idle-
timeout-minutes=2)
/subsystem=datasources/data-source=KerberosDS/connection-properties=
<connection-property-name>:add(value="(<kerberos-value>)")
/subsystem=datasources/data-source=KerberosDS/connection-
properties=oracle.net.authentication_services:add(value="(KERBEROS5)")
When using kerberos authentication, it is recommended to use the following attributes and
values for the datasource:
pool-prefill=false
pool-use-strict-min=false
idle-timeout-minutes
NOTE
220
CHAPTER 12. DATASOURCE MANAGEMENT
NOTE
/subsystem=datasources/data-source=ExampleDS:write-attribute(name=statistics-
enabled,value=true)
4. Set the Statistics Enabled field to ON and click Save. A popup appears indicating that the
changes require a reload in order to take effect.
For a standalone server, click the Reload link from the popup to reload the server.
For a managed domain, click the Topology link from the popup. From the Topology tab,
select the appropriate server and select the Reload drop down option to reload the server.
NOTE
/subsystem=datasources/data-source=ExampleDS/statistics=pool:read-resource(include-
runtime=true)
{
"outcome" => "success",
"result" => {
"ActiveCount" => 1,
"AvailableCount" => 20,
"AverageBlockingTime" => 0L,
"AverageCreationTime" => 122L,
"AverageGetTime" => 128L,
"AveragePoolTime" => 0L,
"AverageUsageTime" => 0L,
"BlockingFailureCount" => 0,
"CreatedCount" => 1,
221
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
"DestroyedCount" => 0,
"IdleCount" => 1,
...
}
The following management CLI command retrieves the JDBC statistics for the ExampleDS datasource.
/subsystem=datasources/data-source=ExampleDS/statistics=jdbc:read-resource(include-
runtime=true)
{
"outcome" => "success",
"result" => {
"PreparedStatementCacheAccessCount" => 0L,
"PreparedStatementCacheAddCount" => 0L,
"PreparedStatementCacheCurrentSize" => 0,
"PreparedStatementCacheDeleteCount" => 0L,
"PreparedStatementCacheHitCount" => 0L,
"PreparedStatementCacheMissCount" => 0L,
"statistics-enabled" => true
}
}
NOTE
To configure capacity polices, you need to specify a capacity incrementer class, a capacity decrementer
class, or both.
222
CHAPTER 12. DATASOURCE MANAGEMENT
/subsystem=datasources/data-source=ExampleDS:write-attribute(name=capacity-incrementer-class,
value="org.jboss.jca.core.connectionmanager.pool.capacity.SizeIncrementer")
/subsystem=datasources/data-source=ExampleDS:write-attribute(name=capacity-decrementer-class,
value="org.jboss.jca.core.connectionmanager.pool.capacity.SizeDecrementer")
You can also configure properties on the specified capacity incrementer or decrementer class.
/subsystem=datasources/data-source=ExampleDS:write-attribute(name=capacity-incrementer-
properties.size, value=2)
/subsystem=datasources/data-source=ExampleDS:write-attribute(name=capacity-decrementer-
properties.size, value=2)
The MaxPoolSize incrementer policy will fill the pool to its max size for each request. This policy is useful
when you want to keep the maximum number of connections available all the time.
The Size incrementer policy will fill the pool by the specified number of connections for each request.
This policy is useful when you want to increment with an additional number of connections per request in
anticipation that the next request will also need a connection.
Name Description
NOTE
The Watermark incrementer policy will fill the pool to the specified number of connections for each
request. This policy is useful when you want to keep a specified number of connections in the pool at all
time.
Name Description
223
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
The MinPoolSize decrementer policy will decrement the pool to its min size for each request. This policy
is useful when you want to limit the number of connections after each idle timeout request. The pool will
operate in a First In First Out (FIFO) manner.
The Size decrementer policy will decrement the pool by the specified number of connections for each
idle timeout request.
Name Description
This policy is useful when you want to decrement an additional number of connections per idle timeout
request in anticipation that the pool usage will lower over time.
The TimedOut decrementer policy will removed all connections that have timed out from the pool for
each idle timeout request. The pool will operate in a First In Last Out (FILO) manner.
NOTE
The TimedOutFIFO decrementer policy will removed all connections that have timed out from the pool
for each idle timeout request. The pool will operate in a First In First Out (FIFO) manner.
The Watermark decrementer policy will decrement the pool to the specified number of connections for
each idle timeout request. This policy is useful when you want to keep a specified number of connections
in the pool at all time. The pool will operate in a First In First Out (FIFO) manner.
Name Description
224
CHAPTER 12. DATASOURCE MANAGEMENT
As of JBoss EAP 7.1, enlistment tracing is disabled by default. You can enable the recording of
enlistment traces for a datasource using the management CLI by setting the enlistment-trace attribute
to true.
WARNING
<datasources>
<datasource jndi-name="java:jboss/MySqlDS" pool-name="MySqlDS">
<connection-url>jdbc:mysql://localhost:3306/jbossdb</connection-url>
<driver>mysql</driver>
<security>
<user-name>admin</user-name>
<password>admin</password>
</security>
<validation>
<valid-connection-checker class-
name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker"/>
<validate-on-match>true</validate-on-match>
<background-validation>false</background-validation>
<exception-sorter class-
name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter"/>
</validation>
</datasource>
225
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
<drivers>
<driver name="mysql" module="com.mysql">
<driver-class>com.mysql.cj.jdbc.Driver</driver-class>
<xa-datasource-class>com.mysql.cj.jdbc.MysqlXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
IMPORTANT
Using the module management CLI command to add and remove modules is
provided as Technology Preview only. This command is not appropriate for use in
a managed domain or when connecting to the management CLI remotely.
Modules should be added and removed manually in a production environment.
Technology Preview features are not supported with Red Hat production service
level agreements (SLAs), might not be functionally complete, and Red Hat does
not recommend to use them for production. These features provide early access
to upcoming product features, enabling customers to test functionality and
provide feedback during the development process.
See Technology Preview Features Support Scope on the Red Hat Customer
Portal for information about the support scope for Technology Preview features.
/subsystem=datasources/jdbc-driver=mysql:add(driver-name=mysql,driver-module-
name=com.mysql,driver-xa-datasource-class-name=com.mysql.cj.jdbc.MysqlXADataSource,
driver-class-name=com.mysql.cj.jdbc.Driver)
226
CHAPTER 12. DATASOURCE MANAGEMENT
<datasources>
<xa-datasource jndi-name="java:jboss/MySqlXADS" pool-name="MySqlXADS">
<xa-datasource-property name="ServerName">
localhost
</xa-datasource-property>
<xa-datasource-property name="DatabaseName">
mysqldb
</xa-datasource-property>
<driver>mysql</driver>
<security>
<user-name>admin</user-name>
<password>admin</password>
</security>
<validation>
<valid-connection-checker class-
name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker"/>
<validate-on-match>true</validate-on-match>
<background-validation>false</background-validation>
<exception-sorter class-
name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter"/>
</validation>
</xa-datasource>
<drivers>
<driver name="mysql" module="com.mysql">
<driver-class>com.mysql.cj.jdbc.Driver</driver-class>
<xa-datasource-class>com.mysql.cj.jdbc.MysqlXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
227
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
<module name="sun.jdk"/>
<module name="ibm.jdk"/>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
IMPORTANT
Using the module management CLI command to add and remove modules is
provided as Technology Preview only. This command is not appropriate for use in
a managed domain or when connecting to the management CLI remotely.
Modules should be added and removed manually in a production environment.
Technology Preview features are not supported with Red Hat production service
level agreements (SLAs), might not be functionally complete, and Red Hat does
not recommend to use them for production. These features provide early access
to upcoming product features, enabling customers to test functionality and
provide feedback during the development process.
See Technology Preview Features Support Scope on the Red Hat Customer
Portal for information about the support scope for Technology Preview features.
/subsystem=datasources/jdbc-driver=mysql:add(driver-name=mysql,driver-module-
name=com.mysql,driver-xa-datasource-class-name=com.mysql.cj.jdbc.MysqlXADataSource,
driver-class-name=com.mysql.cj.jdbc.Driver)
228
CHAPTER 12. DATASOURCE MANAGEMENT
<datasources>
<datasource jndi-name="java:jboss/PostgresDS" pool-name="PostgresDS">
<connection-url>jdbc:postgresql://localhost:5432/postgresdb</connection-url>
<driver>postgresql</driver>
<security>
<user-name>admin</user-name>
<password>admin</password>
</security>
<validation>
<valid-connection-checker class-
name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLValidConnectionChecker"/>
<validate-on-match>true</validate-on-match>
<background-validation>false</background-validation>
<exception-sorter class-
name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLExceptionSorter"/>
</validation>
</datasource>
<drivers>
<driver name="postgresql" module="com.postgresql">
<xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
In the example above, make sure you replace 42.x.y with your driver version number.
Additional resources
For information about JDBC drivers and how to install them, see JDBC Drivers.
For information about JDBC drivers that have been tested as part of the JBoss EAP 7.4, see
JBoss EAP 7.4 Supported Configurations .
229
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
In the example above, make sure you replace 42.x.y with your driver version number.
IMPORTANT
Using the module management CLI command to add and remove modules is
provided as Technology Preview only. This command is not appropriate for use in
a managed domain or when connecting to the management CLI remotely.
Modules should be added and removed manually in a production environment.
Technology Preview features are not supported with Red Hat production service
level agreements (SLAs), might not be functionally complete, and Red Hat does
not recommend to use them for production. These features provide early access
to upcoming product features, enabling customers to test functionality and
provide feedback during the development process.
See Technology Preview Features Support Scope on the Red Hat Customer
Portal for information about the support scope for Technology Preview features.
/subsystem=datasources/jdbc-driver=postgresql:add(driver-name=postgresql,driver-module-
name=com.postgresql,driver-xa-datasource-class-
name=org.postgresql.xa.PGXADataSource)
<datasources>
<xa-datasource jndi-name="java:jboss/PostgresXADS" pool-name="PostgresXADS">
<xa-datasource-property name="ServerName">
localhost
</xa-datasource-property>
<xa-datasource-property name="PortNumber">
5432
</xa-datasource-property>
<xa-datasource-property name="DatabaseName">
postgresdb
230
CHAPTER 12. DATASOURCE MANAGEMENT
</xa-datasource-property>
<driver>postgresql</driver>
<security>
<user-name>admin</user-name>
<password>admin</password>
</security>
<validation>
<valid-connection-checker class-
name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLValidConnectionChecker"/>
<validate-on-match>true</validate-on-match>
<background-validation>false</background-validation>
<exception-sorter class-
name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLExceptionSorter"/>
</validation>
</xa-datasource>
<drivers>
<driver name="postgresql" module="com.postgresql">
<xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
In the example above, make sure you replace 42.x.y with your driver version number.
Additional resources
For information about JDBC drivers and how to install them, see JDBC Drivers.
For information about JDBC drivers that have been tested as part of the JBoss EAP 7.4, see
JBoss EAP 7.4 Supported Configurations .
231
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
In the example above, make sure you replace 42.x.y with your driver version number.
IMPORTANT
Using the module management CLI command to add and remove modules is
provided as Technology Preview only. This command is not appropriate for use in
a managed domain or when connecting to the management CLI remotely.
Modules should be added and removed manually in a production environment.
Technology Preview features are not supported with Red Hat production service
level agreements (SLAs), might not be functionally complete, and Red Hat does
not recommend to use them for production. These features provide early access
to upcoming product features, enabling customers to test functionality and
provide feedback during the development process.
See Technology Preview Features Support Scope on the Red Hat Customer
Portal for information about the support scope for Technology Preview features.
/subsystem=datasources/jdbc-driver=postgresql:add(driver-name=postgresql,driver-module-
name=com.postgresql,driver-xa-datasource-class-
name=org.postgresql.xa.PGXADataSource)
<datasources>
<datasource jndi-name="java:jboss/OracleDS" pool-name="OracleDS">
<connection-url>jdbc:oracle:thin:@localhost:1521:XE</connection-url>
<driver>oracle</driver>
<security>
<user-name>admin</user-name>
<password>admin</password>
</security>
<validation>
<valid-connection-checker class-
name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker"/>
<validate-on-match>true</validate-on-match>
232
CHAPTER 12. DATASOURCE MANAGEMENT
<background-validation>false</background-validation>
<exception-sorter class-
name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter"/>
</validation>
</datasource>
<drivers>
<driver name="oracle" module="com.oracle">
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
IMPORTANT
Using the module management CLI command to add and remove modules is
provided as Technology Preview only. This command is not appropriate for use in
a managed domain or when connecting to the management CLI remotely.
Modules should be added and removed manually in a production environment.
Technology Preview features are not supported with Red Hat production service
level agreements (SLAs), might not be functionally complete, and Red Hat does
not recommend to use them for production. These features provide early access
to upcoming product features, enabling customers to test functionality and
provide feedback during the development process.
See Technology Preview Features Support Scope on the Red Hat Customer
Portal for information about the support scope for Technology Preview features.
233
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
/subsystem=datasources/jdbc-driver=oracle:add(driver-name=oracle,driver-module-
name=com.oracle,driver-xa-datasource-class-
name=oracle.jdbc.xa.client.OracleXADataSource)
IMPORTANT
The following settings must be applied for the user accessing an Oracle XA datasource in
order for XA recovery to operate correctly. The value user is the user defined to connect
from JBoss EAP to Oracle:
<datasources>
<xa-datasource jndi-name="java:jboss/OracleXADS" pool-name="OracleXADS">
<xa-datasource-property name="URL">
jdbc:oracle:thin:@oracleHostName:1521:orcl
</xa-datasource-property>
<driver>oracle</driver>
<xa-pool>
<is-same-rm-override>false</is-same-rm-override>
</xa-pool>
<security>
<user-name>admin</user-name>
<password>admin</password>
</security>
<validation>
<valid-connection-checker class-
name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker"/>
<validate-on-match>true</validate-on-match>
<background-validation>false</background-validation>
<exception-sorter class-
name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter"/>
234
CHAPTER 12. DATASOURCE MANAGEMENT
</validation>
</xa-datasource>
<drivers>
<driver name="oracle" module="com.oracle">
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
IMPORTANT
Using the module management CLI command to add and remove modules is
provided as Technology Preview only. This command is not appropriate for use in
a managed domain or when connecting to the management CLI remotely.
Modules should be added and removed manually in a production environment.
Technology Preview features are not supported with Red Hat production service
level agreements (SLAs), might not be functionally complete, and Red Hat does
not recommend to use them for production. These features provide early access
to upcoming product features, enabling customers to test functionality and
provide feedback during the development process.
See Technology Preview Features Support Scope on the Red Hat Customer
Portal for information about the support scope for Technology Preview features.
/subsystem=datasources/jdbc-driver=oracle:add(driver-name=oracle,driver-module-
name=com.oracle,driver-xa-datasource-class-
name=oracle.jdbc.xa.client.OracleXADataSource)
235
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
<datasources>
<datasource jndi-name="java:jboss/MSSQLDS" pool-name="MSSQLDS">
<connection-url>jdbc:sqlserver://localhost:1433;DatabaseName=MyDatabase</connection-url>
<driver>sqlserver</driver>
<security>
<user-name>admin</user-name>
<password>admin</password>
</security>
<validation>
<valid-connection-checker class-
name="org.jboss.jca.adapters.jdbc.extensions.mssql.MSSQLValidConnectionChecker"/>
<validate-on-match>true</validate-on-match>
<background-validation>false</background-validation>
<exception-sorter class-
name="org.jboss.jca.adapters.jdbc.extensions.mssql.MSSQLExceptionSorter"/>
</validation>
</datasource>
<drivers>
<driver name="sqlserver" module="com.microsoft">
<xa-datasource-class>com.microsoft.sqlserver.jdbc.SQLServerXADataSource</xa-datasource-
class>
</driver>
</drivers>
</datasources>
236
CHAPTER 12. DATASOURCE MANAGEMENT
<module name="javax.transaction.api"/>
<module name="javax.xml.bind.api"/>
</dependencies>
</module>
IMPORTANT
Using the module management CLI command to add and remove modules is
provided as Technology Preview only. This command is not appropriate for use in
a managed domain or when connecting to the management CLI remotely.
Modules should be added and removed manually in a production environment.
Technology Preview features are not supported with Red Hat production service
level agreements (SLAs), might not be functionally complete, and Red Hat does
not recommend to use them for production. These features provide early access
to upcoming product features, enabling customers to test functionality and
provide feedback during the development process.
See Technology Preview Features Support Scope on the Red Hat Customer
Portal for information about the support scope for Technology Preview features.
/subsystem=datasources/jdbc-driver=sqlserver:add(driver-name=sqlserver,driver-module-
name=com.microsoft,driver-xa-datasource-class-
name=com.microsoft.sqlserver.jdbc.SQLServerXADataSource)
<datasources>
237
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
238
CHAPTER 12. DATASOURCE MANAGEMENT
IMPORTANT
Using the module management CLI command to add and remove modules is
provided as Technology Preview only. This command is not appropriate for use in
a managed domain or when connecting to the management CLI remotely.
Modules should be added and removed manually in a production environment.
Technology Preview features are not supported with Red Hat production service
level agreements (SLAs), might not be functionally complete, and Red Hat does
not recommend to use them for production. These features provide early access
to upcoming product features, enabling customers to test functionality and
provide feedback during the development process.
See Technology Preview Features Support Scope on the Red Hat Customer
Portal for information about the support scope for Technology Preview features.
/subsystem=datasources/jdbc-driver=sqlserver:add(driver-name=sqlserver,driver-module-
name=com.microsoft,driver-xa-datasource-class-
name=com.microsoft.sqlserver.jdbc.SQLServerXADataSource)
<datasources>
<datasource jndi-name="java:jboss/DB2DS" pool-name="DB2DS">
<connection-url>jdbc:db2://localhost:50000/ibmdb2db</connection-url>
<driver>ibmdb2</driver>
<pool>
<min-pool-size>0</min-pool-size>
<max-pool-size>50</max-pool-size>
</pool>
<security>
<user-name>admin</user-name>
239
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
<password>admin</password>
</security>
<validation>
<valid-connection-checker class-
name="org.jboss.jca.adapters.jdbc.extensions.db2.DB2ValidConnectionChecker"/>
<validate-on-match>true</validate-on-match>
<background-validation>false</background-validation>
<exception-sorter class-
name="org.jboss.jca.adapters.jdbc.extensions.db2.DB2ExceptionSorter"/>
</validation>
</datasource>
<drivers>
<driver name="ibmdb2" module="com.ibm">
<xa-datasource-class>com.ibm.db2.jcc.DB2XADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
IMPORTANT
240
CHAPTER 12. DATASOURCE MANAGEMENT
IMPORTANT
Using the module management CLI command to add and remove modules is
provided as Technology Preview only. This command is not appropriate for use in
a managed domain or when connecting to the management CLI remotely.
Modules should be added and removed manually in a production environment.
Technology Preview features are not supported with Red Hat production service
level agreements (SLAs), might not be functionally complete, and Red Hat does
not recommend to use them for production. These features provide early access
to upcoming product features, enabling customers to test functionality and
provide feedback during the development process.
See Technology Preview Features Support Scope on the Red Hat Customer
Portal for information about the support scope for Technology Preview features.
/subsystem=datasources/jdbc-driver=ibmdb2:add(driver-name=ibmdb2,driver-module-
name=com.ibm,driver-xa-datasource-class-name=com.ibm.db2.jcc.DB2XADataSource)
<datasources>
<xa-datasource jndi-name="java:jboss/DB2XADS" pool-name="DB2XADS">
<xa-datasource-property name="ServerName">
localhost
</xa-datasource-property>
<xa-datasource-property name="DatabaseName">
ibmdb2db
</xa-datasource-property>
<xa-datasource-property name="PortNumber">
50000
</xa-datasource-property>
<xa-datasource-property name="DriverType">
4
</xa-datasource-property>
<driver>ibmdb2</driver>
<xa-pool>
<is-same-rm-override>false</is-same-rm-override>
</xa-pool>
241
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
<security>
<user-name>admin</user-name>
<password>admin</password>
</security>
<recovery>
<recover-plugin class-name="org.jboss.jca.core.recovery.ConfigurableRecoveryPlugin">
<config-property name="EnableIsValid">
false
</config-property>
<config-property name="IsValidOverride">
false
</config-property>
<config-property name="EnableClose">
false
</config-property>
</recover-plugin>
</recovery>
<validation>
<valid-connection-checker class-
name="org.jboss.jca.adapters.jdbc.extensions.db2.DB2ValidConnectionChecker"/>
<validate-on-match>true</validate-on-match>
<background-validation>false</background-validation>
<exception-sorter class-
name="org.jboss.jca.adapters.jdbc.extensions.db2.DB2ExceptionSorter"/>
</validation>
</xa-datasource>
<drivers>
<driver name="ibmdb2" module="com.ibm">
<xa-datasource-class>com.ibm.db2.jcc.DB2XADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
242
CHAPTER 12. DATASOURCE MANAGEMENT
IMPORTANT
Using the module management CLI command to add and remove modules is
provided as Technology Preview only. This command is not appropriate for use in
a managed domain or when connecting to the management CLI remotely.
Modules should be added and removed manually in a production environment.
Technology Preview features are not supported with Red Hat production service
level agreements (SLAs), might not be functionally complete, and Red Hat does
not recommend to use them for production. These features provide early access
to upcoming product features, enabling customers to test functionality and
provide feedback during the development process.
See Technology Preview Features Support Scope on the Red Hat Customer
Portal for information about the support scope for Technology Preview features.
/subsystem=datasources/jdbc-driver=ibmdb2:add(driver-name=ibmdb2,driver-module-
name=com.ibm,driver-xa-datasource-class-name=com.ibm.db2.jcc.DB2XADataSource)
<datasources>
<datasource jndi-name="java:jboss/SybaseDB" pool-name="SybaseDB">
<connection-url>jdbc:sybase:Tds:localhost:5000/DATABASE?
JCONNECT_VERSION=6</connection-url>
<driver>sybase</driver>
<security>
<user-name>admin</user-name>
<password>admin</password>
</security>
<validation>
<valid-connection-checker class-
243
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
name="org.jboss.jca.adapters.jdbc.extensions.sybase.SybaseValidConnectionChecker"/>
<validate-on-match>true</validate-on-match>
<background-validation>false</background-validation>
<exception-sorter class-
name="org.jboss.jca.adapters.jdbc.extensions.sybase.SybaseExceptionSorter"/>
</validation>
</datasource>
<drivers>
<driver name="sybase" module="com.sybase">
<xa-datasource-class>com.sybase.jdbc4.jdbc.SybXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
IMPORTANT
Using the module management CLI command to add and remove modules is
provided as Technology Preview only. This command is not appropriate for use in
a managed domain or when connecting to the management CLI remotely.
Modules should be added and removed manually in a production environment.
Technology Preview features are not supported with Red Hat production service
level agreements (SLAs), might not be functionally complete, and Red Hat does
not recommend to use them for production. These features provide early access
to upcoming product features, enabling customers to test functionality and
provide feedback during the development process.
See Technology Preview Features Support Scope on the Red Hat Customer
Portal for information about the support scope for Technology Preview features.
244
CHAPTER 12. DATASOURCE MANAGEMENT
/subsystem=datasources/jdbc-driver=sybase:add(driver-name=sybase,driver-module-
name=com.sybase,driver-xa-datasource-class-
name=com.sybase.jdbc4.jdbc.SybXADataSource)
<datasources>
<xa-datasource jndi-name="java:jboss/SybaseXADS" pool-name="SybaseXADS">
<xa-datasource-property name="ServerName">
localhost
</xa-datasource-property>
<xa-datasource-property name="DatabaseName">
mydatabase
</xa-datasource-property>
<xa-datasource-property name="PortNumber">
4100
</xa-datasource-property>
<xa-datasource-property name="NetworkProtocol">
Tds
</xa-datasource-property>
<driver>sybase</driver>
<xa-pool>
<is-same-rm-override>false</is-same-rm-override>
</xa-pool>
<security>
<user-name>admin</user-name>
<password>admin</password>
</security>
<validation>
<valid-connection-checker class-
name="org.jboss.jca.adapters.jdbc.extensions.sybase.SybaseValidConnectionChecker"/>
<validate-on-match>true</validate-on-match>
<background-validation>false</background-validation>
<exception-sorter class-
name="org.jboss.jca.adapters.jdbc.extensions.sybase.SybaseExceptionSorter"/>
</validation>
</xa-datasource>
<drivers>
<driver name="sybase" module="com.sybase">
<xa-datasource-class>com.sybase.jdbc4.jdbc.SybXADataSource</xa-datasource-class>
245
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
</driver>
</drivers>
</datasources>
IMPORTANT
Using the module management CLI command to add and remove modules is
provided as Technology Preview only. This command is not appropriate for use in
a managed domain or when connecting to the management CLI remotely.
Modules should be added and removed manually in a production environment.
Technology Preview features are not supported with Red Hat production service
level agreements (SLAs), might not be functionally complete, and Red Hat does
not recommend to use them for production. These features provide early access
to upcoming product features, enabling customers to test functionality and
provide feedback during the development process.
See Technology Preview Features Support Scope on the Red Hat Customer
Portal for information about the support scope for Technology Preview features.
/subsystem=datasources/jdbc-driver=sybase:add(driver-name=sybase,driver-module-
name=com.sybase,driver-xa-datasource-class-
name=com.sybase.jdbc4.jdbc.SybXADataSource)
246
CHAPTER 12. DATASOURCE MANAGEMENT
<datasources>
<datasource jndi-name="java:jboss/MariaDBDS" pool-name="MariaDBDS">
<connection-url>jdbc:mariadb://localhost:3306/jbossdb</connection-url>
<driver>mariadb</driver>
<security>
<user-name>admin</user-name>
<password>admin</password>
</security>
<validation>
<valid-connection-checker class-
name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker"/>
<validate-on-match>true</validate-on-match>
<background-validation>false</background-validation>
<exception-sorter class-
name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter"/>
</validation>
</datasource>
<drivers>
<driver name="mariadb" module="org.mariadb">
<driver-class>org.mariadb.jdbc.Driver</driver-class>
<xa-datasource-class>org.mariadb.jdbc.MySQLDataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
247
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
IMPORTANT
Using the module management CLI command to add and remove modules is
provided as Technology Preview only. This command is not appropriate for use in
a managed domain or when connecting to the management CLI remotely.
Modules should be added and removed manually in a production environment.
Technology Preview features are not supported with Red Hat production service
level agreements (SLAs), might not be functionally complete, and Red Hat does
not recommend to use them for production. These features provide early access
to upcoming product features, enabling customers to test functionality and
provide feedback during the development process.
See Technology Preview Features Support Scope on the Red Hat Customer
Portal for information about the support scope for Technology Preview features.
/subsystem=datasources/jdbc-driver=mariadb:add(driver-name=mariadb,driver-module-
name=org.mariadb,driver-xa-datasource-class-name=org.mariadb.jdbc.MySQLDataSource,
driver-class-name=org.mariadb.jdbc.Driver)
<datasources>
<xa-datasource jndi-name="java:jboss/MariaDBXADS" pool-name="MariaDBXADS">
<xa-datasource-property name="ServerName">
localhost
</xa-datasource-property>
<xa-datasource-property name="DatabaseName">
mariadbdb
248
CHAPTER 12. DATASOURCE MANAGEMENT
</xa-datasource-property>
<driver>mariadb</driver>
<security>
<user-name>admin</user-name>
<password>admin</password>
</security>
<validation>
<valid-connection-checker class-
name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker"/>
<validate-on-match>true</validate-on-match>
<background-validation>false</background-validation>
<exception-sorter class-
name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter"/>
</validation>
</xa-datasource>
<drivers>
<driver name="mariadb" module="org.mariadb">
<driver-class>org.mariadb.jdbc.Driver</driver-class>
<xa-datasource-class>org.mariadb.jdbc.MySQLDataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
IMPORTANT
249
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
IMPORTANT
Using the module management CLI command to add and remove modules is
provided as Technology Preview only. This command is not appropriate for use in
a managed domain or when connecting to the management CLI remotely.
Modules should be added and removed manually in a production environment.
Technology Preview features are not supported with Red Hat production service
level agreements (SLAs), might not be functionally complete, and Red Hat does
not recommend to use them for production. These features provide early access
to upcoming product features, enabling customers to test functionality and
provide feedback during the development process.
See Technology Preview Features Support Scope on the Red Hat Customer
Portal for information about the support scope for Technology Preview features.
/subsystem=datasources/jdbc-driver=mariadb:add(driver-name=mariadb,driver-module-
name=org.mariadb,driver-xa-datasource-class-name=org.mariadb.jdbc.MySQLDataSource,
driver-class-name=org.mariadb.jdbc.Driver)
WARNING
<datasources>
<datasource jndi-name="java:jboss/MariaDBGaleraClusterDS" pool-
name="MariaDBGaleraClusterDS">
<connection-url>jdbc:mariadb://192.168.1.1:3306,192.168.1.2:3306/jbossdb</connection-url>
<driver>mariadb</driver>
<security>
250
CHAPTER 12. DATASOURCE MANAGEMENT
<user-name>admin</user-name>
<password>admin</password>
</security>
<validation>
<valid-connection-checker class-
name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker"/>
<validate-on-match>true</validate-on-match>
<background-validation>false</background-validation>
<exception-sorter class-
name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter"/>
</validation>
</datasource>
<drivers>
<driver name="mariadb" module="org.mariadb">
<driver-class>org.mariadb.jdbc.Driver</driver-class>
<xa-datasource-class>org.mariadb.jdbc.MySQLDataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
IMPORTANT
251
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
IMPORTANT
Using the module management CLI command to add and remove modules is
provided as Technology Preview only. This command is not appropriate for use in
a managed domain or when connecting to the management CLI remotely.
Modules should be added and removed manually in a production environment.
Technology Preview features are not supported with Red Hat production service
level agreements (SLAs), might not be functionally complete, and Red Hat does
not recommend to use them for production. These features provide early access
to upcoming product features, enabling customers to test functionality and
provide feedback during the development process.
See Technology Preview Features Support Scope on the Red Hat Customer
Portal for information about the support scope for Technology Preview features.
/subsystem=datasources/jdbc-driver=mariadb:add(driver-name=mariadb,driver-module-
name=org.mariadb,driver-xa-datasource-class-name=org.mariadb.jdbc.MySQLDataSource,
driver-class-name=org.mariadb.jdbc.Driver)
252
CHAPTER 13. DATASOURCE MANAGEMENT WITH AGROAL
The datasources-agroal subsystem is not available by default and you must enable it in order to use
this new implementation.
IMPORTANT
See Technology Preview Features Support Scope on the Red Hat Customer Portal for
information about the support scope for Technology Preview features.
/extension=org.wildfly.extension.datasources-agroal:add
/subsystem=datasources-agroal:add
reload
<server xmlns="urn:jboss:domain:8.0">
<extensions>
...
<extension module="org.wildfly.extension.datasources-agroal"/>
...
</extensions>
...
<subsystem xmlns="urn:jboss:domain:datasources-agroal:1.0"/>
...
</server>
253
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
To install a JDBC driver as a core module for Agroal datasources, you must first add the JDBC driver as
a core module and then register the JDBC driver in the datasources-agroal subsystem.
Make sure to extract the archive if the JDBC driver JAR file is contained within a ZIP or TAR
archive.
$ EAP_HOME/bin/jboss-cli.sh
4. Use the module add management CLI command to add the new core module.
For example, the following command adds a MySQL JDBC driver module.
IMPORTANT
Using the module management CLI command to add and remove modules is
provided as Technology Preview only. This command is not appropriate for use in
a managed domain or when connecting to the management CLI remotely.
Modules should be added and removed manually in a production environment.
Technology Preview features are not supported with Red Hat production service
level agreements (SLAs), might not be functionally complete, and Red Hat does
not recommend to use them for production. These features provide early access
to upcoming product features, enabling customers to test functionality and
provide feedback during the development process.
See Technology Preview Features Support Scope on the Red Hat Customer
Portal for information about the support scope for Technology Preview features.
Execute module --help for more details on using this command to add and remove modules.
254
CHAPTER 13. DATASOURCE MANAGEMENT WITH AGROAL
You must next register it as a JDBC driver for it to be referenced by application datasources.
/subsystem=datasources-
agroal/driver=DRIVER_NAME:add(module=MODULE_NAME,class=CLASS_NAME)
The CLASS_NAME must be a fully qualified class name that implements either java.sql.Driver or
javax.sql.DataSource for non-XA datasources, or javax.sql.XADataSource for XA datasources.
IMPORTANT
See Technology Preview Features Support Scope on the Red Hat Customer Portal for
information about the support scope for Technology Preview features.
/subsystem=datasources-agroal/datasource=DATASOURCE_NAME:add(jndi-
name=JNDI_NAME,connection-factory={driver=DRIVER_NAME,url=URL},connection-pool={max-
size=MAX_POOL_SIZE})
For a complete listing of all available Agroal datasource attributes, see the Agroal Datasource Attributes
section.
See Example MySQL Agroal Datasource for an example Agroal datasource configuration.
/subsystem=datasources-agroal/datasource=DATASOURCE_NAME:remove
IMPORTANT
255
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
IMPORTANT
See Technology Preview Features Support Scope on the Red Hat Customer Portal for
information about the support scope for Technology Preview features.
/subsystem=datasources-agroal/xa-datasource=XA_DATASOURCE_NAME:add(jndi-
name=JNDI_NAME,connection-factory={driver=DRIVER_NAME,connection-properties=
{ServerName=HOST_NAME,PortNumber=PORT,DatabaseName=DATABASE_NAME}},connection-
pool={max-size=MAX_POOL_SIZE})
For a complete listing of all available Agroal datasource attributes, see the Agroal Datasource Attributes
section.
See Example MySQL Agroal XA Datasource for an example Agroal XA datasource configuration.
/subsystem=datasources-agroal/xa-datasource=DATASOURCE_NAME:remove
<subsystem xmlns="urn:jboss:domain:datasources-agroal:1.0">
<datasource name="ExampleAgroalDS" jndi-name="java:jboss/datasources/ExampleAgroalDS">
<connection-factory driver="mysql" url="jdbc:mysql://localhost:3306/jbossdb" username="admin"
password="admin"/>
<connection-pool max-size="30"/>
</datasource>
<drivers>
<driver name="mysql" module="com.mysql" class="com.mysql.cj.jdbc.Driver"/>
</drivers>
</subsystem>
256
CHAPTER 13. DATASOURCE MANAGEMENT WITH AGROAL
<resources>
<resource-root path="mysql-connector-java-8.0.12.jar"/>
</resources>
<dependencies>
<module name="javaee.api"/>
<module name="sun.jdk"/>
<module name="ibm.jdk"/>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
IMPORTANT
Using the module management CLI command to add and remove modules is
provided as Technology Preview only. This command is not appropriate for use in
a managed domain or when connecting to the management CLI remotely.
Modules should be added and removed manually in a production environment.
Technology Preview features are not supported with Red Hat production service
level agreements (SLAs), might not be functionally complete, and Red Hat does
not recommend to use them for production. These features provide early access
to upcoming product features, enabling customers to test functionality and
provide feedback during the development process.
See Technology Preview Features Support Scope on the Red Hat Customer
Portal for information about the support scope for Technology Preview features.
/subsystem=datasources-
agroal/driver=mysql:add(module=com.mysql,class=com.mysql.cj.jdbc.Driver)
/subsystem=datasources-agroal/datasource=ExampleAgroalDS:add(jndi-
name=java:jboss/datasources/ExampleAgroalDS,connection-factory=
{driver=mysql,url=jdbc:mysql://localhost:3306/jbossdb,username=admin,password=admin},conn
ection-pool={max-size=30})
257
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
<subsystem xmlns="urn:jboss:domain:datasources-agroal:1.0">
<xa-datasource name="ExampleAgroalXADS" jndi-
name="java:jboss/datasources/ExampleAgroalXADS">
<connection-factory driver="mysqlXA" username="admin" password="admin">
<connection-properties>
<property name="ServerName" value="localhost"/>
<property name="PortNumber" value="3306"/>
<property name="DatabaseName" value="jbossdb"/>
</connection-properties>
</connection-factory>
<connection-pool max-size="30"/>
</xa-datasource>
<drivers>
<driver name="mysqlXA" module="com.mysql" class="com.mysql.cj.jdbc.MysqlXADataSource"/>
</drivers>
</subsystem>
<resources>
<resource-root path="mysql-connector-java-8.0.12.jar"/>
</resources>
<dependencies>
<module name="javaee.api"/>
<module name="sun.jdk"/>
<module name="ibm.jdk"/>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
IMPORTANT
258
CHAPTER 13. DATASOURCE MANAGEMENT WITH AGROAL
IMPORTANT
Using the module management CLI command to add and remove modules is
provided as Technology Preview only. This command is not appropriate for use in
a managed domain or when connecting to the management CLI remotely.
Modules should be added and removed manually in a production environment.
Technology Preview features are not supported with Red Hat production service
level agreements (SLAs), might not be functionally complete, and Red Hat does
not recommend to use them for production. These features provide early access
to upcoming product features, enabling customers to test functionality and
provide feedback during the development process.
See Technology Preview Features Support Scope on the Red Hat Customer
Portal for information about the support scope for Technology Preview features.
/subsystem=datasources-
agroal/driver=mysqlXA:add(module=com.mysql,class=com.mysql.cj.jdbc.MysqlXADataSource)
/subsystem=datasources-agroal/xa-datasource=ExampleAgroalXADS:add(jndi-
name=java:jboss/datasources/ExampleAgroalXADS,connection-factory=
{driver=mysqlXA,connection-properties=
{ServerName=localhost,PortNumber=3306,DatabaseName=jbossdb},username=admin,passwo
rd=admin},connection-pool={max-size=30})
259
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
260
CHAPTER 15. ORB CONFIGURATION
The ORB is used internally for JTS transactions, and is also available for use by your own applications.
NOTE
The Object Transaction Service (OTS) is a cross-platform service that forms part of
CORBA. The OTS specification is maintained by the Object Management Group. JTS is a
specification for building a transaction manager, and JTS was designed based on the OTS
specification.
For information about CORBA and its components, see Common Object Request Broker
Architecture.
NOTE
The iiop-openjdk subsystem is available when using the full or full-ha profile in a
managed domain, or the standalone-full.xml or standalone-full-ha.xml configuration
file for a standalone server.
For a listing of the available configuration options for the iiop-openjdk subsystem, see IIOP Subsystem
Attributes.
You can configure the following management CLI commands for a managed domain using the full
profile. If necessary, change the profile to suit the one you need to configure. If you are using a
standalone server, omit the /profile=full portion of the commands.
/profile=full/subsystem=iiop-openjdk:write-attribute(name=security,value=identity)
261
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
/profile=full/subsystem=iiop-openjdk:write-attribute(name=transactions, value=full)
/profile=full/subsystem=transactions:write-attribute(name=jts,value=true)
NOTE
For JTS activation, the server must be restarted as reload is not enough.
1. Select the Configuration tab from the top of the management console. In a managed domain,
you must select the appropriate profile to modify.
1. Use the following management CLI command to display the current legacy SSL/TLS
configuration in the iiop-openjdk subsystem.
/subsystem=iiop-openjdk:read-attribute(name=security-domain)
{
"outcome" => "success",
"result" => "iiopSSLSecurityDomain"
}
The iiop-openjdk subsystem must use either the legacy security subsystem or the elytron
subsystem for SSL/TLS. You cannot use both at the same time. The above command shows
the iiop-openjdk subsystem is using a legacy security domain for handling SSL/TLS. Before you
can configure the iiop-openjdk subsystem to use the elytron subsystem for SSL/TLS, you
need to remove this reference:
/subsystem=iiop-openjdk:undefine-attribute(name=security-realm)
If the security-domain attribute in the iiop-openjdk is not defined, you can proceed to the next
step.
2. Create a server-ssl-context.
To use SSL/TLS with the iiop-openjdk subsystem, you need to define a server-ssl-context.
JBoss EAP uses the configuration provided by the server-ssl-context when making an
262
CHAPTER 15. ORB CONFIGURATION
SSL/TLS connection as a server. You can find more details on creating a server-ssl-context in
Enable One-way SSL/TLS for Applications using the Elytron Subsystem in How to Configure
Server Security guide.
3. Create a client-ssl-context.
To use SSL/TLS with the iiop-openjdk subsystem, you need to define a client-ssl-context.
JBoss EAP uses the configuration provided by the client-ssl-context when making an SSL/TLS
connection as a client. You can find more details on creating a client-ssl-context in Using a
client-ssl-context in the How to Configure Server Security guide.
batch
/subsystem=iiop-openjdk:write-attribute(name=client-ssl-context,value=iiopClientSSC)
/subsystem=iiop-openjdk:write-attribute(name=server-ssl-context,value=iiopServerSSC)
run-batch
reload
To enable support for SSL in the iiop-openjdk subsystem, set support-ssl to true. Defaults
to false.
/subsystem=iiop-openjdk:write-attribute(name=support-ssl,value=true)
/subsystem=iiop-openjdk:write-attribute(name=client-requires-ssl,value=true)
/subsystem=iiop-openjdk:write-attribute(name=server-requires-ssl,value=true)
/subsystem=iiop-openjdk:write-attribute(name=ssl-socket-binding,value=iiop-ssl)
reload
263
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
connections
transactions
security
life-cycle
work instances
transaction inflow
message inflow
An Enterprise Information System can be any other software system within an organization. Examples
include Enterprise Resource Planning (ERP) systems, database systems, e-mail servers and proprietary
messaging systems.
A resource adapter is packaged in a Resource Adapter Archive (RAR) file which can be deployed to
JBoss EAP. A RAR file may also be included in an Enterprise Archive (EAR) deployment.
The resource adapter itself is defined within the resource-adapters subsystem, which is provided by the
IronJacamar project.
Archive validation
Bean validation
Work managers
264
CHAPTER 16. JAKARTA CONNECTORS MANAGEMENT
Bootstrap contexts
Configuration - Contains settings for the cached connection manager, archive validation,
and bean validation. Each of these is contained in their own tab as well. Modify these settings
by opening the appropriate tab and clicking the Edit link.
Bootstrap Context - Contains the list of configured bootstrap contexts. New bootstrap
context objects can be added, removed, and configured. Each bootstrap context must be
assigned a work manager.
Workmanager - Contains the list of configured work managers. New work managers can be
added, removed, and their thread pools configured here. Each work manager can have one
short-running thread pool and an optional long-running thread pool.
The thread pool attributes can be configured by clicking Thread Pools on the selected work
manager.
NOTE
Attribute names in the tables in the following sections are listed as they appear in the
management model, for example, when using the management CLI. See the schema
definition file located at EAP_HOME/docs/schema/wildfly-jca_5_0.xsd to view the
elements as they appear in the XML, as there may be differences from the management
model.
Archive Validation
This determines whether archive validation will be performed on the deployment units. The following
table describes the attributes you can set for archive validation.
fail-on-error true Specifies whether an archive validation error report fails the
deployment.
fail-on-warn false Specifies whether an archive validation warning report fails the
deployment.
If an archive does not implement the Jakarta Connectors specification correctly and archive validation is
265
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
If an archive does not implement the Jakarta Connectors specification correctly and archive validation is
enabled, an error message will display during deployment describing the problem. For example:
Severity: ERROR
Section: 19.4.2
Description: A ResourceAdapter must implement a "public int hashCode()" method.
Code: com.mycompany.myproject.ResourceAdapterImpl
Severity: ERROR
Section: 19.4.2
Description: A ResourceAdapter must implement a "public boolean equals(Object)" method.
Code: com.mycompany.myproject.ResourceAdapterImpl
If archive validation is not specified, it is considered present and the enabled attribute defaults to true.
Bean Validation
This setting determines whether bean validation is performed. For information about the specification,
see in Jakarta Bean Validation specification. The following table describes the attributes you can set for
bean validation.
If bean validation is not specified, it is considered present and the enabled attribute defaults to true.
Work Managers
There are two types of work managers:
The following table describes the attributes you can set for work managers.
Attribute Description
266
CHAPTER 16. JAKARTA CONNECTORS MANAGEMENT
short-running-threads Thread pool for standard Work instances. Each work manager has one short-
running thread pool.
long-running-threads Thread pool for Jakarta Connectors 1.7 Work instances that set the
LONG_RUNNING hint. Each work manager can have one optional long-running
thread pool.
The following table describes the attributes you can set for work manager thread pools.
Attribute Description
allow-core-timeout Boolean setting that determines whether core threads may time out. The default
value is false.
core-threads The core thread pool size. This must be equal to or smaller than the maximum
thread pool size.
handoff-executor An executor to delegate tasks to in the event that a task cannot be accepted. If
not specified, tasks that cannot be accepted will be silently discarded.
keepalive-time Specifies the amount of time that pool threads should be kept after doing work.
The following example management CLI commands configure a distributed work manager. Note that
you must use a configuration that provides high availability capabilities, such as the standalone-ha.xml
or standalone-full-ha.xml configuration file for a standalone server.
batch
/subsystem=jca/distributed-workmanager=myDistWorkMgr:add(name=myDistWorkMgr)
/subsystem=jca/distributed-workmanager=myDistWorkMgr/short-running-
threads=myDistWorkMgr:add(queue-length=10,max-threads=10)
267
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
/subsystem=jca/bootstrap-
context=myCustomContext:add(name=myCustomContext,workmanager=myDistWorkMgr)
run-batch
NOTE
The name of the short-running-threads element must be the same as the name of the
distributed-workmanager element.
The following table describes the attributes you can configure for distributed work managers.
Attribute Description
policy The policy decides when to redistribute a work instance. Allowed values are:
policy-options List of the policy’s key/value pair options. If you use the WATERMARK policy,
then you can use the watermark policy option to specify at what number of free
threads that work should be distributed. For example:
/subsystem=jca/distributed-workmanager=myDistWorkMgr:write-
attribute(name=policy-options,value={watermark=3})
selector The selector decides to which nodes in the network to redistribute the work
instance. Allowed values are:
268
CHAPTER 16. JAKARTA CONNECTORS MANAGEMENT
long-running-threads The thread pool for work instances that set the LONG_RUNNING hint. Each
distributed work manager can optionally have a long-running thread pool.
short-running-threads The thread pool for standard work instances. Each distributed work manager must
have a short-running thread pool.
Bootstrap Contexts
This is used to define custom bootstrap contexts. The following table describes the attributes you can
set for bootstrap contexts.
Attribute Description
workmanager Specifies the name of the work manager to use for this context.
install false Enable or disable the cached connection manager valve and
interceptor.
269
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
deploy /path/to/resource-adapter.rar
To deploy the resource adapter to all server groups in a managed domain, enter the following
management CLI command.
2. Click the Add (+) button. In a managed domain, you will first need to select Content Repository.
6. In a managed domain, deploy the deployment to the appropriate server groups and enable the
deployment.
NOTE
This option is not available for managed domains. You must use either the management
console or the management CLI to deploy the resource adapter to server groups.
/subsystem=resource-adapters/resource-adapter=eis.rar:add(archive=eis.rar, transaction-
support=XATransaction)
Configure config-properties.
Add the server configuration property.
/subsystem=resource-adapters/resource-adapter=eis.rar/config-
properties=server:add(value=localhost)
270
CHAPTER 16. JAKARTA CONNECTORS MANAGEMENT
/subsystem=resource-adapters/resource-adapter=eis.rar/config-
properties=port:add(value=9000)
Configure admin-objects.
Add an admin object.
/subsystem=resource-adapters/resource-adapter=eis.rar/admin-objects=aoName:add(class-
name=com.acme.eis.ra.EISAdminObjectImpl, jndi-name=java:/eis/AcmeAdminObject)
/subsystem=resource-adapters/resource-adapter=eis.rar/admin-objects=aoName/config-
properties=threshold:add(value=10)
Configure connection-definitions.
Add a connection definition for a managed connection factory.
/subsystem=resource-adapters/resource-adapter=eis.rar/connection-
definitions=cfName:add(class-name=com.acme.eis.ra.EISManagedConnectionFactory, jndi-
name=java:/eis/AcmeConnectionFactory)
/subsystem=resource-adapters/resource-adapter=eis.rar/connection-
definitions=cfName/config-properties=name:add(value=Acme Inc)
Configure whether to record the enlistment trace. You can enable the recording of enlistment
traces by setting the enlistment-trace attribute to true.
/subsystem=resource-adapters/resource-adapter=eis.rar/connection-
definitions=cfName:write-attribute(name=enlistment-trace,value=true)
WARNING
See Resource Adapter Attributes for all available configuration options for resource adapters.
/subsystem=resource-adapters/resource-adapter=eis.rar:activate
NOTE
271
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
NOTE
You can also define capacity policies for resource adapters. For more details, see the
Capacity Policies section.
One of them is when the server opens a resource adapter connection. As defined by the specifications,
this can be secured by container-managed sign-on, which requires propagation of a JAAS subject with
principal and credentials to the resource adapter when opening the connection. This sign-on can be
delegated to Elytron.
IronJacamar supports security inflow. This mechanism enables a resource adapter to establish security
information when submitting a work to the work manager, and when delivering messages to endpoints
residing in the same JBoss EAP instance.
Container-managed Sign-On
In order to achieve container-managed sign-on with Elytron, the elytron-enabled attribute needs to be
set to true. This will result in all connections to the resource adapter to be secured by Elytron.
/subsystem=resource-adapters/resource-adapter=RAR_NAME/connection-
definitions=FACTORY_NAME:write-attribute(name=elytron-enabled,value=true)
The elytron-enabled attribute can be configured using the management CLI by setting the elytron-
enabled attribute, in the resource-adapters subsystems, to true. By default this attribute is set to
false.
The authentication-context attribute defines the name of the Elytron authentication context that will
be used for performing sign-on.
If the authentication-context attribute is not set, JBoss EAP will use the current authentication-
context, which is the authentication-context used by the caller code that is opening the connection.
/subsystem=elytron/authentication-configuration=exampleAuthConfig:add(authentication-
name=sa,credential-reference={clear-text=sa})
/subsystem=elytron/authentication-context=exampleAuthContext:add(match-rules=[{authentication-
configuration=exampleAuthConfig}])
Security Inflow
It is also possible for the resource manager to inflow security credentials when submitting the work
which is to be executed by the work manager. Security inflow allows the work to authenticate itself
before execution. If authentication succeeds, the submitted work will be executed under the resulting
authentication context. If it fails, the work execution will be rejected.
To enable Elytron security inflow, set the wm-elytron-security-domain attribute when configuring the
272
CHAPTER 16. JAKARTA CONNECTORS MANAGEMENT
To enable Elytron security inflow, set the wm-elytron-security-domain attribute when configuring the
resource adapter work manager. Elytron will perform the authentication based on the specified domain.
NOTE
When the resource adapter work manager is configured to use the Elytron security
domain, wm-elytron-security-domain, the referenced work manager should have the
elytron-enabled attribute set to true.
/subsystem=jca/workmanager=customWM:add(name=customWM, elytron-
enabled=true)
NOTE
In the example configuration of jca subsystem below, we can see the configuration of a resource
adapter called ra-with-elytron-security-domain. This resource adapter configures work manager
security to use the Elytron security domain’s wm-realm.
<subsystem xmlns="urn:jboss:domain:jca:5.0">
<archive-validation enabled="true" fail-on-error="true" fail-on-warn="false"/>
<bean-validation enabled="true"/>
<default-workmanager>
<short-running-threads>
<core-threads count="50"/>
<queue-length count="50"/>
<max-threads count="50"/>
<keepalive-time time="10" unit="seconds"/>
</short-running-threads>
<long-running-threads>
<core-threads count="50"/>
<queue-length count="50"/>
<max-threads count="50"/>
<keepalive-time time="10" unit="seconds"/>
</long-running-threads>
</default-workmanager>
<workmanager name="customWM">
<elytron-enabled>true</elytron-enabled>
<short-running-threads>
<core-threads count="20"/>
<queue-length count="20"/>
<max-threads count="20"/>
</short-running-threads>
</workmanager>
<bootstrap-contexts>
<bootstrap-context name="customContext" workmanager="customWM"/>
</bootstrap-contexts>
<cached-connection-manager/>
</subsystem>
The work manager is then referenced using the boostrap context from the resource-adapter
subsystem.
273
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
<subsystem xmlns="urn:jboss:domain:resource-adapters:5.0">
<resource-adapters>
<resource-adapter id="ra-with-elytron-security-domain">
<archive>
ra-with-elytron-security-domain.rar
</archive>
<bootstrap-context>customContext</bootstrap-context>
<transaction-support>NoTransaction</transaction-support>
<workmanager>
<security>
<elytron-security-domain>wm-realm</elytron-security-domain>
<default-principal>wm-default-principal</default-principal>
<default-groups>
<group>
wm-default-group
</group>
</default-groups>
</security>
</workmanager>
</resource-adapter>
</resource-adapters>
</subsystem>
/subsystem=elytron/properties-realm=wm-properties-realm:add(users-properties={path=/security-
dir/users.properties, plain-text=true}, groups-properties={path=/security-dir/groups.properties})
/subsystem=elytron/simple-role-decoder=wm-role-decoder:add(attribute=groups)
/subsystem=elytron/constant-permission-mapper=wm-permission-mapper:add(permissions=[{class-
name="org.wildfly.security.auth.permission.LoginPermission"}])
/subsystem=elytron/security-domain=wm-realm:add(default-realm=wm-properties-realm, permission-
mapper=wm-permission-mapper, realms=[{role-decoder=wm-role-decoder, realm=wm-properties-
realm}])
The Work class is responsible for providing the credentials for Elytron’s authentication under the
specified domain. For that, it must implement javax.resource.spi.work.WorkContextProvider.
This interface allows the Work class to use the WorkContext to configure some aspects of the context
in which the work will be executed. One of those aspects is the security inflow. For that, the
List<WorkContext> getWorkContexts method must provide a
274
CHAPTER 16. JAKARTA CONNECTORS MANAGEMENT
You can find the instructions for deploying the IBM MQ resource adapter in Configuring Messaging for
275
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
You can find the instructions for deploying the IBM MQ resource adapter in Configuring Messaging for
JBoss EAP.
16.4.5. Deploy and Configure the Generic Jakarta Messaging Resource Adapter
You can find the instructions for configuring the generic Jakarta Messaging resource adapter in
Configuring Messaging for JBoss EAP.
org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreConcurrentLinkedQueueManagedCo
nnectionPool
This is the default connection pool in JBoss EAP 7 and provides the best out-of-the-box
performance.
org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool
This was the default connection pool in previous JBoss EAP versions.
org.jboss.jca.core.connectionmanager.pool.mcp.LeakDumperManagedConnectionPool
This connection pool is used for debugging purposes only and will report any leaks upon shutdown or
when the pool is flushed.
You can set the managed connection pool implementation for a datasource using the following
management CLI command.
/subsystem=datasources/data-source=DATA_SOURCE:write-
attribute(name=mcp,value=MCP_CLASS)
You can set the managed connection pool implementation for a resource adapter using the following
management CLI command.
/subsystem=resource-adapters/resource-adapter=RESOURCE_ADAPTER/connection-
definitions=CONNECTION_DEFINITION:write-attribute(name=mcp,value=MCP_CLASS)
You can set the managed connection pool implementation for a messaging server using the following
management CLI command.
/subsystem=messaging-activemq/server=SERVER/pooled-connection-
factory=CONNECTION_FACTORY:write-attribute(name=managed-connection-
pool,value=MCP_CLASS)
/deployment=NAME.rar/subsystem=resource-adapters/statistics=statistics/connection-
definitions=java\:\/testMe:read-resource(include-runtime=true)
NOTE
276
CHAPTER 16. JAKARTA CONNECTORS MANAGEMENT
NOTE
NOTE
/subsystem=resource-adapters/resource-adapter=RESOURCE_ADAPTER/connection-
definitions=CONNECTION_DEFINITION:flush-all-connection-in-pool
/subsystem=resource-adapters/resource-adapter=RESOURCE_ADAPTER/connection-
definitions=CONNECTION_DEFINITION:flush-gracefully-connection-in-pool
The server will wait until connections become idle before flushing them.
/subsystem=resource-adapters/resource-adapter=RESOURCE_ADAPTER/connection-
definitions=CONNECTION_DEFINITION:flush-idle-connection-in-pool
/subsystem=resource-adapters/resource-adapter=RESOURCE_ADAPTER/connection-
definitions=CONNECTION_DEFINITION:flush-invalid-connection-in-pool
277
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
IMPORTANT
In JBoss EAP 7, the undertow subsystem takes the place of the web subsystem from
JBoss EAP 6.
The undertow subsystem allows you to configure the web server and servlet container settings. It
implements the Jakarta Servlet 4.0 Specification as well as websockets. It also supports HTTP upgrade
and using high performance non-blocking handlers in servlet deployments. The undertow subsystem
also has the ability to act as a high performance reverse proxy which supports mod_cluster.
Within the undertow subsystem, there are five main components to configure:
buffer caches
server
servlet container
handlers
filters
NOTE
While JBoss EAP does offer the ability to update the configuration for each of these
components, the default configuration is suitable for most use cases and provides
reasonable performance settings.
278
CHAPTER 17. CONFIGURING THE WEB SERVER (UNDERTOW)
IMPORTANT
The undertow subsystem also relies on the io subsystem to provide XNIO workers and
buffer pools. The io subsystem is configured separately and provides a default
configuration which should give optimal performance in most cases.
NOTE
Compared to the web subsystem in JBoss EAP 6, the undertow subsystem in JBoss
EAP 7 has different default behaviors of HTTP methods .
/subsystem=undertow/application-security-domain=ApplicationDomain:add(security-
domain=ApplicationDomain)
NOTE
If the deployment was already deployed at this point, the application server
should be reloaded for the application security domain mapping to take effect.
This simple form is suitable where a deployment is using the standard HTTP mechanism as defined within
the Servlet specification like BASIC, CLIENT_CERT, DIGEST, FORM. Here, the authentication will be
performed against the ApplicationDomain security domain. This form is also suitable where an
application is not using any authentication mechanism and instead is using programmatic authentication
or is trying to obtain the SecurityDomain associated with the deployment and use it directly.
279
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
/subsystem=undertow/application-security-domain=MyAppSecurity:add(http-authentication-
factory=application-http-authentication)
You should reference an http-authentication-factory attribute when using custom HTTP authentication
mechanisms or where additional configuration must be defined for mechanisms such as principal
transformers, credential factories, and mechanism realms. It is also better to reference an http-
authentication-factory attribute when using mechanisms other than the four described in the Servlet
specification.
When the advanced form of mapping is used, another configuration option is available, override-
deployment-config. The referenced http-authentication-factory can return a complete set of
authentication mechanisms. By default, these are filtered to just match the mechanisms requested by
the application. If this option is set to true, then the mechanisms offered by the factory will override the
mechanisms requested by the application.
The application-security-domain resource also has one additional option enable-jacc. If this is set to
true, Jakarta Authorization will be enabled for any deployments matching this mapping.
Runtime Information
Where an application-security-domain mapping is in use, it can be useful to double check that
deployments did match against it as expected. If the resource is read with include-runtime=true, the
deployments that are associated with the mapping will also be shown as:
/subsystem=undertow/application-security-domain=MyAppSecurity:read-resource(include-
runtime=true)
{
"outcome" => "success",
"result" => {
"enable-jacc" => false,
"http-authentication-factory" => undefined,
"override-deployment-config" => false,
"referencing-deployments" => ["simple-webapp.war"],
"security-domain" => "ApplicationDomain",
"setting" => undefined
}
}
In this output, the referencing-deployments attribute shows that the deployment simple-webapp.war
280
CHAPTER 17. CONFIGURING THE WEB SERVER (UNDERTOW)
In this output, the referencing-deployments attribute shows that the deployment simple-webapp.war
has been deployed using the mapping.
/subsystem=undertow/buffer-cache=default/:write-attribute(name=buffer-size,value=2048)
reload
/subsystem=undertow/buffer-cache=new-buffer:add
/subsystem=undertow/buffer-cache=new-buffer:remove
reload
For a full list of the attributes available for configuring buffer caches, please see the Undertow
Subsystem Attributes section.
These buffers are used for IO operations, and the buffer size has a big impact on application
performance. For most servers, the ideal size is usually 16k.
281
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
/subsystem=undertow/byte-buffer-pool=myByteBufferPool:write-attribute(name=buffer-
size,value=1024)
reload
/subsystem=undertow/byte-buffer-pool=newByteBufferPool:add
/subsystem=undertow/byte-buffer-pool=newByteBufferPool:remove
reload
For a full list of the attributes available for configuring byte buffer pools, see the Byte Buffer Pool
Attributes reference.
host
http-listener
https-listener
ajp-listener
The host element provides a virtual host configuration, while the three listeners provide connections of
that type to the Undertow instance.
The default behavior of the server is to queue requests while the server is starting. You can change the
default behavior using the queue-requests-on-start attribute on the host. If this attribute is set to true,
which is the default, then requests that arrive when the server is starting will be held until the server is
ready. If this attribute is set to false, then requests that arrive before the server has completely started
will be rejected with the default response code.
Regardless of the attribute value, request processing does not start until the server is completely
started.
You can configure the queue-requests-on-start attribute using the management console by navigating
to Configuration → Subsystems → Web (Undertow) → Server, selecting the server and clicking View,
and selecting the Hosts tab. For a managed domain, you must specify which profile to configure.
NOTE
282
CHAPTER 17. CONFIGURING THE WEB SERVER (UNDERTOW)
NOTE
The following examples show how to configure a server using the management CLI. You can also
configure a server using the management console by navigating to Configuration → Subsystems →
Web (Undertow) → Server.
/subsystem=undertow/server=default-server:write-attribute(name=default-host,value=default-host)
reload
/subsystem=undertow/server=new-server:add
reload
Deleting a Server
To delete a server:
/subsystem=undertow/server=new-server:remove
reload
For a full list of the attributes available for configuring servers, see the Undertow Subsystem Attributes
section.
283
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Two access logging options are available: standard access logging and console access logging.
Note that the additional processing required for access logging can affect system performance.
To enable standard access logging, add the access-log setting to the host for which you want to capture
access log data. The following CLI command illustrates the configuration on the default host in the
default JBoss EAP server:
/subsystem=undertow/server=default-server/host=default-host/setting=access-log:add
NOTE
You must reload the server after enabling standard access logging.
This set of data is defined as the common pattern. Another pattern, combined, is also available. In
addition to the data logged in the common pattern, the combined pattern includes the referer and user
agent from the incoming header.
You can change the data logged using the pattern attribute. The following CLI command illustrates
updating the pattern attribute to use the combined pattern:
/subsystem=undertow/server=default-server/host=default-host/setting=access-log:write-
attribute(name=pattern,value="combined"
NOTE
You must reload the server after updating the pattern attribute.
284
CHAPTER 17. CONFIGURING THE WEB SERVER (UNDERTOW)
Pattern Description
%a Remote IP address
%A Local IP address
%H Request protocol
%m Request method
%p Local port
common %h %l %u %t "%r" %s %b
285
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Pattern Description
You can also write information from the cookie, the incoming header and response header, or the
session. The syntax is modeled after the Apache syntax:
Additional configuration options are available for this log. For more information see "access-log
Attributes" in the appendix.
Each access log record is a single line of data. You can capture this data for processing by log
aggregation systems.
To configure console access logging, add the console-access-log setting to the host for which you want
to capture access log data. The following CLI command illustrates the configuration on the default host
in the default JBoss EAP server:
/subsystem=undertow/server=default-server/host=default-host/setting=console-access-log:add
By default, the console access log record includes the following data:
dateTime The date and time that the request was processed by
the JBoss EAP server
286
CHAPTER 17. CONFIGURING THE WEB SERVER (UNDERTOW)
Default properties are always included in the log output. You can use the attributes attribute to change
the labels of the default log data, and in some cases to change the data configuration. You can also use
the attributes attribute to add additional log data to the output.
287
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
288
CHAPTER 17. CONFIGURING THE WEB SERVER (UNDERTOW)
289
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
290
CHAPTER 17. CONFIGURING THE WEB SERVER (UNDERTOW)
291
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
You can use the metadata attribute to configure additional arbitrary data to include in the access log
record. The value of the metadata attribute is a set of key:value pairs that defines the data to include in
the access log record. The value in a pair can be a management model expression. Management model
expressions are resolved when the server is started or reloaded. Key-value pairs are comma-separated.
The following CLI command demonstrates an example of a complex console log configuration, including
additional log data, customization of log data, and additional metadata:
/subsystem=undertow/server=default-server/host=default-host/setting=console-access-
log:add(metadata={"@version"="1", "qualifiedHostName"=${jboss.qualified.host.name:unknown}},
attributes={bytes-sent={}, date-time={key="@timestamp", date-format="yyyy-MM-
dd'T'HH:mm:ssSSS"}, remote-host={}, request-line={}, response-header={key-
prefix="responseHeader", names=["Content-Type"]}, response-code={}, remote-user={}})
The resulting access log record would resemble the following additional JSON data (Note: the example
output below is formatted for readability; in an actual record, all data would be output as a single line):
{
"eventSource":"web-access",
"hostName":"default-host",
"@version":"1",
"qualifiedHostName":"localhost.localdomain",
"bytesSent":1504,
"@timestamp":"2019-05-02T11:57:37123",
"remoteHost":"127.0.0.1",
"remoteUser":null,
"requestLine":"GET / HTTP/2.0",
"responseCode":200,
"responseHeaderContent-Type":"text/html"
}
The following command illustrates updates to the log data after activating the console access log:
/subsystem=undertow/server=default-server/host=default-host/setting=console-access-log:write-
292
CHAPTER 17. CONFIGURING THE WEB SERVER (UNDERTOW)
The following command illustrates updates to the custom metadata after activating the console access
log:
/subsystem=undertow/server=default-server/host=default-host/setting=console-access-log:write-
attribute(name=metadata,value={"@version"="1",
"qualifiedHostName"=${jboss.qualified.host.name:unknown}}
NOTE
<subsystem xmlns="urn:jboss:domain:undertow:10.0">
<buffer-cache name="default"/>
<server name="default-server">
...
</server>
<servlet-container name="default">
<jsp-config/>
<websockets/>
</servlet-container>
...
</subsystem>
The following examples show how to configure a servlet container using the management CLI. You can
also configure a servlet container using the management console by navigating to Configuration →
Subsystems → Web (Undertow) → Servlet Container.
/subsystem=undertow/servlet-container=default:write-attribute(name=ignore-flush,value=true)
reload
293
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
/subsystem=undertow/servlet-container=new-servlet-container:add
reload
/subsystem=undertow/servlet-container=new-servlet-container:remove
reload
For a full list of the attributes available for configuring servlet containers, see the Undertow Subsystem
Attributes section.
An Undertow DeploymentInfo structure, which contains a complete and mutable description of the
deployment, is passed to this method. You can modify this structure to change any aspect of the
deployment.
The DeploymentInfo structure is the same structure that is used by the embedded API, so in effect a
ServletExtension has the same amount of flexibility that you have when using Undertow in embedded
mode.
file handlers
reverse-proxy handlers
File handlers serve static files. Each file handler must be attached to a location in a virtual host. Reverse-
proxy handlers allow JBoss EAP to serve as a high performance reverse-proxy.
294
CHAPTER 17. CONFIGURING THE WEB SERVER (UNDERTOW)
<server name="default-server">
...
</server>
<servlet-container name="default">
...
</servlet-container>
<handlers>
<file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
</handlers>
</subsystem>
/subsystem=undertow/configuration=handler/file=welcome-content:write-attribute(name=case-
sensitive,value=true)
reload
/subsystem=undertow/configuration=handler/file=new-file-
handler:add(path="${jboss.home.dir}/welcome-content")
WARNING
If you set a file handler’s path directly to a file instead of a directory, any location
elements that reference that file handler must not end with a forward slash (/).
Otherwise, the server will return a 404 - Not Found response.
/subsystem=undertow/configuration=handler/file=new-file-handler:remove
reload
For a full list of the attributes available for configuring handlers, see the Undertow Subsystem Attributes
section.
295
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
NOTE
custom-filter
error-page
expression-filter
gzip
mod-cluster
request-limit
response-header
rewrite
The following examples show how to configure a filter using the management CLI. You can also
configure a filter using the management console by navigating to Configuration → Subsystems → Web
(Undertow) → Filters.
/subsystem=undertow/configuration=filter/response-header=myHeader:write-attribute(name=header-
value,value="JBoss-EAP")
reload
/subsystem=undertow/configuration=filter/response-header=new-response-header:add(header-
name=new-response-header,header-value="My Value")
Deleting a Filter
To delete a filter:
/subsystem=undertow/configuration=filter/response-header=new-response-header:remove
reload
For a full list of the attributes available for configuring filters, see the Undertow Subsystem Attributes
296
CHAPTER 17. CONFIGURING THE WEB SERVER (UNDERTOW)
For a full list of the attributes available for configuring filters, see the Undertow Subsystem Attributes
section.
The delay caused in sending the header and the body of the request can be corrected using the buffer-
request handler. The buffer-request handler attempts to consume the request from a non-blocking IO
thread before allocating it to a worker thread. When no buffer-request handler is added, the thread
allocation to the worker thread happens directly. However, when the buffer-request handler is added,
the handler attempts to read the amount of data that it can buffer in a non-blocking manner using the
IO thread before allocating it to the worker thread.
You can use the following management CLI commands to configure the buffer-request handler:
/subsystem=undertow/configuration=filter/expression-filter=buf:add(expression="buffer-
request(buffers=1)")
/subsystem=undertow/server=default-server/host=default-host/filter-ref=buf:add
There is a limit to the size of the buffer requests that can be processed. This limit is determined by a
combination of the buffer size and the total number of buffers, as shown in the equation below.
Total_size is the size of data that will be buffered before the request is dispatched to a worker
thread.
num_buffers is the number of buffers. The number of buffers is set by the buffers parameter
on the handler.
buffer_size is the size of each buffer. The buffer size is set in the io subsystem, and is 16KB by
default per request.
WARNING
Avoid configuring very large buffer requests, or else you might run out of memory.
There is a default server preconfigured in Undertow that serves up the welcome content.
297
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
The default server, default-server, has a default host, default-host, configured. The default host is
configured to handle requests to the server’s root, using the <location> element, with the welcome-
content file handler. The welcome-content handler serves up the content in the location specified in
the path property.
This default Welcome application can be replaced with your own web application. This can be
configured in one of two ways:
1. Modify the existing welcome-content file handler’s path to point to the new deployment.
/subsystem=undertow/configuration=handler/file=welcome-content:write-
attribute(name=path,value="/path/to/content")
NOTE
Alternatively, you could create a different file handler to be used by the server’s
root.
/subsystem=undertow/configuration=handler/file=NEW_FILE_HANDLER:add(
path="/path/to/content")
/subsystem=undertow/server=default-server/host=default-
host/location=\/:write-attribute(name=handler,value=NEW_FILE_HANDLER)
reload
298
CHAPTER 17. CONFIGURING THE WEB SERVER (UNDERTOW)
/subsystem=undertow/server=default-server/host=default-host:write-attribute(name=default-
web-module,value=hello.war)
reload
1. Disable the welcome application by removing the location entry / for the default-host.
/subsystem=undertow/server=default-server/host=default-host/location=\/:remove
reload
For information on configuring HTTPS for use with the JBoss EAP management interfaces, see How to
Secure the Management Interfaces in How to Configure Server Security .
The HTTP session timeout is configured in an application’s web.xml file, but a default HTTP session
timeout can be specified within JBoss EAP. The server’s timeout value will apply to all deployed
applications, but an application’s web.xml will override the server’s value.
The server value is specified in the default-session-timeout property which is found in the servlet-
container section of the undertow subsystem. The value of default-session-timeout is specified in
minutes and the default is 30.
/subsystem=undertow/servlet-container=default:write-attribute(name=default-session-timeout,
value=60)
reload
299
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
IMPORTANT
Using the HttpOnly header does not actually prevent cross-site scripting attacks by itself,
it merely notifies the browser. The browser must also support HttpOnly for this behavior
to take affect.
IMPORTANT
Using the http-only attribute only applies the restriction to session management cookies
and not other browser cookies.
/subsystem=undertow/servlet-container=default/setting=session-cookie:add
/subsystem=undertow/servlet-container=default/setting=session-cookie:write-attribute(name=http-
only,value=true)
reload
/subsystem=undertow/server=default-server/host=default-host/setting=single-sign-on:add
/subsystem=undertow/server=default-server/host=default-host/setting=single-sign-on:write-
attribute(name=http-only,value=true)
reload
Undertow allows for the use of the HTTP/2 standard, which reduces latency by compressing headers
300
CHAPTER 17. CONFIGURING THE WEB SERVER (UNDERTOW)
Undertow allows for the use of the HTTP/2 standard, which reduces latency by compressing headers
and multiplexing many streams over the same TCP connection. It also provides the ability for a server to
push resources to the client before it has requested them, leading to faster page loads.
Be aware that HTTP/2 only works with clients and browsers that also support the HTTP/2 standard.
IMPORTANT
Most modern browsers enforce HTTP/2 over a secured TLS connection, known as h2 and
may not support HTTP/2 over plain HTTP, known as h2c. It is still possible to configure
JBoss EAP to use HTTP/2 with h2c, in other words, without using HTTPS and only using
plain HTTP with HTTP upgrade. In that case, you can simply enable HTTP/2 in the HTTP
listener Undertow:
/subsystem=undertow/server=default-server/http-listener=default:write-
attribute(name=enable-http2,value=true)
To configure Undertow to use HTTP/2, enable the HTTPS listener in Undertow to use HTTP/2 by
setting the enable-http2 attribute to true:
/subsystem=undertow/server=default-server/https-listener=https:write-attribute(name=enable-
http2,value=true)
For more information on the HTTPS listener and configuring Undertow to use HTTPS for web
applications, see Configure One-way and Two-way SSL/TLS for Applications in How to Configure
Server Security.
NOTE
In order to utilize HTTP/2 with the elytron subsystem, you will need to ensure that the
configured ssl-context in the https-listener of the Undertow is configured as modifiable.
This can be achieved by setting the wrap attribute of the appropriate server-ssl-context
to false. By default, the wrap attribute is set to false. This is required by Undertow to
make modifications in the ssl-context about the ALPN. If the provided ssl-context is not
writable, ALPN cannot be used and the connection falls back to HTTP/1.1.
When using Java 8, the ALPN implementation is introduced directly into JBoss EAP with
dependencies on Java internals. Therefore, this ALPN implementation only works with Oracle
and OpenJDK. It does not work with IBM Java. Red Hat strongly recommends that you utilize
ALPN TLS protocol extension support from the OpenSSL provider in JBoss EAP, with OpenSSL
libraries that implement ALPN capability. Using the ALPN TLS protocol extension support from
the OpenSSL provider should result in better performance.
As of Java 9, the JDK supports ALPN natively; however, using the ALPN TLS protocol
extension support from the OpenSSL provider should also result in better performance when
using Java 9 or later.
Instructions for installing OpenSSL, to obtain the ALPN TLS protocol extension support, are available in
Install OpenSSL from JBoss Core Services . The standard system OpenSSL is supported on Red Hat
Enterprise Linux 8 and no additional JBoss Core Services OpenSSL is required.
301
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Once OpenSSL has been installed, follow the instructions in Configure JBoss EAP to Use OpenSSL .
IMPORTANT
While this handler can be useful for debugging, it may also log sensitive information.
Please keep this in mind when enabling this handler.
NOTE
You can configure a RequestDumping handler at either at the server level directly in JBoss EAP or
within an individual application.
/subsystem=undertow/configuration=filter/expression-
filter=requestDumperExpression:add(expression="dump-request")
/subsystem=undertow/server=default-server/host=default-host/filter-
ref=requestDumperExpression:add
IMPORTANT
All requests and corresponding responses handled by the Undertow web server will be
logged when enabling the RequestDumping handler as a expression filter in this manner.
302
CHAPTER 17. CONFIGURING THE WEB SERVER (UNDERTOW)
Example: WEB-INF/undertow-handlers.conf
dump-request
Example: WEB-INF/undertow-handlers.conf
NOTE
You can secure the connection by configuring a listener or by using HTTPS. You configure the secure-
cookie handler by defining an expression-filter in the undertow subsystem. For more information, see
Configuring Filters.
When the secure-cookie handler is in use, cookies that are set over a secure connection will be implicitly
set as secure and will never be sent over an unsecure connection.
303
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
JBoss Remoting includes the following configurable elements: the endpoint, connectors, and a series of
local and remote connection URIs. Most people will not need to configure the remoting subsystem at
all, unless they use custom connectors for their own applications. Applications that act as remoting
clients, such as Jakarta Enterprise Beans, need separate configuration to connect to a specific
connector.
<subsystem xmlns="urn:jboss:domain:remoting:4.0">
<endpoint/>
<http-connector name="http-remoting-connector" connector-ref="default" security-
realm="ApplicationRealm"/>
</subsystem>
See Remoting Subsystem Attributes for a full list of the attributes available for the remoting
subsystem.
See Configuring the Endpoint for details on how to configure the remoting endpoint.
Connector
The connector is the main remoting configuration element. Multiple connectors are allowed. Each
connector consists of a <connector> element with several sub-elements, and few other attributes. The
default connector is used by several JBoss EAP subsystems. Specific settings for the elements and
attributes of your custom connectors depend on your applications. Contact Red Hat Global Support
Services for more information.
Outbound Connections
You can specify three different types of outbound connections:
A remote outbound connection , which connects to a remote resource and authenticates using a
security realm
Additional Configuration
Remoting depends on several elements that are configured outside of the remoting subsystem, such as
the network interface and IO worker.
304
CHAPTER 18. CONFIGURING REMOTING
IMPORTANT
In JBoss EAP 6, the worker thread pool was configured directly in the remoting
subsystem. In JBoss EAP 7, the remoting endpoint configuration references a worker
from the io subsystem.
<subsystem xmlns="urn:jboss:domain:remoting:4.0">
<endpoint/>
...
</subsystem>
/subsystem=remoting/configuration=endpoint:write-attribute(name=authentication-retries,value=2)
reload
/subsystem=remoting/configuration=endpoint:add
/subsystem=remoting/configuration=endpoint:remove
reload
See Endpoint Attributes for a full list of the attributes available for the endpoint configuration.
/subsystem=remoting/connector=new-connector:write-attribute(name=socket-binding,value=my-
socket-binding)
reload
/subsystem=remoting/connector=new-connector:add(socket-binding=my-socket-binding)
Deleting a Connector
305
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
/subsystem=remoting/connector=new-connector:remove
reload
For a full list of the attributes available for configuring a connector, please see the Remoting Subsystem
Attributes section.
<subsystem xmlns="urn:jboss:domain:remoting:4.0">
...
<http-connector name="http-remoting-connector" connector-ref="default" security-
realm="ApplicationRealm"/>
</subsystem>
By default, this HTTP connector connects to an HTTP listener named default that is configured in the
undertow subsystem. For more information, see Configuring the Web Server (Undertow).
/subsystem=remoting/http-connector=new-connector:write-attribute(name=connector-ref,value=new-
connector-ref)
reload
/subsystem=remoting/http-connector=new-connector:add(connector-ref=default)
/subsystem=remoting/http-connector=new-connector:remove
See Connector Attributes for a full list of the attributes available for configuring an HTTP connector.
/subsystem=remoting/outbound-connection=new-outbound-connection:write-
attribute(name=uri,value=http://example.com)
/subsystem=remoting/outbound-connection=new-outbound-connection:add(uri=http://example.com)
306
CHAPTER 18. CONFIGURING REMOTING
/subsystem=remoting/outbound-connection=new-outbound-connection:remove
See Outbound Connection Attributes for a full list of the attributes available for configuring an
outbound connection.
/subsystem=remoting/remote-outbound-connection=new-remote-outbound-connection:write-
attribute(name=outbound-socket-binding-ref,value=outbound-socket-binding)
/subsystem=remoting/remote-outbound-connection=new-remote-outbound-connection:add(outbound-
socket-binding-ref=outbound-socket-binding)
/subsystem=remoting/remote-outbound-connection=new-remote-outbound-connection:remove
See Remote Outbound Connection Attributes for a full list of the attributes available for configuring a
remote outbound connection.
/subsystem=remoting/local-outbound-connection=new-local-outbound-connection:write-
attribute(name=outbound-socket-binding-ref,value=outbound-socket-binding)
/subsystem=remoting/local-outbound-connection=new-local-outbound-connection:add(outbound-
socket-binding-ref=outbound-socket-binding)
/subsystem=remoting/local-outbound-connection=new-local-outbound-connection:remove
See Local Outbound Connection Attributes for a full list of the attributes available for configuring a
local outbound connection.
307
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
IO worker
Use the following command to set the IO worker for remoting:
/subsystem=remoting/configuration=endpoint:write-attribute(name=worker,
value=WORKER_NAME)
Network interface
The network interface used by the remoting subsystem is the public interface. This interface is also
used by several other subsystems, so exercise caution when modifying it.
<interfaces>
<interface name="management">
<inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
</interface>
<interface name="public">
<inet-address value="${jboss.bind.address:127.0.0.1}"/>
</interface>
<interface name="unsecure">
<inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/>
</interface>
</interfaces>
In a managed domain, the public interface is defined per host in its host.xml file.
Socket binding
The default socket binding used by the remoting subsystem binds to port 8080.
For more information about socket binding and socket binding groups, see Socket Bindings.
308
CHAPTER 18. CONFIGURING REMOTING
WARNING
STARTTLS works by activating a secure connection if the client requests it, and
otherwise defaults to an unsecured connection. It is inherently susceptible to a
man-in-the-middle exploit, where an attacker intercepts the request of the client
and modifies it to request an unsecured connection. Clients must be written to
fail appropriately if they do not receive a secure connection, unless an unsecured
connection is an appropriate fall-back.
309
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
<subsystem xmlns="urn:jboss:domain:io:3.0">
<worker name="default"/>
<buffer-pool name="default"/>
</subsystem>
/subsystem=io/worker=default:write-attribute(name=io-threads,value=10)
reload
/subsystem=io/worker=newWorker:add
Deleting a Worker
To delete a worker:
/subsystem=io/worker=newWorker:remove
reload
For a full list of the attributes available for configuring workers, please see the IO Subsystem Attributes
section.
NOTE
310
CHAPTER 19. CONFIGURING THE IO SUBSYSTEM
NOTE
IO buffer pools are deprecated, but they are still set as the default in the current release.
Buffer pools are pooled NIO buffer instances. Changing the buffer size has a big impact
on application performance. For most servers, the ideal buffer size is usually 16k. For
more information about configuring Undertow byte buffer pools, see the Configuring
Byte Buffer Pools section of the Configuration Guide for JBoss EAP.
/subsystem=io/buffer-pool=default:write-attribute(name=direct-buffers,value=true)
reload
/subsystem=io/buffer-pool=newBuffer:add
/subsystem=io/buffer-pool=newBuffer:remove
reload
For a full list of the attributes available for configuring buffer pools, please see the IO Subsystem
Attributes section.
311
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
For more information, see Configuring the Web Services Subsystem in Developing Web Services
Applications for JBoss EAP.
312
CHAPTER 21. JAKARTA SERVER FACES CONFIGURATION
1. Create the appropriate directory structure in the EAP_HOME/modules/ directory for the
Jakarta Server Faces implementation:
$ cd EAP_HOME/modules/
$ mkdir -p com/sun/jsf-impl/IMPL_NAME-VERSION
NOTE
2. Copy the Jakarta Server Faces implementation JAR file to the IMPL_NAME-VERSION/
subdirectory.
1. Create the appropriate directory structure in the EAP_HOME/modules/ directory for the
Jakarta Server Faces implementation:
$ cd EAP_HOME/modules/
$ mkdir -p javax/faces/api/IMPL_NAME-VERSION
2. Copy the Jakarta Server Faces API JAR file to the IMPL_NAME-VERSION/ subdirectory.
1. Create the appropriate directory structure in the EAP_HOME/modules/ directory for the
Jakarta Server Faces implementation:
$ cd EAP_HOME/modules/
$ mkdir -p org/jboss/as/jsf-injection/IMPL_NAME-VERSION
2. Follow the instructions outlined in the Patching and Upgrading guide to download the latest
cumulative patch for your JBoss EAP instance. Next, complete either of the following steps:
If you have not applied the patch updates to the server, then copy the wildfly-jsf-injection
and weld-core-jsf JAR files from
EAP_HOME/modules/system/layers/base/org/jboss/as/jsf-injection/main/ to the
IMPL_NAME-VERSION/ subdirectory.
If you have applied the patch updates to the server, then copy the wildfly-jsf-injection and
weld-core-jsf JAR files from the latest patch updates directory to the
IMPL_NAME-VERSION/ subdirectory. For example,
EAP_HOME/modules/system/layers/base/.overlays/layer-base-jboss-eap-
7.4.z.CP/org/jboss/as/jsf-injection, where z is the latest version number.
1. Create the appropriate directory structure in the EAP_HOME/modules/ directory for the
commons-digester JAR:
$ cd EAP_HOME/modules/
$ mkdir -p org/apache/commons/digester/main
2. Download the commons-digester JAR file and copy it to the main/ subdirectory.
3. In the main/ subdirectory, create a module.xml file similar to this template. If you use the
template, be sure to use appropriate values for the replaceable variables noted.
1. Run the following management CLI command to set the new Jakarta Server Faces
implementation as the default implementation:
/subsystem=jsf:write-attribute(name=default-jsf-impl-slot,value=IMPL_NAME-VERSION)
2. Restart the JBoss EAP server for the changes to take effect.
314
CHAPTER 21. JAKARTA SERVER FACES CONFIGURATION
Multi-Jakarta Server Faces allows the installation of multiple Jakarta Server Faces implementations and
versions on the same JBoss EAP server. The goal is to allow the use of any of the Jakarta Server Faces
implementations, MyFaces or Mojarra, and any version of those implementations from Faces 2.1 and
beyond, and Jakarta Server Faces 2.3 and beyond. Multi-Jakarta Server Faces provides an
implementation that is fully integrated with the container, which allows more efficient annotation
processing, lifecycle handling, and other integration advantages.
The way multi-Jakarta Server Faces works is that for each Jakarta Server Faces version, a new slot is
created in the modules path under com.sun.jsf-impl, javax.faces.api, and org.jboss.as.jsf-injection.
When the jsf subsystem is started, it scans the module path to find all the installed Jakarta Server Faces
implementations. When the jsf subsystem deploys a web application containing the specified context
parameter, it adds the slotted modules to the deployment.
For example, to indicate that the Jakarta Server Faces application should use MyFaces 2.2.12, assuming
MyFaces 2.2.12 has been installed on the server, the following context parameter must be added:
<context-param>
<param-name>org.jboss.jbossfaces.JSF_CONFIG_NAME</param-name>
<param-value>myfaces-2.2.12</param-value>
</context-param>
The multi-Jakarta Server Faces feature includes the default-jsf-impl-slot attribute in the jsf
subsystem. This attribute allows you to change the default Jakarta Server Faces implementation, as
described in the following procedure:
1. Use the write-attribute command to set the value of the default-jsf-impl-slot attribute to one
of the active Jakarta Server Faces implementations:
/subsystem=jsf:write-attribute(name=default-jsf-impl-slot,value=JSF_IMPLEMENTATION)
2. Restart the JBoss EAP server for the change to take effect.
reload
To see which Jakarta Server Faces implementations are installed, you can execute the list-active-jsf-
impls operation.
/subsystem=jsf:list-active-jsf-impls
{
"outcome" => "success",
"result" => [
"myfaces-2.1.12",
"mojarra-2.2.0-m05",
"main"
]
}
You can use the following management CLI commands to disallow DOCTYPE declarations in Jakarta
315
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
You can use the following management CLI commands to disallow DOCTYPE declarations in Jakarta
Server Faces deployments:
/subsystem=jsf:write-attribute(name=disallow-doctype-decl,value=true)
reload
You can override this setting for a particular Jakarta Server Faces deployment by adding the
com.sun.faces.disallowDoctypeDecl context parameter to the deployment’s web.xml file:
<context-param>
<param-name>com.sun.faces.disallowDoctypeDecl</param-name>
<param-value>false</param-value>
</context-param>
316
CHAPTER 22. CONFIGURING BATCH APPLICATIONS
For information on developing batch applications, see Jakarta Batch Application Development in the
JBoss EAP Development Guide.
The default batch-jberet subsystem configuration defines an in-memory job repository and default
thread pool settings.
<subsystem xmlns="urn:jboss:domain:batch-jberet:2.0">
<default-job-repository name="in-memory"/>
<default-thread-pool name="batch"/>
<job-repository name="in-memory">
<in-memory/>
</job-repository>
<thread-pool name="batch">
<max-threads count="10"/>
<keepalive-time time="30" unit="seconds"/>
</thread-pool>
</subsystem>
By default, any batch jobs stopped during a server suspend will be restarted upon server resume. You
can set the restart-jobs-on-resume property to false to leave jobs in the STOPPED state instead.
/subsystem=batch-jberet:write-attribute(name=restart-jobs-on-resume,value=false)
You can also configure the settings for batch job repositories and thread pools.
/subsystem=batch-jberet/in-memory-job-repository=REPOSITORY_NAME:add
/subsystem=batch-jberet/jdbc-job-repository=REPOSITORY_NAME:add(data-
source=DATASOURCE)
317
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
/subsystem=batch-jberet:write-attribute(name=default-job-repository,value=REPOSITORY_NAME)
reload
/subsystem=batch-jberet/thread-pool=THREAD_POOL_NAME:add(max-threads=10)
/subsystem=batch-jberet/thread-pool=THREAD_POOL_NAME:write-
attribute(name=keepalive-time,value={time=60,unit=SECONDS})
/subsystem=batch-jberet/thread-factory=THREAD_FACTORY_NAME:add
group-name - The name of a thread group to create for this thread factory.
thread-name-pattern - The template used to create names for threads. The following
patterns may be used:
%% - A percent sign
%i - The thread ID
318
CHAPTER 22. CONFIGURING BATCH APPLICATIONS
/subsystem=batch-jberet/thread-pool=THREAD_POOL_NAME:write-attribute(name=thread-
factory,value=THREAD_FACTORY_NAME)
reload
/subsystem=batch-jberet:write-attribute(name=default-thread-pool,value=THREAD_POOL_NAME)
reload
/subsystem=batch-jberet/thread-pool=THREAD_POOL_NAME:read-resource(include-runtime=true)
{
"outcome" => "success",
"result" => {
"active-count" => 0,
"completed-task-count" => 0L,
"current-thread-count" => 0,
"keepalive-time" => undefined,
"largest-thread-count" => 0,
"max-threads" => 15,
"name" => "THREAD_POOL_NAME",
"queue-size" => 0,
"rejected-count" => 0,
"task-count" => 0L,
"thread-factory" => "THREAD_FACTORY_NAME"
}
}
You can also view runtime information for batch thread pools using the management console by
navigating to the Batch subsystem from the Runtime tab.
319
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
/deployment=DEPLOYMENT_NAME/subsystem=batch-jberet:restart-job(execution-
id=EXECUTION_ID,properties={PROPERTY=VALUE})
The execution ID must be the most recent execution of the job instance.
/deployment=DEPLOYMENT_NAME/subsystem=batch-jberet:start-job(job-xml-
name=JOB_XML_NAME,properties={PROPERTY=VALUE})
/deployment=DEPLOYMENT_NAME/subsystem=batch-jberet:stop-job(execution-
id=EXECUTION_ID)
/deployment=DEPLOYMENT_NAME/subsystem=batch-jberet:read-resource(recursive=true,include-
runtime=true)
{
"outcome" => "success",
"result" => {"job" => {"import-file" => {
"instance-count" => 2,
"running-executions" => 0,
"execution" => {
"2" => {
"batch-status" => "COMPLETED",
"create-time" => "2016-04-11T22:03:12.708-0400",
"end-time" => "2016-04-11T22:03:12.718-0400",
"exit-status" => "COMPLETED",
"instance-id" => 58L,
"last-updated-time" => "2016-04-11T22:03:12.719-0400",
"start-time" => "2016-04-11T22:03:12.708-0400"
},
"1" => {
"batch-status" => "FAILED",
"create-time" => "2016-04-11T21:57:17.567-0400",
"end-time" => "2016-04-11T21:57:17.596-0400",
"exit-status" => "Error : org.hibernate.exception.ConstraintViolationException: could not
execute statement",
"instance-id" => 15L,
"last-updated-time" => "2016-04-11T21:57:17.597-0400",
"start-time" => "2016-04-11T21:57:17.567-0400"
}
}
}}}
}
320
CHAPTER 22. CONFIGURING BATCH APPLICATIONS
To manage batch jobs from the management console, navigate to the Runtime tab, select the server,
select Batch (JBeret), and choose the job from the list.
Use the following management CLI command to update the security-domain attribute to configure
security for batch jobs.
/subsystem=batch-jberet:write-attribute(name=security-domain, value=ExampleDomain)
reload
NOTE
321
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
The following is an example of the naming subsystem XML configuration example with all of the
elements and attributes specified.
<subsystem xmlns="urn:jboss:domain:naming:2.0">
<bindings>
<simple name="java:global/simple-integer-binding" value="100" type="int" />
<simple name="java:global/jboss.org/docs/url" value="https://docs.jboss.org"
type="java.net.URL" />
<object-factory name="java:global/foo/bar/factory" module="org.foo.bar"
class="org.foo.bar.ObjectFactory" />
<external-context name="java:global/federation/ldap/example"
class="javax.naming.directory.InitialDirContext" cache="true">
<environment>
<property name="java.naming.factory.initial" value="com.sun.jndi.ldap.LdapCtxFactory" />
<property name="java.naming.provider.url" value="ldap://ldap.example.com:389" />
<property name="java.naming.security.authentication" value="simple" />
<property name="java.naming.security.principal" value="uid=admin,ou=system" />
<property name="java.naming.security.credentials" value="secret" />
</environment>
</external-context>
<lookup name="java:global/new-alias-name" lookup="java:global/original-name" />
</bindings>
<remote-naming/>
</subsystem>
Global bindings are configured in the <bindings> element of the naming subsystem. Four types of
bindings are supported:
simple bindings
The name attribute is mandatory and specifies the target JNDI name for the entry.
322
CHAPTER 23. CONFIGURING THE NAMING SUBSYSTEM
The optional type attribute, which defaults to java.lang.String, specifies the type of the entry’s
value. In addition to java.lang.String, you can specify primitive types and their corresponding
object wrapper classes, such as int or java.lang.Integer, and java.net.URL.
The following is an example of a management CLI command that creates a simple binding.
/subsystem=naming/binding=java\:global\/simple-integer-binding:add(binding-type=simple, type=int,
value=100)
<subsystem xmlns="urn:jboss:domain:naming:2.0">
<bindings>
<simple name="java:global/simple-integer-binding" value="100" type="int"/>
</bindings>
<remote-naming/>
</subsystem>
/subsystem=naming/binding=java\:global\/simple-integer-binding:remove
The name attribute is mandatory and specifies the target JNDI name for the entry.
The class attribute is mandatory and defines the object factory’s Java type.
The module attribute is mandatory and specifies the JBoss Module ID where the object factory
Java class can be loaded from.
The optional environment child element can be used to provide a custom environment to the
object factory.
The following is an example of a management CLI command that creates an object factory binding.
/subsystem=naming/binding=java\:global\/foo\/bar\/factory:add(binding-type=object-factory,
module=org.foo.bar, class=org.foo.bar.ObjectFactory, environment=[p1=v1, p2=v2])
<subsystem xmlns="urn:jboss:domain:naming:2.0">
<bindings>
<object-factory name="java:global/foo/bar/factory" module="org.foo.bar"
class="org.foo.bar.ObjectFactory">
<environment>
<property name="p1" value="v1" />
<property name="p2" value="v2" />
</environment>
323
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
</object-factory>
</bindings>
</subsystem>
/subsystem=naming/binding=java\:global\/foo\/bar\/factory:remove
The name attribute is mandatory and specifies the target JNDI name for the entry.
The class attribute is mandatory and indicates the Java initial naming context type used to
create the federated context. Note that such type must have a constructor with a single
environment map argument.
The optional module attribute specifies the JBoss Module ID where any classes required by the
external JNDI context can be loaded from.
The optional cache attribute, which defaults to false, indicates whether the external context
instance should be cached.
The optional environment child element can be used to provide the custom environment
needed to look up the external context.
The following is an example of a management CLI command that creates an external context binding.
/subsystem=naming/binding=java\:global\/federation\/ldap\/example:add(binding-type=external-
context, cache=true, class=javax.naming.directory.InitialDirContext, module=org.jboss.as.naming,
environment=[java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory,
java.naming.provider.url="ldap://ldap.example.com:389", java.naming.security.authentication=simple,
java.naming.security.principal="uid=admin,ou=system", java.naming.security.credentials=secret])
<subsystem xmlns="urn:jboss:domain:naming:2.0">
<bindings>
<external-context name="java:global/federation/ldap/example" module="org.jboss.as.naming"
class="javax.naming.directory.InitialDirContext" cache="true">
<environment>
<property name="java.naming.factory.initial" value="com.sun.jndi.ldap.LdapCtxFactory"/>
<property name="java.naming.provider.url" value="ldap://ldap.example.com:389"/>
<property name="java.naming.security.authentication" value="simple"/>
<property name="java.naming.security.principal" value="uid=admin,ou=system"/>
<property name="java.naming.security.credentials" value="secret"/>
</environment>
</external-context>
</bindings>
</subsystem>
324
CHAPTER 23. CONFIGURING THE NAMING SUBSYSTEM
/subsystem=naming/binding=java\:global\/federation\/ldap\/example:remove
NOTE
Resource look up for JNDI providers that do not properly implement the lookup(Name)
method can result in a "javax.naming.InvalidNameException: Only support
CompoundName names" error.
You might be able to work around this issue by specifying that the external context
environment use the lookup(String) method instead by adding the following property;
however, this can result in a performance degradation.
The name attribute is mandatory and specifies the target JNDI name for the entry.
The lookup attribute is mandatory and indicates the source JNDI name.
The following is an example of a management CLI command that binds an existing entry to an alias.
/subsystem=naming/binding=java\:global\/new-alias-name:add(binding-type=lookup,
lookup=java\:global\/original-name)
/subsystem=naming/binding=java\:global\/c:remove
To update a JNDI binding, use the rebind operation. The rebind operation takes the same arguments
as the add operation. This command works for all binding types except for external-context binding
types. External context bindings require additional dependencies, which affect the Modular Service
Container (MSC) state, so they cannot be restarted without restarting services.
The following command dynamically changes the JNDI binding that was defined in the Configuring
Simple Bindings example.
/subsystem=naming/binding=java\:global\/simple-integer-binding:rebind(binding-type=simple,
type=int, value=200)
For more information about how to configure global bindings in the naming subsystem, see Configuring
325
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
For more information about how to configure global bindings in the naming subsystem, see Configuring
Global Bindings.
Use the following management CLI command to activate or reactivate the remote JNDI interface.
/subsystem=naming/service=remote-naming:add
Use the following management CLI command to deactivate the remote JNDI interface.
/subsystem=naming/service=remote-naming:remove
NOTE
Only entries within the java:jboss/exported context are accessible over remote JNDI.
326
CHAPTER 24. CONFIGURING HIGH AVAILABILITY
Load balancing
This allows a service to handle a large number of requests by spreading the workload across multiple
servers. A client can have timely responses from the service even in the event of a high volume of
requests.
Failover
This allows a client to have uninterrupted access to a service even in the event of hardware or
network failures. If the service fails, another cluster member takes over the client’s requests so that it
can continue processing.
Clustering is a term that encompasses all of these capabilities. Members of a cluster can be configured
to share workloads, referred to as load balancing, and pick up client processing in the event of a failure
of another cluster member, referred to as failover.
NOTE
It is important to keep in mind that the JBoss EAP operating mode chosen, either
standalone server or managed domain, pertains to how you want to manage your servers.
High availability services can be configured in JBoss EAP regardless of its operating
mode.
JBoss EAP supports high availability at several different levels using various components. Some of
those components of the runtime and your applications that can be made highly-available are:
Web applications, when used in conjunction with the internal JBoss Web Server, Apache HTTP
Server, Microsoft IIS, or Oracle iPlanet Web Server
HTTP sessions
Singleton deployments
Clustering is made available to JBoss EAP by the jgroups, infinispan, and modcluster subsystems. The
ha and full-ha profiles have these systems enabled. In JBoss EAP, these services start up and shut down
on demand, but they will only start up if an application configured as distributable is deployed on the
servers.
See the JBoss EAP Development Guide for how to mark an application as distributable .
327
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
The jgroups subsystem provides group communication support for high availability services in JBoss
EAP. It allows you to configure named channels and protocol stacks as well as view runtime statistics for
channels. The jgroups subsystem is available when using a configuration that provides high availability
capabilities, such as the ha or full-ha profile in a managed domain, or the standalone-ha.xml or
standalone-full-ha.xml configuration file for a standalone server.
udp
The nodes in the cluster use User Datagram Protocol (UDP) multicasting to communicate with each
other. This is the default stack.
tcp
The nodes in the cluster use Transmission Control Protocol (TCP) to communicate with each other.
NOTE
TCP has more overhead and is often considered slower than UDP since it handles error
checking, packet ordering, and congestion control itself. JGroups handles these features
for UDP, whereas TCP guarantees them itself. TCP is a good choice when using JGroups
on unreliable or high congestion networks, or when multicast is not available.
You can use the preconfigured stacks or define your own to suit your system’s specific requirements.
For additional information on the available protocols and their attributes, see the following sections.
JGroups Protocols
<channels default="ee">
<channel name="ee" stack="udp"/>
</channels>
<stacks>
<stack name="udp">
<transport type="UDP" socket-binding="jgroups-udp"/>
<protocol type="PING"/>
...
</stack>
<stack name="tcp">
<transport type="TCP" socket-binding="jgroups-tcp"/>
<protocol type="MPING" socket-binding="jgroups-mping"/>
328
CHAPTER 24. CONFIGURING HIGH AVAILABILITY
...
</stack>
</stacks>
/subsystem=jgroups/channel=ee:write-attribute(name=stack,value=tcp)
This default tcp stack uses the MPING protocol, which uses IP multicast to discover the initial cluster
membership.
1. Run the following command to switch the ee channel to use the pre-configured tcp stack in the
JGroups subsystem:
Specify a unique name to the system property jboss.node.name when starting the
instance.
In the domain mode, the cluster servers are listed in the host-*.xml file in the server’s tag.
The default configuration specifies the following server names, which you can edit if
needed.
<servers>
<server name="server-one" group="main-server-group"/>
<server name="server-two" group="other-server-group">
<socket-bindings port-offset="150"/>
</server>
</servers>
3. Choose one of the following protocols for discovering other cluster members:
TCPGOSSIP: This protocol uses an external gossip router service to discover the members
of a cluster. This requires configuration and management of additional processes but allows
the individual EAP instances to not list each other cluster member. This protocol is
advantageous if the cluster members change frequently. For more details, see TCPPING.
TCPPING: This protocol defines a static cluster membership list and requires each node to
list all the potential cluster members. This protocol is preferred when cluster member
addresses are known and do not change frequently. For more details, see TCPGOSSIP.
329
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
1. Copy the following script into a text editor and save it to the local file system.
Note that the order of protocols defined is important. You can also insert a protocol at a
particular index by passing an add-index value to the add command. The index is zero-based,
so the following management CLI command adds the UNICAST3 protocol as the seventh
protocol.
/subsystem=jgroups/stack=tcpping/protocol=UNICAST3:add(add-index=6)
If you are running in a managed domain, you must specify which profile to update by
preceding the /subsystem=jgroups commands with /profile=PROFILE_NAME.
socket-bindings: A comma-separated list of the host and port combinations that are
considered well-known and will be available to look up the initial membership. See
Configuring Socket Bindings for more information on defining socket bindings.
initial_hosts: A comma-separated list of the host and port combinations, using the
syntax HOST[PORT], that are considered well-known and will be available to look up
the initial membership, for example, host1[1000],host2[2000].
port_range: This property is used to extend the initial_hosts port range by the
330
CHAPTER 24. CONFIGURING HIGH AVAILABILITY
port_range: This property is used to extend the initial_hosts port range by the
specified value. For example, if you set the initial_hosts to host1[1000],host2[2000],
and the port_range to 1, the initial_hosts setting expands to
host1[1000],host1[1001],host2[2000],host2[2001]. This property only works with the
initial_hosts property.
3. Run the script by passing the script file to the management CLI.
The TCPPING stack is now available and TCP is used for network communication.
This procedure helps you to configure the TCP stack and nodes for a clustered application in the
standalone mode.
Procedure
1. Change the default stack from udp to tcp in the JGroups subsystem:
2. Configure the TCP stack to use the TCPPING protocol in place of the default MPING protocol.
In the following code, the initial_hosts property correlates to a listing of all nodes within the
cluster and 7600 denotes the default jgroups-tcp port that can vary based on your
configuration and environment.
<stack name="tcp">
<transport type="TCP" socket-binding="jgroups-tcp"/>
<protocol type="TCPPING">
<property name="initial_hosts">192.168.1.5[7600],192.168.1.9[7600]</property>
<property name="port_range">0</property>
</protocol>
<protocol type="MERGE3"/>
<protocol type="FD_SOCK" socket-binding="jgroups-tcp-fd"/>
<protocol type="FD_ALL"/>
<protocol type="VERIFY_SUSPECT"/>
<protocol type="pbcast.NAKACK2"/>
<protocol type="UNICAST3"/>
<protocol type="pbcast.STABLE"/>
<protocol type="pbcast.GMS"/>
<protocol type="MFC"/>
<protocol type="FRAG3"/>
</stack>
NOTE
The port number 7600 set in initial_hosts must be same as the port number
defined in the jgroups-tcp socket-binding definition. If you use the port-
offset feature for socket-binding, you need to specify the same value after
offset in initial_hosts.
3. Set the IP address of the private interface, which is used by the JGroups component. The IP
331
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
3. Set the IP address of the private interface, which is used by the JGroups component. The IP
address should correlate to one of the IP addresses specified in initial_hosts:
<interface name="private">
<inet-address value="${jboss.bind.address.private:192.168.1.5}"/>
</interface>
4. Repeat the above steps for configuring other nodes within the cluster. When the nodes are
configured, start each node and deploy a clustered application.
Verification
You can check logs to verify whether the nodes are up and running:
This procedure helps you to configure the TCP stack and nodes for a clustered application in the domain
mode.
Procedure
1. If the same profile is used for multiple clusters, set the system property value to initial_hosts:
<protocol type="TCPPING">
<property name="initial_hosts">${jboss.cluster.tcp.initial_hosts}</property>
2. Set the IP address of the private interface within the XML configuration of the host controller.
The IP address of the private interface should correlate to one of the IP addresses listed
in initial_hosts.
<interfaces>
....
<interface name="private">
<inet-address value="${jboss.bind.address.private:192.168.1.5}"/>
</interface>
</interfaces>
Verification
You can check logs to verify whether the nodes are up and running:
332
CHAPTER 24. CONFIGURING HIGH AVAILABILITY
1. Copy the following script into a text editor and save it to the local file system.
Note that the order of protocols defined is important. You can also insert a protocol at a
particular index by passing an add-index value to the add command. The index is zero-based,
so the following management CLI command adds the UNICAST3 protocol as the seventh
protocol.
/subsystem=jgroups/stack=tcpgossip/protocol=UNICAST3:add(add-index=6)
If you are running in a managed domain, you must specify which profile to update by
preceding the /subsystem=jgroups commands with /profile=PROFILE_NAME.
socket-bindings: A comma-separated list of the host and port combinations that are
considered well-known and will be available to look up the initial membership. See
333
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
considered well-known and will be available to look up the initial membership. See
Configuring Socket Bindings for more information on defining socket bindings.
initial_hosts: A comma-separated list of the host and port combinations, using the
syntax HOST[PORT], that are considered well-known and will be available to look up
the initial membership, for example, host1[1000],host2[2000].
port_range: This property is used to extend the initial_hosts port range by the
specified value. For example, if you set the initial_hosts to host1[1000],host2[2000],
and the port_range to 1, the initial_hosts setting expands to
host1[1000],host1[1001],host2[2000],host2[2001]. This property only works with the
initial_hosts property.
sock_conn_timeout: The maximum time for socket creation. The default is 1000
milliseconds.
3. Run the script by passing the script file to the management CLI.
The TCPGOSSIP stack is now available and TCP is used for network communication. This stack is
configured for use with a gossip router so that JGroups cluster members can find other cluster
members.
JDBC_PING uses a database, specified in a data-source, to list the members of the cluster.
1. Create a data-source to connect to the database you want to use to manage cluster
membership.
2. Copy the following script into a text editor and save it to the local file system.
batch
# Add the JDBC_PING stack
/subsystem=jgroups/stack=JDBC_PING:add
/subsystem=jgroups/stack=JDBC_PING/transport=TCP:add(socket-binding=jgroups-tcp)
/subsystem=jgroups/stack=JDBC_PING/protocol=JDBC_PING:add(data-
source=ExampleDS)
/subsystem=jgroups/stack=JDBC_PING/protocol=MERGE3:add
/subsystem=jgroups/stack=JDBC_PING/protocol=FD_SOCK:add
/subsystem=jgroups/stack=JDBC_PING/protocol=FD_ALL:add
/subsystem=jgroups/stack=JDBC_PING/protocol=VERIFY_SUSPECT:add
/subsystem=jgroups/stack=JDBC_PING/protocol=pbcast.NAKACK2:add
/subsystem=jgroups/stack=JDBC_PING/protocol=UNICAST3:add
/subsystem=jgroups/stack=JDBC_PING/protocol=pbcast.STABLE:add
/subsystem=jgroups/stack=JDBC_PING/protocol=pbcast.GMS:add
/subsystem=jgroups/stack=JDBC_PING/protocol=MFC:add
334
CHAPTER 24. CONFIGURING HIGH AVAILABILITY
/subsystem=jgroups/stack=JDBC_PING/protocol=FRAG3:add
# Set JDBC_PING as the stack for the ee channel
/subsystem=jgroups/channel=ee:write-attribute(name=stack,value=JDBC_PING)
run-batch
reload
Note that the order of protocols defined is important. You can also insert a protocol at a
particular index by passing an add-index value to the add command. The index is zero-based,
so the following management CLI command adds the UNICAST3 protocol as the seventh
protocol.
/subsystem=jgroups/stack=JDBC_PING/protocol=UNICAST3:add(add-index=6)
If you are running in a managed domain, you must specify which profile to update by
preceding the /subsystem=jgroups commands with /profile=PROFILE_NAME.
Replace 'ExampleDS' with the name of the data-source you defined in Step 1.
4. Run the script by passing the script file to the management CLI.
The JDBC_PING stack is now available and TCP is used for network communication.
Related information
JDBC_PING: https://developer.jboss.org/wiki/JDBCPING
See the Network and Port Configuration chapter in this guide for information about how to configure
network interfaces.
IMPORTANT
For security reasons, JGroups should only be bound to a non-public network interface.
For performance reasons, we also recommend that the network interface for JGroups
traffic should be part of a dedicated Virtual Local Area Network (VLAN).
Preventing unauthorized nodes from joining the cluster. This is addressed by requiring
authentication.
335
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
JGroups authentication is performed by the AUTH protocol. The purpose is to ensure that only
authenticated nodes can join a cluster.
In the applicable server configuration file, add the AUTH protocol with the appropriate property
settings. The AUTH protocol should be configured immediately before the pbcast.GMS protocol.
The following examples demonstrate using AUTH with different forms of authorization tokens.
...
<protocol type="pbcast.STABLE"/>
<auth-protocol type="AUTH">
<plain-token>
<shared-secret-reference clear-text="my_password"/>
</plain-token>
</auth-protocol>
<protocol type="pbcast.GMS"/>
...
...
<protocol type="pbcast.STABLE"/>
<auth-protocol type="AUTH">
<digest-token algorithm="SHA-512">
<shared-secret-reference clear-text="my_password"/>
</digest-token>
</auth-protocol>
<protocol type="pbcast.GMS"/>
...
2. Add the keystore to the elytron subsystem using the management CLI:
/subsystem=elytron/key-store=jgroups-token-
store:add(type=jks,path=/path/to/jgroups.keystore,credential-reference={clear-
text=my_password}, required=true)
336
CHAPTER 24. CONFIGURING HIGH AVAILABILITY
...
<protocol type="pbcast.STABLE"/>
<auth-protocol type="AUTH">
<cipher-token algorithm="RSA" key-alias="jgroups_key" key-store="jgroups-token-store">
<shared-secret-reference clear-text="my_password"/>
<key-credential-reference clear-text="my_password"/>
</cipher-token>
</auth-protocol>
<protocol type="pbcast.GMS"/>
...
To encrypt messages, JGroups uses a secret key that is shared by the members of a cluster. The sender
encrypts the message using the shared secret key, and the receiver decrypts the message using the
same secret key. With symmetric encryption, which is configured using the SYM_ENCRYPT protocol,
nodes use a shared keystore to retrieve the secret key. With asymmetric encryption, which is configured
using the ASYM_ENCRYPT protocol, nodes retrieve the secret key from the coordinator of the cluster
after being authenticated using AUTH.
1. Create a keystore.
In the following command, replace VERSION with the appropriate JGroups JAR version and
PASSWORD with a keystore password.
This will generate a defaultStore.keystore file that will be referenced in the JGroups
configuration.
2. Once the keystore has been generated it is defined in the SYM_PROTOCOL using one of two
methods.
NOTE
337
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
<subsystem xmlns="urn:jboss:domain:jgroups:6.0">
<stacks>
<stack name="udp">
<transport type="UDP" socket-binding="jgroups-udp"/>
<protocol type="PING"/>
<protocol type="MERGE3"/>
<protocol type="FD_SOCK"/>
<protocol type="FD_ALL"/>
<protocol type="VERIFY_SUSPECT"/>
<protocol type="SYM_ENCRYPT">
<property name="provider">SunJCE</property>
<property name="sym_algorithm">AES</property>
<property name="encrypt_entire_message">true</property>
<property name="keystore_name">/path/to/defaultStore.keystore</property>
<property name="store_password">PASSWORD</property>
<property name="alias">mykey</property>
</protocol>
<protocol type="pbcast.NAKACK2"/>
<protocol type="UNICAST3"/>
<protocol type="pbcast.STABLE"/>
<protocol type="pbcast.GMS"/>
<protocol type="UFC"/>
<protocol type="MFC"/>
<protocol type="FRAG3"/>
</stack>
</stacks>
</subsystem>
1. Using the management CLI, create a keystore in the elytron subsystem that references the
defaultStore.keystore created in using symmetric encryption .
/subsystem=elytron/key-store=jgroups-
keystore:add(path=/path/to/defaultStore.keystore,credential-reference={clear-
text=PASSWORD},type=JCEKS)
2. Add the SYM_ENCRYPT protocol in the jgroups subsystem with the appropriate property
settings. The SYM_ENCRYPT protocol should be configured immediately before the
pbcast.NAKACK2 protocol, as seen in the following configuration.
<subsystem xmlns="urn:jboss:domain:jgroups:6.0">
<stacks>
<stack name="udp">
<transport type="UDP" socket-binding="jgroups-udp"/>
<protocol type="PING"/>
<protocol type="MERGE3"/>
<protocol type="FD_SOCK"/>
<protocol type="FD_ALL"/>
<protocol type="VERIFY_SUSPECT"/>
<encrypt-protocol type="SYM_ENCRYPT" key-alias="mykey" key-store="jgroups-
keystore">
<key-credential-reference clear-text="PASSWORD"/>
<property name="provider">SunJCE</property>
<property name="encrypt_entire_message">true</property>
338
CHAPTER 24. CONFIGURING HIGH AVAILABILITY
</encrypt-protocol>
<protocol type="pbcast.NAKACK2"/>
<protocol type="UNICAST3"/>
<protocol type="pbcast.STABLE"/>
<protocol type="pbcast.GMS"/>
<protocol type="UFC"/>
<protocol type="MFC"/>
<protocol type="FRAG3"/>
</stack>
</stacks>
</subsystem>
NOTE
The above example uses a clear text password; however, a credential store may
also be defined to define the password outside of the configuration file. For more
information on configuring this store, see the Credential Store section in the How
to Configure Server Security guide.
<subsystem xmlns="urn:jboss:domain:jgroups:6.0">
<stacks>
<stack name="udp">
<transport type="UDP" socket-binding="jgroups-udp"/>
<protocol type="PING"/>
<protocol type="MERGE3"/>
<protocol type="FD_SOCK"/>
<protocol type="FD_ALL"/>
<protocol type="VERIFY_SUSPECT"/>
<protocol type="ASYM_ENCRYPT">
<property name="encrypt_entire_message">true</property>
<property name="sym_keylength">128</property>
<property name="sym_algorithm">AES/ECB/PKCS5Padding</property>
<property name="asym_keylength">512</property>
<property name="asym_algorithm">RSA</property>
</protocol>
<protocol type="pbcast.NAKACK2"/>
<protocol type="UNICAST3"/>
<protocol type="pbcast.STABLE"/>
339
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
1. Create a keystore to contain the key pair. The following command creates a keystore with the
mykey entry.
2. Using the management CLI, create a keystore in the elytron subsystem that references the
defaultStore.keystore.
/subsystem=elytron/key-store=jgroups-
keystore:add(path=/path/to/defaultStore.keystore,credential-reference={clear-
text=PASSWORD},type=JCEKS)
3. Add the ASYM_ENCRYPT protocol in the jgroups subsystem with the appropriate property
settings. The ASYM_ENCRYPT protocol should be configured immediately before the
pbcast.NAKACK2 protocol, as seen in the following configuration.
<subsystem xmlns="urn:jboss:domain:jgroups:6.0">
<stacks>
<stack name="udp">
<transport type="UDP" socket-binding="jgroups-udp"/>
<protocol type="PING"/>
<protocol type="MERGE3"/>
<protocol type="FD_SOCK"/>
<protocol type="FD_ALL"/>
<protocol type="VERIFY_SUSPECT"/>
<encrypt-protocol type="ASYM_ENCRYPT" key-alias="mykey" key-store="jgroups-
keystore">
<key-credential-reference clear-text="secret" />
<property name="encrypt_entire_message">true</property>
</encrypt-protocol>
<protocol type="pbcast.NAKACK2"/>
<protocol type="UNICAST3"/>
<protocol type="pbcast.STABLE"/>
<!-- Configure AUTH protocol here -->
<protocol type="pbcast.GMS"/>
<protocol type="UFC"/>
<protocol type="MFC"/>
<protocol type="FRAG3"/>
</stack>
</stacks>
</subsystem>
NOTE
340
CHAPTER 24. CONFIGURING HIGH AVAILABILITY
NOTE
The above example uses a clear text password; however, a credential store may
also be defined to define the password outside of the configuration file. For more
information on configuring this store, see the Credential Store section in the How
to Configure Server Security guide.
The following table lists the attributes you can configure for each thread pool and the default value for
each.
Use the following syntax to configure a JGroups thread pool using the management CLI.
341
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
/subsystem=jgroups/stack=STACK_TYPE/transport=TRANSPORT_TYPE/thread-
pool=THREAD_POOL_NAME:write-attribute(name=ATTRIBUTE_NAME,
value=ATTRIBUTE_VALUE)
The following is an example of the management CLI command to set the max-threads value to 500 in
the default thread pool for the udp stack.
/subsystem=jgroups/stack=udp/transport=UDP/thread-pool=default:write-attribute(name="max-
threads", value="500")
To resolve this, consult your operating system documentation for instructions on how to increase the
buffer size. For Red Hat Enterprise Linux systems, edit /etc/sysctl.conf as the root user to configure
maximum values for buffer sizes that will survive system restarts. For example:
After modifying /etc/sysctl.conf, run sysctl -p for the changes to take effect.
UDP Stack
ucast_recv_buf_size
ucast_send_buf_size
mcast_recv_buf_size
mcast_send_buf_size
TCP Stack
342
CHAPTER 24. CONFIGURING HIGH AVAILABILITY
recv_buf_size
send_buf_size
JGroups buffer sizes can be configured using the management console or the management CLI.
Use the following syntax to set a JGroups buffer size property using the management CLI.
/subsystem=jgroups/stack=STACK_NAME/transport=TRANSPORT/property=PROPERTY_NAME:ad
d(value=BUFFER_SIZE)
The following is an example management CLI command to set the recv_buf_size property to 20000000
on the tcp stack.
/subsystem=jgroups/stack=tcp/transport=TRANSPORT/property=recv_buf_size:add(value=20000000)
JGroups buffer sizes can also be configured using the management console by navigating to the
JGroups subsystem from the Configuration tab, clicking View, selecting the Stack tab, choosing the
appropriate stack, clicking Transport, and editing the Properties field.
Make sure your machine is set up correctly for IP multicast. There are two test programs that ship with
JBoss EAP that can be used to test IP multicast: McastReceiverTest and McastSenderTest.
If you want to bind to a specific network interface card (NIC), use -bind_addr YOUR_BIND_ADDRESS,
where YOUR_BIND_ADDRESS is the IP address of the NIC to which you want to bind. Use this
parameter in both the sender and the receiver.
When you type in the McastSenderTest terminal window, you should see the output in the
McastReceiverTest window. If you do not, try the following steps.
Increase the time-to-live for multicast packets by adding -ttl VALUE to the sender command.
The default used by this test program is 32 and the VALUE must be no greater than 255.
If the machines have multiple interfaces, verify that you are using the correct interface.
343
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Contact a system administrator to make sure that multicast will work on the interface you have
chosen.
Once you know multicast is working properly on each machine in your cluster, you can repeat the above
test to test the network, putting the sender on one machine and the receiver on another.
For an example cluster of nodes A, B, C, and D, where A pings B, B pings C, C pings D, and D pings A, C
can be suspected for any of the following reasons:
B or C are running at 100% CPU for more than T seconds. So even if C sends a heartbeat
acknowledgement to B, B may not be able to process it because it is at 100% CPU usage.
The network loses packets. This usually happens when there is a lot of traffic on the network,
and the switch starts dropping packets, usually broadcasts first, then IP multicasts, and TCP
packets last.
B or C are processing a callback. For example, if C received a remote method call over its
channel that takes T + 1 seconds to process, during this time C will not process any other
messages, including heartbeats. Therefore, B will not receive the heartbeat acknowledgement
and will suspect C.
24.3. INFINISPAN
For more information about Infinispan functionality and configuration options see the Infinispan
Documentation.
The infinispan subsystem provides caching support for JBoss EAP. It allows you to configure and view
runtime metrics for named cache containers and caches.
When using a configuration that provides high availability capabilities, such as the ha or full-ha profile in
a managed domain, or the standalone-ha.xml or standalone-full-ha.xml configuration file for a
standalone server, the infinispan subsystem provides caching, state replication, and state distribution
support. In non-high-availability configurations, the infinispan subsystem provides local caching
support.
IMPORTANT
344
CHAPTER 24. CONFIGURING HIGH AVAILABILITY
<subsystem xmlns="urn:jboss:domain:infinispan:7.0">
<cache-container name="server" aliases="singleton cluster" default-cache="default"
module="org.wildfly.clustering.server">
<transport lock-timeout="60000"/>
<replicated-cache name="default">
<transaction mode="BATCH"/>
</replicated-cache>
</cache-container>
<cache-container name="web" default-cache="dist" module="org.wildfly.clustering.web.infinispan">
<transport lock-timeout="60000"/>
<distributed-cache name="dist">
<locking isolation="REPEATABLE_READ"/>
<transaction mode="BATCH"/>
<file-store/>
</distributed-cache>
</cache-container>
<cache-container name="ejb" aliases="sfsb" default-cache="dist"
module="org.wildfly.clustering.ejb.infinispan">
<transport lock-timeout="60000"/>
<distributed-cache name="dist">
<locking isolation="REPEATABLE_READ"/>
<transaction mode="BATCH"/>
<file-store/>
</distributed-cache>
</cache-container>
<cache-container name="hibernate" default-cache="local-query" module="org.hibernate.infinispan">
<transport lock-timeout="60000"/>
<local-cache name="local-query">
<object-memory size="1000"/>
<expiration max-idle="100000"/>
</local-cache>
<invalidation-cache name="entity">
<transaction mode="NON_XA"/>
<object-memory size="1000"/>
<expiration max-idle="100000"/>
</invalidation-cache>
<replicated-cache name="timestamps" mode="ASYNC"/>
</cache-container>
</subsystem>
Note the default cache defined in each cache container. For example, the web cache container defines
345
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Note the default cache defined in each cache container. For example, the web cache container defines
the dist distributed cache as the default. The dist cache will therefore be used when clustering web
sessions.
See Configure Cache Containers for information on changing the default cache and adding additional
caches.
IMPORTANT
You can add additional caches and cache containers, for example, for HTTP sessions,
stateful session beans, or singleton services or deployments. It is not supported to use
these caches directly by user applications.
Cache containers and cache attributes can be configured using the management console or
management CLI.
WARNING
You should avoid changing cache or cache container names, as other components
in the configuration may reference them.
Configure caches.
Choose the appropriate cache container and click View. From the appropriate cache tab, for
example, Replicated Cache, you can add, update, and remove caches.
346
CHAPTER 24. CONFIGURING HIGH AVAILABILITY
/subsystem=infinispan/cache-container=CACHE_CONTAINER:add
/subsystem=infinispan/cache-container=CACHE_CONTAINER/replicated-
cache=CACHE:add(mode=MODE)
/subsystem=infinispan/cache-container=CACHE_CONTAINER:write-attribute(name=default-
cache,value=CACHE)
/subsystem=infinispan/cache-container=CACHE_CONTAINER/replicated-
cache=CACHE/component=transaction:write-attribute(name=mode,value=BATCH)
The following example shows how to add a concurrent distributed cache to the web cache container.
This cache configuration relaxes the locking constraints of the default cache, which allows multiple
concurrent requests to access the same web session simultaneously. It achieves this by permitting lock-
free reads and obtaining exclusive locks more frequently, but for a shorter duration.
Use the following management CLI commands to add the concurrent distributed cache to the web
cache container and make it the default cache:
batch
/subsystem=infinispan/cache-container=web/distributed-cache=concurrent:add
/subsystem=infinispan/cache-container=web:write-attribute(name=default-cache,value=concurrent)
/subsystem=infinispan/cache-container=web/distributed-cache=concurrent/store=file:add
run-batch
To support passivation of Jakarta Enterprise Beans session beans, you can use the ejb cache
container defined in the infinispan subsystem to store the sessions.
For remote Jakarta Enterprise Beans clients connecting to a clustered deployment on a server,
you must provide the cluster topology information to these clients, so that they can fail over to
other nodes in the cluster if the node they are interacting with fails.
If you are changing or renaming the default cache container, named ejb, which supports passivation and
the provision of topology information, you must add the cache-container attribute to the passivation-
stores element and the cluster attribute to the remote element, as shown in the example below. If you
347
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
are just adding a new cache for your own use, you need not make those changes.
<subsystem xmlns="urn:jboss:domain:ejb3:5.0">
<passivation-stores>
<passivation-store name="infinispan" cache-container="ejb-cltest" max-size="10000"/>
</passivation-stores>
<subsystem xmlns="urn:jboss:domain:infinispan:7.0">
...
<cache-container name="ejb-cltest" aliases="sfsb" default-cache="dist"
module="org.wildfly.clustering.ejb.infinispan">
</subsystem>
The size attribute sets the maximum number of cache entries that will be stored before eviction of
cache entries begins.
Note that eviction only occurs within the memory. A cache store holds cache entries that are evicted to
prevent permanent loss of information. For more information about the eviction feature, see the
Eviction and Data Container section in the Infinispan User Guide.
The expiration feature for the hibernate cache container is a clustered operation; thus, when using a
clustered cache, an expired cache entry is removed from all cluster members. For more information, see
the Expiration section in the Infinispan User Guide.
Cache Modes
Replication
Replication mode automatically detects and adds new instances on the cluster. Changes made to
these instances will be replicated to all nodes on the cluster. Replication mode typically works best in
small clusters because of the amount of information that has to be replicated over the network.
348
CHAPTER 24. CONFIGURING HIGH AVAILABILITY
Infinispan can be configured to use UDP multicast, which alleviates network traffic congestion to a
degree.
Distribution
Distribution mode allows Infinispan to scale the cluster linearly. Distribution mode uses a consistent
hash algorithm to determine where in a cluster a new node should be placed. The number of copies,
or owners, of information to be kept is configurable. There is a trade-off between the number of
copies kept, durability of the data, and performance. The more copies that are kept, the more impact
on performance, but the less likely you are to lose data in a server failure. The hash algorithm also
works to reduce network traffic by locating entries without multicasting or storing metadata.
You should consider using distribution mode as a caching strategy when the cluster size exceeds 6-8
nodes. With distribution mode, data is distributed to only a subset of nodes within the cluster, as
opposed to all nodes.
Scattered
Scattered mode is similar to distribution mode in that it uses a consistent hash algorithm to
determine ownership. However, ownership is limited to two members, and the originator, or node
receiving the request for a given session, always assumes ownership for coordinating locking and
cache entry updates. The cache write algorithm used in scattered mode guarantees that a write
operation results in only a single RPC call, where distribution caches with two owners can often use
two RPC calls. This can be useful for distributed web sessions because load balancer failover tends to
direct traffic to a non-primary owner or even a backup node. This can potentially reduce contention
and improve performance following a cluster topology change.
Scattered mode does not support transactions or L1 caching. However, it does support biased reads,
which allow the node that originates a cache write for a given entry to continue to service reads for
that entry for some duration even though it is not the owner according to the consistent hash. The
effect is similar to L1 caching, although the configuration attributes for biased reads versus L1
caching are distinct.
IMPORTANT
From JBoss EAP 7.1 onwards, you must always use the synchronous (SYNC) cache mode
for session replication. SYNC is also the default cache mode. For more information about
session replication and the appropriate cache modes, see How to configure and tune the
session replication for EAP.
Synchronous replication
With synchronous replication, the replication process runs in the same thread that handles the user
request. Session replication is initiated after the completed response is sent back to the client, and
the thread is released only after the replication is completed. Synchronous replication has an impact
on network traffic because it requires a response from each node in the cluster. It has the advantage,
however, of ensuring that all modifications have been made to all nodes in the cluster.
Asynchronous replication
With asynchronous replication, Infinispan uses a thread pool to carry out replication in the
background. The sender does not wait for replies from other nodes in the cluster. However, cache
reads for the same session will block until the previous replication completes so that stale data is not
read. Replication is triggered either on a time basis or by queue size. Failed replication attempts are
written to a log, not notified in real time.
349
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
You can change the default cache using the management CLI.
NOTE
This section shows instructions specific to configuring the web session cache, which
defaults to distribution mode. The steps and management CLI commands can easily be
adjusted to apply to other cache containers.
NOTE
The below management CLI commands are for a standalone server. When running in a
managed domain, you must specify which profile to update by preceding the
/subsystem=infinispan commands with /profile=PROFILE_NAME.
1. Add the repl replication cache and set it as the default cache.
batch
/subsystem=infinispan/cache-container=web/replicated-cache=repl:add()
/subsystem=infinispan/cache-container=web/replicated-
cache=repl/component=transaction:add(mode=BATCH)
/subsystem=infinispan/cache-container=web/replicated-
cache=repl/component=locking:add(isolation=REPEATABLE_READ)
/subsystem=infinispan/cache-container=web/replicated-cache=repl/store=file:add
/subsystem=infinispan/cache-container=web:write-attribute(name=default-cache,value=repl)
run-batch
reload
NOTE
The below management CLI commands are for a standalone server. When running in a
managed domain, you must specify which profile to update by preceding the
/subsystem=infinispan commands with /profile=PROFILE_NAME.
/subsystem=infinispan/cache-container=web:write-attribute(name=default-cache,value=dist)
2. Set the number of owners for the distribution cache. The following command sets 5 owners. The
default is 2.
350
CHAPTER 24. CONFIGURING HIGH AVAILABILITY
/subsystem=infinispan/cache-container=web/distributed-cache=dist:write-
attribute(name=owners,value=5)
reload
NOTE
The below management CLI commands are for a standalone server using the HA profile.
When running in a managed domain, you must specify which profile to update by
preceding the /subsystem=infinispan commands with /profile=PROFILE_NAME.
1. Create the scattered cache with a read bias lifespan equal to the default web session timeout
value of 30 minutes .
/subsystem=infinispan/cache-container=web/scattered-cache=scattered:add(bias-
lifespan=1800000)
/subsystem=infinispan/cache-container=web:write-attribute(name=default-
cache,value=scattered)
When using a SYNC caching strategy, the cost of replication is easy to measure and directly seen in
response times since the request does not complete until the replication completes.
Although it seems that the ASYNC caching strategy should result in lower response times than the
SYNC caching strategy, this is only true under the right conditions. The ASYNC caching strategy is more
difficult to measure, but it can provide better performance than the SYNC strategy when the duration
between requests is long enough for the cache operation to complete. This is because the cost of
replication is not immediately seen in response times.
If requests for the same session are made too quickly, the cost of replication for the previous request is
shifted to the front of the subsequent request since it must wait for the replication from the previous
request to complete. For rapidly fired requests where a subsequent request is sent immediately after a
response is received, the ASYNC caching strategy will perform worse than the SYNC caching strategy.
351
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Consequently, there is a threshold for the period of time between requests for the same session where
the SYNC caching strategy will actually perform better than the ASYNC caching strategy. In real world
usage, requests for the same session are not normally received in rapid succession. Instead, there is
typically a period of time in the order of a few seconds or more between the requests. In this case, the
ASYNC caching strategy is a sensible default and provides the fastest response times.
State transfer adjusts the cache’s internal state in response to a change in the cache membership. This
change automatically occurs when a node joins or leaves the cluster, when two or more cluster partitions
merge, or after any combination of these events. The initial state transfer for a newly started cache is
the most expensive, as the new cache must receive the maximum amount of state, based on the cache’s
mode as discussed below.
The timeout attribute can be used to control how long the newly started cache waits to receive its state.
If the timeout attribute is a positive number, then the cache will wait to receive all of its initial state
before being made available to service requests. If the state transfer does not complete in the specified
time, the default being 240000 milliseconds, then the cache will throw an error and cancel the startup. If
timeout is set to 0, then the cache is immediately available, and it will receive its initial state during
background operations. Until the initial state transfer is complete, any requests for cache entries that
the cache has not yet received will need to be fetched from a remote node.
/subsystem=infinispan/cache-container=server/CACHE_TYPE=CACHE/component=state-
transfer:write-attribute(name=timeout,value=0)
In replication mode a new node joining the cache receives the entire cache state from the
existing nodes. When a node leaves the cluster there is no state transfer.
In distribution mode the new node receives only a part of the state from the existing nodes, and
the existing nodes remove some of their state in order to keep owners copies of each key in the
cache, as determined through consistent hashing. When a node leaves the cluster, a distribution
cache needs to make additional copies of the keys that were stored on that node, so that
owners of each key continue to exist.
In invalidation mode the initial state transfer is similar to replication mode, the only difference
being that the nodes are not guaranteed to have the same state. When a node leaves the
cluster there is no state transfer.
A state transfer transfers both in-memory and persistent state by default, but both can be disabled in
the configuration. When state transfer is disabled, a ClusterLoader must be configured, otherwise a
node will become the owner or backup owner of a key without the data being loaded into its cache. In
addition, if state transfer is disabled in distribution mode then a key will occasionally have less than
owners copies in the cache.
The infinispan subsystem contains the async-operations, expiration, listener, persistence, remote-
352
CHAPTER 24. CONFIGURING HIGH AVAILABILITY
The infinispan subsystem contains the async-operations, expiration, listener, persistence, remote-
command, state-transfer, and transport thread pools. These pools can be configured for any Infinispan
cache container.
The following table lists the attributes you can configure for each thread pool in the infinispan
subsystem and the default value for each.
persistence 60000L 4 1 0
state-transfer 60000L 60 1 0
Use the following syntax to configure an Infinispan thread pool using the management CLI.
/subsystem=infinispan/cache-container=CACHE_CONTAINER_NAME/thread-
pool=THREAD_POOL_NAME:write-attribute(name=ATTRIBUTE_NAME,
value=ATTRIBUTE_VALUE)
The following is an example of the management CLI command to set the max-threads value to 10 in
the persistence thread pool for the server cache container.
/subsystem=infinispan/cache-container=server/thread-pool=persistence:write-attribute(name="max-
threads", value="10")
Statistics collection can be enabled for each cache container, cache, or both. The statistics option for
each cache overrides the option for the cache container. Enabling or disabling statistics collection for a
cache container will cause all caches in that container to inherit the setting, unless they explicitly specify
their own.
353
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
WARNING
Enabling Infinispan statistics may have a negative impact on the performance of the
infinispan subsystem. Statistics should be enabled only when required.
You can enable or disable the collection of Infinispan statistics using the management console or the
management CLI. From the management console, navigate to the Infinispan subsystem from the
Configuration tab, select the appropriate cache or cache container, and edit the Statistics Enabled
attribute. Use the below commands to enable statistics using the management CLI.
Enable statistics collection for a cache container. A server reload will be required.
/subsystem=infinispan/cache-container=CACHE_CONTAINER:write-attribute(name=statistics-
enabled,value=true)
/subsystem=infinispan/cache-container=CACHE_CONTAINER/CACHE_TYPE=CACHE:write-
attribute(name=statistics-enabled,value=true)
NOTE
You can use the following command to undefine the statistics-enabled attribute of a
cache so that it will inherit the settings of its cache container’s statistics-enabled
attribute.
/subsystem=infinispan/cache-
container=CACHE_CONTAINER/CACHE_TYPE=CACHE:undefine-
attribute(name=statistics-enabled)
However, there are potential catastrophic situations that could occur when too many nodes disappear
from the cluster:
Split brain
This splits the cluster in two or more partitions, or sub-clusters, that operate independently. In these
circumstances, multiple clients reading and writing from different partitions see different versions of
the same cache entry, which for many applications is problematic.
NOTE
354
CHAPTER 24. CONFIGURING HIGH AVAILABILITY
NOTE
There are ways to alleviate the possibility for the split brain to happen, such as
redundant networks or IP bonding; however, these only reduce the window of time for
the problem to occur.
The goal is to avoid situations in which incorrect data is returned to the user as a result of either split
brain or multiple nodes crashing in rapid sequence.
In a split brain situation, each network partition will install its own JGroups view, removing the nodes
from the other partitions. We do not have a direct way to determine whether the cluster has been split
into two or more partitions, since the partitions are unaware of each other. Instead, we assume the
cluster has split when one or more nodes disappear from the JGroups cluster without sending an explicit
leave message.
With partition handling disabled, each such partition would continue to function as an independent
cluster. Each partition may only see a part of the data, and each partition could write conflicting updates
in the cache.
With partition handling enabled, if we detect a split, each partition does not start a rebalance
immediately, but first checks whether it should enter degraded mode instead:
If at least one segment has lost all its owners, meaning that at least the number of owners
specified has left since the last rebalance ended, the partition enters degraded mode.
If the partition does not contain a simple majority of the nodes (floor(numNodes/2) + 1) in the
latest stable topology, the partition also enters degraded mode.
The stable topology is updated every time a rebalance operation ends and the coordinator determines
that another rebalance is not necessary. These rules ensure that at most, one partition stays in available
mode, and the other partitions enter degraded mode.
When a partition is in degraded mode, it only allows access to the keys that are wholly owned:
Requests (reads and writes) for entries that have all the copies on nodes within this partition are
honored.
Requests for entries that are partially or totally owned by nodes that have disappeared are
rejected with an AvailabilityException.
This guarantees that partitions cannot write different values for the same key (cache is consistent), and
also that one partition can not read keys that have been updated in the other partitions (no stale data).
NOTE
355
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
NOTE
Two partitions could start up isolated, and as long as they do not merge, they can read
and write inconsistent data. In the future, we may allow custom availability strategies (e.g.
check that a certain node is part of the cluster, or check that an external machine is
accessible) that could handle that situation as well.
Currently the partition handling is disabled by default. Use the following management CLI command to
enable partition handling:
/subsystem=infinispan/cache-container=web/distributed-cache=dist/component=partition-
handling:write-attribute(name=enabled, value=true)
Each server group in a managed domain requires a unique remote cache. The caches can belong to the
same data grid. Therefore, users must configure a remote cache for every server group by defining a
socket binding for the server group and associating the socket binding with a remote cache container.
Procedure
1. Define a socket-binding, repeating the command as necessary for each remote Red Hat Data
Grid instance in the cluster.
/socket-binding-group=standard-sockets/remote-destination-outbound-socket-
binding=SOCKET_BINDING:add(host=HOSTNAME,port=PORT)
batch
/subsystem=infinispan/remote-cache-container=CACHE_CONTAINER:add(default-remote-
cluster=data-grid-cluster)
/subsystem=infinispan/remote-cache-container=CACHE_CONTAINER/remote-cluster=data-
grid-cluster:add(socket-bindings=[SOCKET_BINDING,SOCKET_BINDING_2,...])
run-batch
For a remote-cache-container called "foo", enable statistics using the following operation:
/subsystem=infinispan/remote-cache-container=foo:write-attribute(name=statistics-enabled,
value=true)
356
CHAPTER 24. CONFIGURING HIGH AVAILABILITY
/subsystem=infinispan/remote-cache-container=foo:read-attribute(name=connections)
/subsystem=infinispan/remote-cache-container=foo:read-attribute(name=active-connections)
/subsystem=infinispan/remote-cache-container=foo:read-attribute(name=idle-connections)
/subsystem=infinispan/remote-cache-container=foo:read-resource-description
The following metrics are specific to the remote cache used by the selected deployment:
/subsystem=infinispan/remote-cache-container=foo/remote-cache=bar.war:read-resource(include-
runtime=true, recursive=true)
{
"average-read-time" : 1,
"average-remove-time" : 0,
"average-write-time" : 2,
"hits" : 9,
"misses" : 0,
"near-cache-hits" : 7,
"near-cache-invalidations" : 8,
"near-cache-misses" : 9,
"near-cache-size" : 1,
"removes" : 0,
"time-since-reset" : 82344,
"writes" : 8
}
/subsystem=infinispan/remote-cache-container=foo/remote-cache=bar.war:read-resource-description
Some of these metrics are computed values (example, average-*), while others are tallied, such
as hits and misses. The tallied metrics can be reset by the following operation:
/subsystem=infinispan/remote-cache-container=foo/remote-cache=bar.war:reset-statistics()
NOTE
You need a Red Hat Data Grid subscription to use this functionality.
Red Hat Data Grid can be used as an external cache container for application-specific data in JBoss
EAP, such as HTTP sessions. This allows scaling of the data layer independent of the application, and
enables different JBoss EAP clusters, which may reside in various domains, to access data from the
same Red Hat Data Grid cluster. Additionally, other applications can interface with the caches presented
by Red Hat Data Grid.
The following example shows how to externalize HTTP sessions. It applies to both standalone instances
357
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
The following example shows how to externalize HTTP sessions. It applies to both standalone instances
of JBoss EAP as well as managed domains.
2. Configure the HotRod store. The HotRod store uses one dedicated remote cache for each
cache created by the JBoss EAP server. Typically, one invalidation cache is used on the JBoss
EAP server, as shown in the CLI script below.
NOTE
The remote caches need to be configured manually on the Red Hat Data Grid
servers. The recommended configuration for these caches is a transactional
distribution mode cache with pessimistic locking. Cache names must correspond
to the deployment file names, such as test.war.
Once the remote cache container has been configured, a hotrod store can be configured to
replace any existing store. The following CLI script demonstrates a typical use case for
offloading sessions in conjunction with the invalidation cache.
batch
/subsystem=infinispan/cache-container=web/invalidation-cache=CACHE_NAME:add()
/subsystem=infinispan/cache-container=web/invalidation-
cache=CACHE_NAME/store=hotrod:add(remote-cache-
container=CACHE_CONTAINER,fetch-
state=false,purge=false,passivation=false,shared=true)
/subsystem=infinispan/cache-container=web/invalidation-
cache=CACHE_NAME/component=transaction:add(mode=BATCH)
/subsystem=infinispan/cache-container=web/invalidation-
cache=CACHE_NAME/component=locking:add(isolation=REPEATABLE_READ)
/subsystem=infinispan/cache-container=web:write-attribute(name=default-
cache,value=CACHE_NAME)
run-batch
The script configures a new invalidation cache. Session data is then maintained in the cache for
performance and written to the store for resilience.
A HotRod client can be injected directly into Jakarta EE applications using the @Resource
annotation. In the example below, the @Resource annotation looks up the configuration
properties in the class path, in the hotrod-client.properties file.
@Resource(lookup = "java:jboss/infinispan/remote-container/web-sessions")
private org.infinispan.client.hotrod.RemoteCacheContainer client;
infinispan.client.hotrod.transport_factory =
org.infinispan.client.hotrod.impl.transport.tcp.TcpTransportFactory
infinispan.client.hotrod.server_list = 127.0.0.1:11222
infinispan.client.hotrod.marshaller =
org.infinispan.commons.marshall.jboss.GenericJBossMarshaller
infinispan.client.hotrod.async_executor_factory =
org.infinispan.client.hotrod.impl.async.DefaultAsyncExecutorFactory
358
CHAPTER 24. CONFIGURING HIGH AVAILABILITY
infinispan.client.hotrod.default_executor_factory.pool_size = 1
infinispan.client.hotrod.default_executor_factory.queue_size = 10000
infinispan.client.hotrod.hash_function_impl.1 =
org.infinispan.client.hotrod.impl.consistenthash.ConsistentHashV1
infinispan.client.hotrod.tcp_no_delay = true
infinispan.client.hotrod.ping_on_startup = true
infinispan.client.hotrod.request_balancing_strategy =
org.infinispan.client.hotrod.impl.transport.tcp.RoundRobinBalancingStrategy
infinispan.client.hotrod.key_size_estimate = 64
infinispan.client.hotrod.value_size_estimate = 512
infinispan.client.hotrod.force_return_values = false
maxActive=-1
maxTotal = -1
maxIdle = -1
whenExhaustedAction = 1
timeBetweenEvictionRunsMillis=120000
minEvictableIdleTimeMillis=300000
testWhileIdle = true
minIdle = 1
/subsystem=elytron/client-ssl-context=CLIENT_SSL_CONTEXT:add(key-
manager=KEY_MANAGER,trust-manager=TRUST_MANAGER)
2. Configure the remote cache container to use the client SSL context.
/subsystem=infinispan/remote-cache-
container=CACHE_CONTAINER/component=security:write-attribute(name=ssl-
context,value=CLIENT_SSL_CONTEXT)
3. Secure the remote Red Hat Data Grid instance, repeating as necessary for each instance.
a. Copy the keystore used in the client-ssl-context to the remote Red Hat Data Grid instance.
/core-service=management/security-realm=ApplicationRealm/server-
identity=ssl:add(keystore-path="KEYSTORE_NAME",keystore-relative-
to="jboss.server.config.dir",keystore-password="KEYSTORE_PASSWORD")
359
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
/subsystem=datagrid-infinispan-endpoint/hotrod-connector=hotrod-
connector/encryption=ENCRYPTION:add(require-ssl-client-auth=false,security-
realm="ApplicationRealm")
reload
24.3.10. Externalize HTTP Sessions to Red Hat Data Grid Using a Remote Store
NOTE
You need a Red Hat Data Grid subscription to use this functionality.
The instructions here represent an older way of externalizing sessions. JBoss EAP 7.2 introduced a
custom optimized cache store based on the HotRod protocol that integrates with the elytron
subsystem. It is recommended to use the new hotrod store, as described in Externalize HTTP Sessions
to Red Hat Data Grid.
NOTE
For each distributable application, an entirely new cache must be created. It can be
created in an existing cache container, for example, web.
1. Define the location of the remote Red Hat Data Grid server by adding the networking
information to the socket-binding-group.
/socket-binding-group=standard-sockets/remote-destination-outbound-socket-
binding=remote-rhdg-server1:add(host=RHDGHostName1, port=11222)
/socket-binding-group=standard-sockets/remote-destination-outbound-socket-
binding=remote-rhdg-server2:add(host=RHDGHostName2, port=11222)
Resulting XML
NOTE
360
CHAPTER 24. CONFIGURING HIGH AVAILABILITY
NOTE
You will need a remote socket binding configured for each Red Hat Data Grid
server.
2. Ensure the remote cache containers are defined in JBoss EAP’s infinispan subsystem; in the
example below the cache attribute in the remote-store element defines the cache name on
the remote Red Hat Data Grid server.
If you are running in a managed domain, precede these commands with
/profile=PROFILE_NAME.
/subsystem=infinispan/cache-container=web/invalidation-cache=rhdg:add(mode=SYNC)
/subsystem=infinispan/cache-container=web/invalidation-
cache=rhdg/component=locking:write-attribute(name=isolation,value=REPEATABLE_READ)
/subsystem=infinispan/cache-container=web/invalidation-
cache=rhdg/component=transaction:write-attribute(name=mode,value=BATCH)
/subsystem=infinispan/cache-container=web/invalidation-
cache=rhdg/store=remote:add(remote-servers=["remote-rhdg-server1","remote-rhdg-
server2"], cache=default, socket-timeout=60000, passivation=false, purge=false,
shared=true)
Resulting XML
<subsystem xmlns="urn:jboss:domain:infinispan:7.0">
...
<cache-container name="web" default-cache="dist"
module="org.wildfly.clustering.web.infinispan" statistics-enabled="true">
<transport lock-timeout="60000"/>
<invalidation-cache name="rhdg" mode="SYNC">
<locking isolation="REPEATABLE_READ"/>
<transaction mode="BATCH"/>
<remote-store cache="default" socket-timeout="60000" remote-servers="remote-rhdg-
server1 remote-rhdg-server2" passivation="false" purge="false" shared="true"/>
</invalidation-cache>
...
</cache-container>
</subsystem>
3. Add cache information into the application jboss-web.xml file. In the following example, web is
the name of the cache container and rhdg is the name of the appropriate cache located in this
container.
361
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
version="10.0">
<replication-config>
<replication-granularity>SESSION</replication-granularity>
<cache-name>web.rhdg</cache-name>
</replication-config>
</jboss-web>
HTTP over plain text (http), supporting HTTP/1 and HTTP/2 ( h2c)
HTTP over secured connection (https), supporting HTTP/1 and HTTP/2 ( h2)
AJP (ajp)
You can either define a static load balancer and specify the back-end hosts in your configuration, or use
the mod_cluster front end to dynamically update the hosts.
This procedure assumes that you are running in a managed domain and already have the following
configured:
This server uses the load-balancer profile, which is bound to the load-balancer-sockets
socket binding group.
NOTE
Two JBoss EAP servers, which will act as the back-end servers.
These servers are running in a cluster and use the ha profile, which is bound to the ha-
sockets socket binding group.
The below steps load balance servers in a managed domain, but they can be adjusted to apply to a set of
362
CHAPTER 24. CONFIGURING HIGH AVAILABILITY
The below steps load balance servers in a managed domain, but they can be adjusted to apply to a set of
standalone servers. Be sure to update the management CLI command values to suit your environment.
Use the following management CLI command to set the mod_cluster advertise security key.
/profile=ha/subsystem=modcluster/proxy=default:write-attribute(name=advertise-security-key,
value=mypassword)
/profile=load-balancer/subsystem=undertow/configuration=filter/mod-cluster=load-
balancer:write-attribute(name=security-key,value=mypassword)
IMPORTANT
The load balancer JBoss EAP server can now load balance the two back-end JBoss EAP servers.
The following example adds an ajp-listener, a server, and a host to the undertow server. It also adds a
new mod_cluster configuration that registers the host using the advertise mechanism.
/socket-binding-group=standard-sockets/socket-binding=ajp-other:add(port=8010)
/subsystem=undertow/server=other-server:add
/subsystem=undertow/server=other-server/ajp-listener=ajp-other:add(socket-binding=ajp-other)
/subsystem=undertow/server=other-server/host=other-host:add(default-web-module=root-other.war)
/subsystem=undertow/server=other-server/host=other-host
/location=other:add(handler=welcome-content)
/subsystem=undertow/server=other-server/host=other-host:write-attribute(name=alias,value=
[localhost]))
/socket-binding-group=standard-sockets/socket-binding=modcluster-other:add(multicast-
address=224.0.1.106,multicast-port=23364)
/subsystem=modcluster/proxy=other:add(advertise-socket=modcluster-other,balancer=other-
balancer,connector=ajp-other)
reload
363
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
subsystem and the different affinity options, see The distributable-web subsystem for Distributable
Web Session Configurations in the Development Guide for JBoss EAP.
The default delimiter that separates the node routes is .. If you want a different value, you can configure
the delimiter attribute of the affinity resource.
Procedure
/subsystem=undertow/configuration=filter/mod-cluster=load-balancer/affinity=ranked:add
/subsystem=undertow/configuration=filter/mod-cluster=load-balancer/affinity=ranked:write-
attribute(name=delimiter,value=':')
The following example shows how to configure a JBoss EAP instance to be a static load balancer. The
JBoss EAP instance is located at lb.example.com and will load balance between two additional servers:
server1.example.com and server2.example.com. The load balancer will reverse-proxy to the location
/app and will use the AJP protocol.
/subsystem=undertow/configuration=handler/reverse-proxy=my-handler:add
/socket-binding-group=standard-sockets/remote-destination-outbound-socket-
binding=remote-host1/:add(host=server1.example.com, port=8009)
/socket-binding-group=standard-sockets/remote-destination-outbound-socket-
binding=remote-host2/:add(host=server2.example.com, port=8009)
/subsystem=undertow/configuration=handler/reverse-proxy=my-
handler/host=host1:add(outbound-socket-binding=remote-host1, scheme=ajp, instance-
id=myroute1, path=/test)
364
CHAPTER 24. CONFIGURING HIGH AVAILABILITY
/subsystem=undertow/configuration=handler/reverse-proxy=my-
handler/host=host2:add(outbound-socket-binding=remote-host2, scheme=ajp, instance-
id=myroute2, path=/test)
/subsystem=undertow/server=default-server/host=default-
host/location=\/test:add(handler=my-handler)
When accessing lb.example.com:8080/app, you will now see the content proxied from
server1.example.com and server2.example.com.
See Overview of HTTP Connectors for details on the supported HTTP connectors for each web server.
Once you have decided which web server and HTTP connector to use, see the appropriate section for
information on configuring your connector:
See the mod_cluster, mod_jk, or mod_proxy section for Apache HTTP Server.
See the NSAPI connector section for Oracle iPlanet Web Server.
For the most current information about supported configurations for HTTP connectors, see JBoss EAP
supported configurations.
You also will need to make sure that JBoss EAP is configured to accept requests from external web
servers.
The web servers include software modules which control the way that HTTP requests are routed to
JBoss EAP nodes. Each of these modules varies in how it works and how it is configured. The modules
are configured to balance work loads across multiple JBoss EAP nodes, to move work loads to alternate
servers in case of a failure event, or both.
JBoss EAP supports several different connectors. The one you choose depends on the web server in
use and the functionality you need. See the tables below for comparisons of the supported
configurations and features of the various HTTP connectors that are compatible with JBoss EAP.
NOTE
See Configure Undertow as a Load Balancer Using mod_cluster for using JBoss EAP 7 as
a multi-platform load balancer.
For the most current information about supported configurations for HTTP connectors, see JBoss EAP
365
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
For the most current information about supported configurations for HTTP connectors, see JBoss EAP
supported configurations.
mod_cluster Red Hat JBoss Core Services Red Hat Enterprise Linux, HTTP, HTTPS,
Apache HTTP Server, Red Hat Microsoft Windows Server, AJP,
JBoss Web Server Apache Oracle Solaris WebSocket
HTTP Server, JBoss EAP
(Undertow)
mod_jk Red Hat JBoss Core Services Red Hat Enterprise Linux, AJP
Apache HTTP Server, Red Hat Microsoft Windows Server,
JBoss Web Server Apache Oracle Solaris
HTTP Server
mod_proxy Red Hat JBoss Core Services Red Hat Enterprise Linux, HTTP, HTTPS,
Apache HTTP Server, Red Hat Microsoft Windows Server, AJP
JBoss Web Server Apache Oracle Solaris
HTTP Server
mod_jk Yes No. Directs client requests to the container as long as the
container is available, regardless of application status.
mod_proxy Yes No. Directs client requests to the container as long as the
container is available, regardless of application status.
ISAPI connector Yes No. Directs client requests to the container as long as the
container is available, regardless of application status.
NSAPI connector Yes No. Directs client requests to the container as long as the
container is available, regardless of application status.
366
CHAPTER 24. CONFIGURING HIGH AVAILABILITY
For information on installing Apache HTTP Server, see the JBoss Core Services Apache HTTP Server
Installation Guide.
If the proxy server uses mod_jk, mod_proxy, ISAPI, or NSAPI, it sends requests to JBoss EAP and JBoss
EAP simply provides a response. With mod_cluster, you must also configure your network to allow JBoss
EAP to send information, such as its current load, application lifecycle events, and health status, to the
proxy server to help it determine where to route requests. For more information about configuring a
mod_cluster proxy server, see The mod_cluster HTTP Connector .
/subsystem=undertow:write-attribute(name=instance-id,value=node1)
In the above example, the external web server identifies the current JBoss EAP instance as
node1.
NOTE
Depending on your desired protocol and port configuration, this step may not be
necessary. An HTTP listener is configured in all default JBoss EAP
configurations, and an AJP listener is configured if you are using the ha or full-ha
profile.
You can check whether the required listeners are already configured by reading
the default server configuration:
/subsystem=undertow/server=default-server:read-resource
To add a listener to Undertow, it must have a socket binding. The socket binding is added to the
socket binding group used by your server or server group. The following management CLI
367
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
command adds an ajp socket binding, bound to port 8009, to the standard-sockets socket
binding group
/socket-binding-group=standard-sockets/socket-binding=ajp:add(port=8009)
The following management CLI command adds an ajp listener to Undertow, using the ajp
socket binding.
/subsystem=undertow/server=default-server/ajp-listener=ajp:add(socket-binding=ajp)
The mod_cluster Management Protocol (MCMP) is an additional connection between the JBoss
EAP servers and the Apache HTTP Server with the mod_cluster module enabled. It is used by
the JBoss EAP servers to transmit server-side load-balance factors and lifecycle events back to
the Apache HTTP Server via a custom set of HTTP methods.
Dynamic configuration of Apache HTTP Server with mod_cluster allows JBoss EAP servers to
join the load-balancing arrangement without manual configuration.
JBoss EAP performs the load-balancing factor calculations, rather than relying on the Apache
HTTP Server with mod_cluster. This makes load-balancing metrics more accurate than other
connectors.
The mod_cluster connector gives fine-grained application lifecycle control. Each JBoss EAP
server forwards web application context lifecycle events to the Apache HTTP Server, informing
it to start or stop routing requests for a given context. This prevents end users from seeing
HTTP errors due to unavailable resources.
For more details on the specific configuration options of the modcluster subsystem, see the
ModCluster Subsystem Attributes .
NOTE
Apache HTTP Server is no longer distributed with JBoss Web Server as of version 3.1.0.
See the steps below to configure the mod_cluster module to suit your environment.
NOTE
368
CHAPTER 24. CONFIGURING HIGH AVAILABILITY
NOTE
Red Hat customers can also use the Load Balancer Configuration Tool on the Red Hat
Customer Portal to quickly generate optimal configuration templates for mod_cluster and
other connectors. Note that you must be logged in to access this tool.
Configure mod_cluster
Apache HTTP Server already contains a mod_cluster configuration file, mod_cluster.conf, that loads
the mod_cluster modules and provides basic configuration. The IP address, port, and other settings in
this file, shown below, can be configured to suit your needs.
MemManagerFile cache/mod_cluster
<IfModule manager_module>
Listen 6666
<VirtualHost *:6666>
<Directory />
Require ip 127.0.0.1
</Directory>
ServerAdvertise on
EnableMCPMReceive
<Location /mod_cluster_manager>
SetHandler mod_cluster-manager
Require ip 127.0.0.1
</Location>
</VirtualHost>
</IfModule>
The Apache HTTP Server server is configured as a load balancer and can work with the modcluster
subsystem running on JBoss EAP. You must configure a mod_cluster worker node to make JBoss EAP
aware of mod_cluster.
If you want to disable advertising for mod_cluster and configure a static proxy list instead, see Disable
Advertisement for mod_cluster. For more information on the available mod_cluster configuration
options in Apache HTTP Server, see the Apache HTTP Server mod_cluster Directives
For more details on configuring mod_cluster, see the Configure Load Balancing Using Apache HTTP
Server and mod_cluster section of the JBoss Web Server HTTP Connectors and Load Balancing Guide .
NOTE
369
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
NOTE
The management CLI commands in the following procedure assume that you are using
the full-ha profile in a managed domain. If you are using a profile other than full-ha, use
the appropriate profile name in the command. If you are running a standalone server,
remove the /profile=full-ha completely.
ServerAdvertise Off
# AdvertiseFrequency 5
EnableMCPMReceive
/profile=full-ha/subsystem=modcluster/proxy=default:write-
attribute(name=advertise,value=false)
IMPORTANT
Be sure to continue to the next step to provide the list of proxies. Advertising will
not be disabled if the list of proxies is empty.
First, define the outbound socket bindings in the appropriate socket binding group.
/socket-binding-group=full-ha-sockets/remote-destination-outbound-socket-
binding=proxy1:add(host=10.33.144.3,port=6666)
/socket-binding-group=full-ha-sockets/remote-destination-outbound-socket-
binding=proxy2:add(host=10.33.144.1,port=6666)
370
CHAPTER 24. CONFIGURING HIGH AVAILABILITY
/profile=full-ha/subsystem=modcluster/proxy=default:list-add(name=proxies,value=proxy1)
/profile=full-ha/subsystem=modcluster/proxy=default:list-add(name=proxies,value=proxy2)
The Apache HTTP Server balancer no longer advertises its presence to worker nodes and UDP
multicast is no longer used.
Worker nodes in a managed domain share an identical configuration across a server group. Worker nodes
running as standalone servers are configured individually. The configuration steps are otherwise
identical.
A server group in a managed domain must use the ha or full-ha profile, and the ha-sockets or
full-ha-sockets socket binding group. JBoss EAP ships with a cluster-enabled server group
called other-server-group which meets these requirements.
Use the following management CLI commands to modify the external IP addresses for the
management, public, and unsecure interfaces as appropriate for your environment. Be sure to
replace EXTERNAL_IP_ADDRESS in the command with the actual external IP address of the
host.
/interface=management:write-attribute(name=inet-
address,value="${jboss.bind.address.management:EXTERNAL_IP_ADDRESS}")
/interface=public:write-attribute(name=inet-
address,value="${jboss.bind.address.public:EXTERNAL_IP_ADDRESS}")
/interface=unsecure:write-attribute(name=inet-
address,value="${jboss.bind.address.unsecure:EXTERNAL_IP_ADDRESS}")
reload
a. Start the JBoss EAP slave host, using the appropriate host.xml configuration file.
371
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
$ EAP_HOME/bin/domain.sh --host-config=host-slave.xml
b. Use the following management CLI command to set a unique host name. This example uses
slave1 as the new host name.
/host=EXISTING_HOST_NAME:write-attribute(name=name,value=slave1)
For more information on configuring a host name, see Configure the Name of a Host .
NOTE
For newly configured hosts that need to join a managed domain, you must remove the local
element and add the remote element host attribute that points to the domain controller.
a. Start the JBoss EAP slave host, using the appropriate host.xml configuration file.
$ EAP_HOME/bin/domain.sh --host-config=host-slave.xml
b. Use the following management CLI command to configure the domain controller settings.
/host=SLAVE_HOST_NAME:write-remote-domain-
controller(host=DOMAIN_CONTROLLER_IP_ADDRESS,port=${jboss.domain.master.por
t:9990},security-realm="ManagementRealm")
<domain-controller>
<remote host="DOMAIN_CONTROLLER_IP_ADDRESS"
port="${jboss.domain.master.port:9990}" security-realm="ManagementRealm"/>
</domain-controller>
Be sure to answer yes to the last question, that asks "Is this new user going to be used for one
AS process to connect to another AS process?", so that you are provided with a secret value.
$ EAP_HOME/bin/add-user.sh
372
CHAPTER 24. CONFIGURING HIGH AVAILABILITY
(a): a
Username : slave1
Password : changeme
Re-enter Password : changeme
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 'slave1' for realm 'ManagementRealm'
Is this correct yes/no? yes
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 {JEB} calls.
yes/no? yes
To represent the user add the following to the server-identities definition <secret
value="SECRET_VALUE" />
Copy the Base64-encoded secret value provided from this output, SECRET_VALUE, which
may be used in the next step.
For more information, see the Adding a User to the Master Domain Controller section of the
JBoss EAP How To Configure Server Security guide.
5. Modify the slave host’s security realm to use the new authentication.
You can specify the password by setting the secret value in the server configuration, getting the
password from a credential store or vault, or passing the password as a system property.
Specify the Base64-encoded password value in the server configuration file using the
Management CLI.
Use the following management CLI command to specify the secret value. Be sure to
replace the SECRET_VALUE with the secret value returned from the add-user output from
the previous step.
/host=SLAVE_HOST_NAME/core-service=management/security-
realm=ManagementRealm/server-identity=secret:add(value="SECRET_VALUE")
You will need to reload the server. The --host argument is not applicable for a standalone
server.
reload --host=HOST_NAME
For more information, see the Configuring the Slave Controllers to Use the Credential
section of the JBoss EAP How To Configure Server Security guide.
/host=SLAVE_HOST_NAME/core-service=management/security-
realm=ManagementRealm/server-identity=secret:add(credential-reference=
{store=STORE_NAME,alias=ALIAS}
You will need to reload the server. The --host argument is not applicable for a standalone
server.
373
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
reload --host=HOST_NAME
For more information, see the Credential Store section of the JBoss EAP How To Configure
Server Security guide.
VAULT::secret::password::ODVmYmJjNGMtZDU2ZC00YmNlLWE4ODMtZjQ1NWNm
NDU4ZDc1TElORV9CUkVBS3ZhdWx0.
NOTE
b. Use the following management CLI command to specify the secret value. Be sure to
replace the VAULT_SECRET_VALUE with the masked password generated in the
previous step.
/host=master/core-service=management/security-realm=ManagementRealm/server-
identity=secret:add(value="${VAULT::secret::password::VAULT_SECRET_VALUE}")
You will need to reload the server. The --host argument is not applicable for a
standalone server.
reload --host=HOST_NAME
For more information, see the Password Vault section of the JBoss EAP How To
Configure Server Security guide.
a. Specify the system property for the password in the server configuration file.
Use the following managemente CLI command to configure the secret identity to use
the system property.
/host=SLAVE_HOST_NAME/core-service=management/security-
realm=ManagementRealm/server-
identity=secret:add(value="${server.identity.password}")
You will need to reload the server. The --host argument is not applicable for a
standalone server.
reload --host=master
b. Set the password for the system property when starting the server.
374
CHAPTER 24. CONFIGURING HIGH AVAILABILITY
$ EAP_HOME/bin/domain.sh --host-config=host-slave.xml -
Dserver.identity.password=changeme
WARNING
server.identity.password=changeme
WARNING
$ EAP_HOME/bin/domain.sh --host-config=host-slave.xml --
properties=PATH_TO_PROPERTIES_FILE
Your standalone server, or servers within a server group of a managed domain, are now configured as
mod_cluster worker nodes. If you deploy a clustered application, its sessions are replicated to all cluster
nodes for failover, and it can accept requests from an external web server or load balancer. Each node
of the cluster discovers the other nodes using automatic discovery, by default.
375
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
The fail_on_status parameter must be configured in the httpd configuration file of your load balancer.
Multiple HTTP status codes for fail_on_status can be specified as a comma-separated list. The
following example specifies the HTTP status codes 203 and 204 for fail_on_status.
An old cluster setup that is being made redundant. We will call this cluster ClusterOLD.
1. Set up your new cluster using the steps described in the prerequisites.
2. In both ClusterNEW and ClusterOLD, ensure that the configuration option sticky-session is set
to the default setting of true. Enabling this option means that all new requests made to a cluster
node in any of the clusters will continue to go to the respective cluster node.
/profile=full-ha/subsystem=modcluster/proxy=default:write-attribute(name=sticky-
session,value=true)
3. Set the load-balancing-group to ClusterOLD, assuming that all the cluster nodes in
ClusterOLD are members of the ClusterOLD load-balancing group.
/profile=full-ha/subsystem=modcluster/proxy=default:write-attribute(name=load-balancing-
group,value=ClusterOLD)
4. Add the nodes in ClusterNEW to the mod_cluster configuration individually using the process
described in the Configure a mod_cluster Worker Node section. Additionally, use the
aforementioned procedure and set their load-balancing group to ClusterNEW.
At this point, you can see an output similar to the undermentioned shortened example on the
mod_cluster-manager console:
mod_cluster/<version>
376
CHAPTER 24. CONFIGURING HIGH AVAILABILITY
5. Any old active sessions are within the ClusterOLD group, and any new sessions are created
either within the ClusterOLD or CLusterNEW group. Next, we want to disable the whole
ClusterOLD group, so that its cluster nodes may be removed without causing any error to
currently active client’s sessions.
Click on the Disable Nodes link for LBGroup ClusterOLD on the mod_cluster-manager web
console.
From this point on, only requests belonging to already established sessions will be routed to
members of the ClusterOLD load-balancing group. Any new client’s sessions will be created in
the ClusterNEW group only. As soon as there are no active sessions within ClusterOLD group, we
can safely remove its members.
NOTE
Using Stop Nodes would command the load balancer to stop routing any
requests to this domain immediately. This will force a failover to another load-
balancing group which will cause session data loss to clients, provided there is no
session replication between ClusterNEW and ClusterOLD.
377
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
In addition to using the mod_cluster-manager web console, you can use the JBoss EAP management
CLI to stop or disable a particular context.
Stop a Context
/host=master/server=server-one/subsystem=modcluster:stop-context(context=/my-deployed-
application-context, virtualhost=default-host, waittime=0)
Stopping a context with waittime set to 0, meaning no timeout, instructs the balancer to stop routing
any request to it immediately, which forces failover to another available context.
If you set a timeout value using the waittime argument, no new sessions are created on this context, but
existing sessions will continue to be directed to this node until they complete or the specified timeout
has elapsed. The waittime argument defaults to 10 seconds.
Disable a Context
/host=master/server=server-one/subsystem=modcluster:disable-context(context=/my-deployed-
application-context, virtualhost=default-host)
Disabling a context tells the balancer that no new sessions should be created on this context.
JBoss EAP can accept workloads from an Apache HTTP proxy server. The proxy server accepts client
requests from the web front end, and passes the work to participating JBoss EAP servers. If sticky
sessions are enabled, the same client request always goes to the same JBoss EAP server, unless the
server is unavailable.
mod_jk communicates over the AJP 1.3 protocol. Other protocols can be used with mod_cluster or
mod_proxy. See the Overview of HTTP Connectors for more information.
NOTE
mod_cluster is a more advanced load balancer than mod_jk and is the recommended
HTTP connector. mod_cluster provides all of the functionality of mod_jk, plus additional
features. Unlike the JBoss EAP mod_cluster HTTP connector, an Apache mod_jk HTTP
connector does not know the status of deployments on servers or server groups, and
cannot adapt where it sends its work accordingly.
NOTE
Apache HTTP Server is no longer distributed with JBoss Web Server as of version 3.1.0.
378
CHAPTER 24. CONFIGURING HIGH AVAILABILITY
Use the following steps to load and configure mod_jk in Apache HTTP Server. Note that these steps
assume that you have already navigated to the httpd/ directory for Apache HTTP Server, which will vary
depending on your platform. For more information, see the installation instructions for your platform in
the JBoss Core Services Apache HTTP Server Installation Guide.
NOTE
Red Hat customers can also use the Load Balancer Configuration Tool on the Red Hat
Customer Portal to quickly generate optimal configuration templates for mod_jk and
other connectors. Note that you must be logged in to access this tool.
NOTE
Create a new file called conf.d/mod_jk.conf. Add the following configuration to the file, making
sure to modify the contents to suite your needs.
# JkRequestLogFormat
JkRequestLogFormat "%w %V %T"
379
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
<Location /jkstatus/>
JkMount status
Require ip 127.0.0.1
</Location>
NOTE
The JkMount directive specifies which URLs Apache HTTP Server must forward
to the mod_jk module. Based on the directive’s configuration, mod_jk sends the
received URL to the correct workers. To serve static content directly and only
use the load balancer for Java applications, the URL path must be /application/*.
To use mod_jk as a load balancer, use the value /*, to forward all URLs to mod_jk.
Aside from general mod_jk configuration, this file specifies to load the mod_jk.so module, and
defines where to find the workers.properties file.
NOTE
Create a new file called conf.d/workers.properties. Add the following configuration to the file,
making sure to modify the contents to suite your needs.
# Define Node1
# modify the host as your host IP or DNS name.
worker.node1.port=8009
worker.node1.host=node1.mydomain.com
worker.node1.type=ajp13
worker.node1.ping_mode=A
worker.node1.lbfactor=1
# Define Node2
# modify the host as your host IP or DNS name.
worker.node2.port=8009
worker.node2.host=node2.mydomain.com
worker.node2.type=ajp13
worker.node2.ping_mode=A
worker.node2.lbfactor=1
# Load-balancing behavior
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=node1,node2
worker.loadbalancer.sticky_session=1
380
CHAPTER 24. CONFIGURING HIGH AVAILABILITY
For details on the syntax of the mod_jk workers.properties file and other advanced
configuration options, see mod_jk Worker Properties.
NOTE
Create a new file called conf.d/uriworkermap.properties. Add a line for each URL pattern
to be matched, for example:
For more details on configuring mod_jk, see the Configuring Apache HTTP Server to Load mod_jk
section of the JBoss Web Server HTTP Connectors and Load Balancing Guide .
If you are using one of the default high availability configurations, ha or full-ha, an AJP listener is already
configured.
Apache mod_proxy is an HTTP connector that supports connections over AJP, HTTP, and HTTPS
381
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Apache mod_proxy is an HTTP connector that supports connections over AJP, HTTP, and HTTPS
protocols. mod_proxy can be configured in load-balanced or non-load-balanced configurations, and it
supports the notion of sticky sessions.
The mod_proxy module requires JBoss EAP to have the HTTP, HTTPS or AJP listener configured in the
undertow subsystem, depending on which protocol you plan to use.
NOTE
mod_cluster is a more advanced load balancer than mod_proxy and is the recommended
HTTP connector. mod_cluster provides all of the functionality of mod_proxy, plus
additional features. Unlike the JBoss EAP mod_cluster HTTP connector, an Apache
mod_proxy HTTP connector does not know the status of deployments on servers or
server groups, and cannot adapt where it sends its work accordingly.
NOTE
Apache HTTP Server is no longer distributed with JBoss Web Server as of version 3.1.0.
See the appropriate section below to configure a basic load-balancing or non-load-balancing proxy.
These steps assume that you have already navigated to the httpd/ directory for Apache HTTP Server,
which will vary depending on your platform. For more information, see the installation instructions for
your platform in the JBoss Core Services Apache HTTP Server Installation Guide. These steps also
assume that the necessary HTTP listener has already been configured in the JBoss EAP undertow
subsystem.
NOTE
Red Hat customers can also use the Load Balancer Configuration Tool on the Red Hat
Customer Portal to quickly generate optimal configuration templates for mod_proxy and
other connectors. Note that you must be logged in to access this tool.
<VirtualHost *:80>
# Your domain name
ServerName YOUR_DOMAIN_NAME
ProxyPreserveHost On
382
CHAPTER 24. CONFIGURING HIGH AVAILABILITY
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
NOTE
The default Apache HTTP Server configuration has the mod_proxy_balancer.so module
disabled, as it is incompatible with mod_cluster. In order to complete this task, you will
need to load this module and disable the mod_cluster modules.
To use mod_proxy as a load balancer, and send work to multiple JBoss EAP instances, add the following
configuration to your conf/httpd.conf file. The example IP addresses are fictional. Replace them with
the appropriate values for your environment.
<Proxy balancer://mycluster>
Order deny,allow
Allow from all
<VirtualHost *:80>
# Your domain name
ServerName YOUR_DOMAIN_NAME
ProxyPreserveHost On
ProxyPass / balancer://mycluster/
# The location of the HTML files, and access control information DocumentRoot /var/www
<Directory /var/www>
Options -Indexes
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
The examples above all communicate using the HTTP protocol. You can use AJP or HTTPS protocols
instead, if you load the appropriate mod_proxy modules. See the Apache mod_proxy documentation for
more details.
383
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
To enable sticky sessions for mod_proxy, add the stickysession parameter to the ProxyPass
statement.
You can specify additional parameters to the ProxyPass statement, such as lbmethod and nofailover.
See the Apache mod_proxy documentation for more information on the available parameters.
An HTTP listener is configured in the JBoss EAP default configuration. If you are using one of the
default high availability configurations, ha or full-ha, an AJP listener is also preconfigured.
NOTE
1. Open a browser and log in to the Red Hat Customer Portal JBoss Software Downloads page .
3. Select the latest JBoss Core Services version from the Version drop-down menu.
4. Find the Red Hat JBoss Core Services ISAPI Connectorin the list, and click the Download link.
5. Extract the archive and copy the contents of the sbin directory to a location on your server. The
instructions below assume that the contents were copied to C:\connectors\.
To configure the IIS Redirector Using the IIS Manager (IIS 7):
1. Open the IIS manager by clicking Start → Run, and typing inetmgr.
384
CHAPTER 24. CONFIGURING HIGH AVAILABILITY
4. In the Actions pane, click Add. The Add ISAPI or CGI Restriction window opens.
Description: jboss
Right-click Default Web Site, and click Add Virtual Directory. The Add Virtual Directory
window opens.
Alias: jboss
Click OK to save the values and close the Add Virtual Directory window.
In the Actions pane, click Add. The Add ISAPI Filter window appears.
Executable: C:\connectors\isapi_redirect.dll
Click OK to save the values and close the Add ISAPI Filters window.
Double-click the IIS 7 item in the tree view pane. The IIS 7 Home Features View opens.
In the Group by combo box, select State. The Handler Mappings are displayed in Enabled
and Disabled Groups.
Find ISAPI-dll. If it is in the Disabled group, right-click it and select Edit Feature
Permissions.
385
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Read
Script
Execute
Click OK to save the values, and close the Edit Feature Permissions window.
24.9.2. Configure the ISAPI Connector to Send Client Requests to JBoss EAP
This task configures a group of JBoss EAP servers to accept requests from the ISAPI connector. It does
not include configuration for load-balancing or high-availability failover.
This configuration is done on the IIS server, and assumes that you already have JBoss EAP configured to
accept requests from an external web server . You also need full administrator access to the IIS server
and to have configured IIS to use the ISAPI connector .
If you do not want to use a rewrite.properties file, comment out the last line by placing a #
character at the beginning of the line.
386
CHAPTER 24. CONFIGURING HIGH AVAILABILITY
# images and css files for path /status are provided by worker01
/status=worker01
/images/*=worker01
/css/*=worker01
The following is an example of a workers.properties file. The worker names, worker01 and
worker02, must match the instance-id configured in the JBoss EAP undertow subsystem.
# Entries that define the host and port associated with these workers
# First JBoss EAP server definition, port 8009 is standard port for AJP in EAP
worker.worker01.host=127.0.0.1
worker.worker01.port=8009
worker.worker01.type=ajp13
#Simple example
# Images are accessible under abc path
/app-01/abc/=/app-01/images/
387
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
6. Restart your IIS server by using the net stop and net start commands.
The IIS server is configured to send client requests to the specific JBoss EAP servers you have
configured, on an application-specific basis.
24.9.3. Configure the ISAPI Connector to Balance Client Requests Across Multiple
JBoss EAP Servers
This configuration balances client requests across the JBoss EAP servers you specify. This configuration
is done on the IIS server, and assumes that you already have JBoss EAP configured to accept requests
from an external web server. You also need full administrator access to the IIS server and to have
configured IIS to use the ISAPI connector .
If you do not want to use a rewrite.properties file, comment out the last line by placing a #
character at the beginning of the line.
388
CHAPTER 24. CONFIGURING HIGH AVAILABILITY
# mapping for management console, nodes in cluster can be enabled or disabled here
/jkmanager|/*=status
The following is an example of a workers.properties file. The load balancer is configured near
the end of the file, to comprise workers worker01 and worker02. These worker names must
match the instance-id configured in the JBoss EAP undertow subsystem.
# First EAP server definition, port 8009 is standard port for AJP in EAP
#
# lbfactor defines how much the worker will be used.
# The higher the number, the more requests are served
# lbfactor is useful when one machine is more powerful
# ping_mode=A – all possible probes will be used to determine that
# connections are still working
worker.worker01.port=8009
worker.worker01.host=127.0.0.1
worker.worker01.type=ajp13
worker.worker01.ping_mode=A
worker.worker01.socket_timeout=10
worker.worker01.lbfactor=3
389
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
worker.worker02.lbfactor=1
#Simple example
# Images are accessible under abc path
/app-01/abc/=/app-01/images/
Restart the IIS server.
Restart your IIS server by using the net stop and net start commands.
C:\> net stop was /Y
C:\> net start w3svc
The IIS server is configured to send client requests to the JBoss EAP servers referenced in the
workers.properties file, spreading the load across the servers in a 1:3 ratio. This ratio is derived from
the load-balancing factor, lbfactor, assigned to each server.
NOTE
See the JBoss EAP supported configurations for information on the supported
configurations of Solaris and Oracle iPlanet Web Server.
24.10.1. Configure Oracle iPlanet Web Server to use the NSAPI Connector
Prerequisites
JBoss EAP is installed and configured on each server that will serve as a worker.
Download the NSAPI connector from the Red Hat Customer Portal:
1. Open a browser and log in to the Red Hat Customer Portal JBoss Software Downloads page .
390
CHAPTER 24. CONFIGURING HIGH AVAILABILITY
3. Select the latest JBoss Core Services version from the Version drop-down menu.
4. Find the Red Hat JBoss Core Services NSAPI Connector in the list, ensuring that you select
the correct platform and architecture for your system, and click the Download link.
5. Extract the nsapi_redirector.so file, which is located in either the lib/ or the lib64/ directory,
into either the IPLANET_CONFIG/lib/ or the IPLANET_CONFIG/lib64/ directory.
NOTE
default
invoker
jsp
The following example configuration shows the disabled mappings.
2. Configure the iPlanet Web Server to load the NSAPI connector module.
Add the following lines to the end of the IPLANET_CONFIG/magnus.conf file, modifying file
paths to suit your configuration. These lines define the location of the nsapi_redirector.so
module, as well as the workers.properties file, which lists the workers and their properties.
391
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
The configuration above is for a 32-bit architecture. If you use 64-bit Solaris, change the string
lib/nsapi_redirector.so to lib64/nsapi_redirector.so.
Configure the NSAPI Connector to Balance Client Requests Across Multiple JBoss EAP
Servers
24.10.2. Configure the NSAPI Connector to Send Client Requests to JBoss EAP
This task configures the NSAPI connector to redirect client requests to JBoss EAP servers with no load
balancing or failover. The redirection is done on a per-deployment, and therefore per-URL, basis.
IMPORTANT
You must have already configured the NSAPI connector before continuing with this task.
NOTE
Edit the IPLANET_CONFIG/obj.conf file. Locate the section which starts with <Object
name="default">, and add each URL pattern to match, in the format shown by the example file
below. The string jknsapi refers to the HTTP connector which will be defined in the next step.
The example shows the use of wildcards for pattern matching.
<Object name="default">
[...]
NameTrans fn="assign-name" from="/status" name="jknsapi"
NameTrans fn="assign-name" from="/images(|/*)" name="jknsapi"
NameTrans fn="assign-name" from="/css(|/*)" name="jknsapi"
NameTrans fn="assign-name" from="/nc(|/*)" name="jknsapi"
NameTrans fn="assign-name" from="/jmx-console(|/*)" name="jknsapi"
</Object>
Continue editing the IPLANET_CONFIG/obj.conf file. Add the following directly after the
392
CHAPTER 24. CONFIGURING HIGH AVAILABILITY
Continue editing the IPLANET_CONFIG/obj.conf file. Add the following directly after the
closing tag of the section you have just finished editing: </Object>.
<Object name="jknsapi">
ObjectType fn=force-type type=text/plain
Service fn="jk_service" worker="worker01" path="/status"
Service fn="jk_service" worker="worker02" path="/nc(/*)"
Service fn="jk_service" worker="worker01"
</Object>
The example above redirects requests to the URL path /status to the worker called worker01,
and all URL paths beneath /nc/ to the worker called worker02. The third line indicates that all
URLs assigned to the jknsapi object which are not matched by the previous lines are served to
worker01.
# Entries that define the host and port associated with these workers
worker.worker01.host=127.0.0.1
worker.worker01.port=8009
worker.worker01.type=ajp13
worker.worker02.host=127.0.0.100
worker.worker02.port=8009
worker.worker02.type=ajp13
IPLANET_CONFIG/../bin/stopserv
IPLANET_CONFIG/../bin/startserv
iPlanet Web Server now sends client requests to the URLs you have configured to deployments on
JBoss EAP.
24.10.3. Configure the NSAPI Connector to Balance Client Requests Across Multiple
JBoss EAP Servers
This task configures the NSAPI connector to send client requests to JBoss EAP servers in a load-
balancing configuration.
IMPORTANT
393
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
IMPORTANT
You must have already configured the NSAPI connector before continuing with this task.
NOTE
Edit the IPLANET_CONFIG/obj.conf file. Locate the section which starts with <Object
name="default">, and add each URL pattern to match, in the format shown by the example file
below. The string jknsapi refers to the HTTP connector that will be defined in the next step.
The example shows the use of wildcards for pattern matching.
<Object name="default">
[...]
NameTrans fn="assign-name" from="/status" name="jknsapi"
NameTrans fn="assign-name" from="/images(|/*)" name="jknsapi"
NameTrans fn="assign-name" from="/css(|/*)" name="jknsapi"
NameTrans fn="assign-name" from="/nc(|/*)" name="jknsapi"
NameTrans fn="assign-name" from="/jmx-console(|/*)" name="jknsapi"
NameTrans fn="assign-name" from="/jkmanager/*" name="jknsapi"
</Object>
<Object name="jknsapi">
ObjectType fn=force-type type=text/plain
Service fn="jk_service" worker="status" path="/jkmanager(/*)"
Service fn="jk_service" worker="router"
</Object>
This jksnapi object defines the worker nodes used to serve each path that was mapped to the
name="jksnapi" mapping in the default object. Everything except for URLs matching
/jkmanager/* is redirected to the worker called router.
394
CHAPTER 24. CONFIGURING HIGH AVAILABILITY
worker.worker01.port=8009
worker.worker01.host=127.0.0.1
worker.worker01.type=ajp13
worker.worker01.ping_mode=A
worker.worker01.socket_timeout=10
worker.worker01.lbfactor=3
IPLANET_CONFIG/../bin/stopserv
IPLANET_CONFIG/../bin/startserv
The iPlanet Web Server redirects the URL patterns you have configured to your JBoss EAP servers in a
load-balancing configuration.
395
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Alternative configurations might include starting the server with an alternative socket bindings set or a
secondary configuration.
The available parameters list can be accessed by passing the help switch -h or --help at startup.
-c=<config>, -c <config> Standalone Name of the server configuration file to use. The
default is standalone.xml.
-c=<config>, -c <config> Domain Name of the server configuration file to use. The
default is domain.xml.
396
APPENDIX A. REFERENCE MATERIAL
--cached-dc Domain If the host is not the domain controller and cannot
contact the domain controller at boot, boot using a
locally cached copy of the domain configuration.
397
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
--interprocess-hc-port=<port> Domain Port on which the host controller should listen for
communication from the process controller.
-P=<url>, -P <url>, --properties= Standalone, Load system properties from the given URL.
<url> Domain
398
APPENDIX A. REFERENCE MATERIAL
--start-mode=<mode> Standalone Set the start mode of the server. This option
cannot be used in conjunction with --admin-only.
Valid values are:
-v, -V, --version Standalone, Display the application server version and exit.
Domain
WARNING
The configuration files that ship with JBoss EAP are set up to handle the behavior
of the switches, for example, -b and -u. If you change your configuration files to no
longer use the system property controlled by the switch, then adding it to the
launch command will have no effect.
IMPORTANT
For Red Hat Enterprise Linux 7 and later, RPM service configuration files are loaded using
systemd, so variable expressions are not expanded.
Table A.2. RPM Configuration Files for Red Hat Enterprise Linux 6
399
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
File Description
Table A.3. RPM Configuration Files for Red Hat Enterprise Linux 7 and later
File Description
NOTE
If a property has the same name in both the RPM service configuration file, such as
/etc/sysconfig/eap7-standalone, and in the JBoss EAP startup configuration file, such as
EAP_HOME/bin/standalone.conf, the value that takes precedence is the one in the
JBoss EAP startup configuration file. One such property is JAVA_HOME.
Property Description
JAVAPTH The path where the Java executable files are installed.
WILDFLY_STARTUP_WAIT The number of seconds that the init script will wait until confirming that the
server has launched successfully after receiving a start or restart command.
This property only applies to Red Hat Enterprise Linux 6.
Default value: 60
400
APPENDIX A. REFERENCE MATERIAL
Property Description
WILDFLY_SHUTDOWN_WAIT The number of seconds that the init script will wait for the server to
shutdown before continuing when it receives a stop or restart command.
This property only applies to Red Hat Enterprise Linux 6.
Default value: 20
WILDFLY_CONSOLE_LOG The file that the CONSOLE log handler will be redirected to.
WILDFLY_HOST_CONFIG For a managed domain, this property allows a user to specify the host
configuration file, such as host.xml. It has no value set as the default.
-Dorg.wildfly.openssl.path=PATH_TO_OPENSSL_LIBS
401
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
core-management Register listeners for server lifecycle events and track configuration
changes.
datasources Create and configure datasources and manage JDBC database drivers.
infinispan Configure caching functionality for JBoss EAP high availability services.
jaxrs Enable the deployment and functionality of Jakarta RESTful Web Services
applications.
jca Configure the general settings for the Jakarta Connectors container and
resource adapter deployments.
jgroups Configure the protocol stacks and communication mechanisms for how
servers in a cluster talk to each other.
402
APPENDIX A. REFERENCE MATERIAL
More information for the jpa subsystem can be found in the JBoss EAP
Development Guide.
mail Configure mail server attributes and custom mail transports to create a mail
service that allows applications deployed to JBoss EAP to send mail using
that service.
metrics Displays base metrics from the management model and Java Virtual
Machine (JVM) MBeans. JBoss EAP no longer includes the microprofile-
smallrye-metrics subsystem, so application metrics are no longer
available.
health Exposes the health checks for the JBoss EAP runtime. JBoss EAP no longer
includes the microprofile-smallrye-health subsystem, so application
healthiness checks are no longer available.
naming Bind entries into global JNDI namespaces and configure the remote JNDI
interface.
403
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
remoting Configure settings for inbound and outbound connections for local and
remote services.
discovery The discovery subsystem is currently for internal subsystem use only; it is a
private API and is not available for public use.
security-manager Configure Java security policies to be used by the Java Security Manager.
transactions Configure the Transaction Manager (TM) options, such as timeout values,
transaction logging, and whether to use Java Transaction Service (JTS).
undertow Configure JBoss EAP’s web server and servlet container settings. In JBoss
EAP 6, this functionality was contained in the web subsystem.
404
APPENDIX A. REFERENCE MATERIAL
-dc <value> The domain configuration directory that will contain the properties files.
If it is omitted, the default directory is
EAP_HOME/domain/configuration/.
-sc <value> An alternative standalone server configuration directory that will contain
the properties files. If omitted, the default directory is
EAP_HOME/standalone/configuration/.
-up, --user-properties <value> The name of the alternative user properties file. It can be an absolute
path or it can be a file name used in conjunction with the -sc or -dc
argument that specifies the alternative configuration directory.
-gp, --group-properties <value> The name of the alternative group properties file. It can be an absolute
path or it can be a file name used in conjunction with the -sc or -dc
argument that specifies the alternative configuration directory.
405
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
-u, --user <value> The name of the user. User names can only contain the following
characters, in any number and in any order:
Backslash (\)
Equals (=)
-r, --realm <value> The name of the realm used to secure the management interfaces. If
omitted, the default is ManagementRealm.
-s, --silent Run the add-user script with no output to the console.
NOTE
Attribute names in these tables are listed as they appear in the management model, for
example, when using the management CLI. See the schema definition file located at
EAP_HOME/docs/schema/wildfly-config_5_0.xsd to view the elements as they appear
in the XML, as there may be differences from the management model.
Attribute Description
406
APPENDIX A. REFERENCE MATERIAL
Attribute Description
compact If true, it will format the JSON on one line. There may still be values
containing new lines, so if having the whole record on one line is
important, set escape-new-line or escape-control-characters to
true.
date-separator The separator between the date and the rest of the formatted log
message. This is ignored if include-date is set to false.
escape-control-characters If true, it will escape all control characters, ASCII entries with a decimal
value greater than 32, with the ASCII code in octal. For example, a new
line becomes #012. If true, this will override escape-new-line=false.
escape-new-line If true, it will escape all new lines with the ASCII code in octal:#012.
include-date Whether or not to include the date in the formatted log record.
Attribute Description
disabled-due-to-failure Whether this handler has been disabled due to logging failures (read-
only).
failure-count The number of logging failures since the handler was initialized (read-
only).
max-failure-count The maximum number of logging failures before disabling this handler.
relative-to The name of another previously named path, or of one of the standard
paths provided by the system. If relative-to is provided, the value of
the path attribute is treated as relative to the path specified by this
attribute.
rotate-at-startup Whether the old log file should be rotated at server startup.
407
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Attribute Description
app-name The application name to add to the syslog records as defined in section
6.2.5 of RFC-5424. If not specified it will default to the name of the
product.
disabled-due-to-failure Whether this handler has been disabled due to logging failures (read-
only).
facility The facility to use for syslog logging as defined in section 6.2.1 of RFC-
5424 and section 4.1.1 of RFC-3164.
failure-count The number of logging failures since the handler was initialized (read-
only).
max-failure-count The maximum number of logging failures before disabling this handler.
max-length The maximum length in bytes a log message, including the header, is
allowed to be. If undefined, it will default to 1024 bytes if the syslog-
format is RFC3164, or 2048 bytes if the syslog-format is RFC5424.
protocol The protocol to use for the syslog handler. Must be one and only one of
udp, tcp or tls.
truncate Whether or not a message, including the header, should truncate the
message if the length in bytes is greater than the value of the max-
length attribute. If set to false, messages will be split and sent with
the same header values.
NOTE
Syslog servers vary in their implementation, so not all settings are applicable to all syslog
servers. Testing has been conducted using the rsyslog syslog implementation.
This table lists only the high-level attributes. Each attribute has configuration parameters,
and some have child configuration parameters.
NOTE
Attribute names in this table are listed as they appear in the management model, for
example, when using the management CLI. See the schema definition file located at
EAP_HOME/docs/schema/wildfly-config_5_0.xsd to view the elements as they appear
in the XML, as there may be differences from the management model.
408
APPENDIX A. REFERENCE MATERIAL
any Element indicating that part of the selection criteria for an interface
should be that it meets at least one, but not necessarily all, of the
nested set of criteria.
any-address Empty element indicating that sockets using this interface should be
bound to a wildcard address. The IPv6 wildcard address ( ::) will be used
unless the java.net.preferIPv4Stack system property is set to true,
in which case the IPv4 wildcard address ( 0.0.0.0 ) will be used. If a
socket is bound to an IPv6 anylocal address on a dual-stack machine, it
can accept both IPv6 and IPv4 traffic; if it is bound to an IPv4 (IPv4-
mapped) anylocal address, it can only accept IPv4 traffic.
link-local-address Empty element indicating that part of the selection criteria for an
interface should be whether or not an address associated with it is link-
local.
loopback Empty element indicating that part of the selection criteria for an
interface should be whether or not it is a loopback interface.
multicast Empty element indicating that part of the selection criteria for an
interface should be whether or not it supports multicast.
nic-match A regular expression against which the names of the network interfaces
available on the machine can be matched to find an acceptable
interface.
not Element indicating that part of the selection criteria for an interface
should be that it does not meet any of the nested set of criteria.
point-to-point Empty element indicating that part of the selection criteria for an
interface should be whether or not it is a point-to-point interface.
public-address Empty element indicating that part of the selection criteria for an
interface should be whether or not it has a publicly routable address.
409
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
site-local-address Empty element indicating that part of the selection criteria for an
interface should be whether or not an address associated with it is site-
local.
subnet-match A network IP address and the number of bits in the address' network
prefix, written in slash notation, for example, 192.168.0.0/16.
virtual Empty element indicating that part of the selection criteria for an
interface should be whether or not it is a virtual interface.
NOTE
Attribute names in these tables are listed as they appear in the management model, for
example, when using the management CLI. See the schema definition file located at
EAP_HOME/docs/schema/wildfly-config_5_0.xsd to view the elements as they appear
in the XML, as there may be differences from the management model.
The following tables show the attributes that can be configured for each of the three types of socket
bindings.
socket-binding
remote-destination-outbound-socket-binding
local-destination-outbound-socket-binding
Attribute Description
client-mappings Specifies the client mappings for this socket binding. A client connecting to this
socket should use the destination address specified in the mapping that matches
its desired outbound interface. This allows for advanced network topologies that
use either network address translation, or have bindings on multiple network
interfaces to function. Each mapping should be evaluated in declared order, with
the first successful match used to determine the destination.
fixed-port Whether the port value should remain fixed even if numeric offsets are applied to
the other sockets in the socket group.
410
APPENDIX A. REFERENCE MATERIAL
Attribute Description
interface Name of the interface to which the socket should be bound, or, for multicast
sockets, the interface on which it should listen. This should be one of the declared
interfaces. If not defined, the value of the default-interface attribute from the
enclosing socket binding group will be used.
multicast-address Multicast address on which the socket should receive multicast traffic. If
unspecified, the socket will not be configured to receive multicast.
multicast-port Port on which the socket should receive multicast traffic. Must be configured if
multicast-address is configured.
name The name of the socket. Services needing to access the socket configuration
information will find it using this name. This attribute is required.
port Number of the port to which the socket should be bound. Note that this value can
be overridden if servers apply a port-offset to increment or decrement all port
values.
Attribute Description
fixed-source-port Whether the port value should remain fixed even if numeric offsets are applied to
the other outbound sockets in the socket group.
host The host name or IP address of the remote destination to which this outbound
socket will connect.
port The port number of the remote destination to which the outbound socket should
connect.
source-interface The name of the interface that will be used for the source address of the
outbound socket.
source-port The port number that will be used as the source port of the outbound socket.
Attribute Description
fixed-source-port Whether the port value should remain fixed even if numeric offsets are applied to
the other outbound sockets in the socket group.
411
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Attribute Description
socket-binding-ref The name of the local socket binding that will be used to determine the port to
which this outbound socket connects.
source-interface The name of the interface that will be used for the source address of the
outbound socket.
source-port The port number that will be used as the source port of the outbound socket.
standard-sockets
ha-sockets
full-sockets
full-ha-sockets
load-balancer-sockets
412
APPENDIX A. REFERENCE MATERIAL
413
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
414
APPENDIX A. REFERENCE MATERIAL
415
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Argument Description
--absolute-resources Use this argument to specify a list of absolute file system paths to
reference from its module.xml file. The files specified are not copied
to the module directory.
--allow-nonexistent-resources Use this argument to create empty directories for resources specified
by --resources that do not exist. Themodule add command will fail
if there are resources that do not exist and this argument is not used.
--main-class Use this argument to specify the fully qualified class name that declares
the module’s main method.
--module-root-dir Use this argument if you have defined an external JBoss EAP module
directory to use instead of the default EAP_HOME/modules/
directory.
--name Use this argument to provide the name of the module to add. This
argument is required.
416
APPENDIX A. REFERENCE MATERIAL
Argument Description
--resource-delimiter Use this argument to set a user-defined file path separator for the list
of resources provided to the --resources or absolute-resources
argument. If not set, the file path separator is a colon (: ) for Linux and a
semicolon (; ) for Windows.
--resources Use this argument to specify the resources for this module by providing
a list of file system paths. The files are copied to this module directory
and referenced from its module.xml file. If you a provide a path to a
directory, the directory and its contents are copied to the module
directory. Symbolic links are not preserved; linked resources are copied
to the module directory. This argument is required unless --absolute-
resources or --module-xml is provided.
--slot Use this argument to add the module to a slot other than the default
main slot.
For example, a successful deployment of test-application.war would have a marker file named test-
application.war.deployed.
The following table lists the available marker file types and their meanings.
.deployed System-generated Indicates that the content has been deployed. The content will
be undeployed if this file is deleted.
417
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
.isdeploying System-generated Indicates that the deployment is in progress. This marker file will
be deleted upon completion.
.isundeploying System-generated Triggered by deleting a .deployed file, this indicates that the
content is being undeployed. This marker file will be deleted
upon completion.
.pending System-generated Indicates that the deployment scanner recognizes the need to
deploy content, but an issue is currently preventing auto-
deployment (for example, if content is in the process of being
copied). This marker serves as a global deployment road-block,
meaning that the scanner will not instruct the server to deploy or
undeploy any content while this marker file exists.
.undeployed System-generated Indicates that the content has been undeployed. Deletion of this
marker file has no impact to content redeployment.
NOTE
Attribute names in this table are listed as they appear in the management model, for
example, when using the management CLI. See the schema definition file located at
EAP_HOME/docs/schema/jboss-as-deployment-scanner_2_0.xsd to view the
elements as they appear in the XML, as there may be differences from the management
model.
418
APPENDIX A. REFERENCE MATERIAL
NOTE
Attribute names in this table are listed as they appear in the management model, for
example, when using the management CLI. See the schema definition file located at
EAP_HOME/docs/schema/wildfly-config_5_0.xsd to view the elements as they appear
in the XML, as there may be differences from the management model.
419
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Attribute Description
agent-lib Sets the value of the -agentlib java option, which specifies the Java agent
library.
agent-path Sets the value of the -agentpath java option, which specifies the Java agent
path.
debug-enabled Whether to enable debug. This attribute only applies to JVM configurations at the
server level.
debug-options Specifies the JVM options to use when debug is enabled. This attribute only
applies to JVM configurations at the server level.
heap-size Sets the value of the -Xms option, which specifies the initial heap size allocated
by the JVM.
java-agent Sets the value of the -javaagent java option, which specifies the Java agent.
launch-command Specifies an operating system level command to prefix before the java command
used to launch the server process. For example, you could use the sudo
command to run the Java process as another user.
max-heap-size Sets the value of the -Xmx option, which specifies the maximum heap size
allocated by the JVM.
max-permgen-size Sets the maximum size of the permanent generation. Deprecated: The JVM no
longer provides a separate permanent generation space.
permgen-size Sets the initial permanent generation size. Deprecated: The JVM no longer
provides a separate permanent generation space.
stack-size Sets the value of the -Xss option, which specifies the JVM stack size.
type Specifies which vendor provided the JVM in use. Available options are ORACLE,
IBM, SUN, or OTHER.
The following tables describe the attributes in the mail subsystem for mail sessions and the following
420
APPENDIX A. REFERENCE MATERIAL
The following tables describe the attributes in the mail subsystem for mail sessions and the following
mail server types:
imap
pop3
smtp
custom
NOTE
Attribute names in these tables are listed as they appear in the management model, for
example, when using the management CLI. See the schema definition file located at
EAP_HOME/docs/schema/wildfly-mail_3_0.xsd to view the elements as they appear in
the XML, as there may be differences from the management model.
Attribute Description
from The default "from" address to use if not set when sending.
jndi-name The JNDI name to which the mail session should be bound.
Attribute Description
outbound-socket- Reference to the outbound socket binding for the mail server.
binding-ref
421
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Attribute Description
outbound-socket- Reference to the outbound socket binding for the mail server.
binding-ref
Attribute Description
outbound-socket- Reference to the outbound socket binding for the mail server.
binding-ref
Attribute Description
outbound-socket- Reference to the outbound socket binding for the mail server.
binding-ref
422
APPENDIX A. REFERENCE MATERIAL
Attribute Description
NOTE
Attribute names in this table are listed as they appear in the management model, for
example, when using the management CLI. See the schema definition file located at
EAP_HOME/docs/schema/jboss-as-logging_3_0.xsd to view the elements as they
appear in the XML, as there may be differences from the management model.
Attribute Description
filter-spec An expression value that defines a filter. The following expression defines a filter
that excludes log entries that do not match a pattern: not(match("WFLY.*"))
handlers A list of log handlers that are used by the root logger.
level The lowest level of log message that the root logger records.
NOTE
A filter-spec specified for the root logger is not inherited by other handlers. Instead a
filter-spec must be specified per handler.
NOTE
Attribute names in this table are listed as they appear in the management model, for
example, when using the management CLI. See the schema definition file located at
EAP_HOME/docs/schema/jboss-as-logging_6_0.xsd to view the elements as they
appear in the XML, as there may be differences from the management model.
423
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Attribute Description
category The log category from which log messages will be captured.
filter-spec An expression value that defines a filter. The following expression defines a filter
that does not match a pattern: not(match("WFLY.*"))
level The lowest level of log message that the log category records.
use-parent-handlers If set to true, this category will use the log handlers of the root logger in addition
to any other assigned handlers.
NOTE
Attribute names in these tables are listed as they appear in the management model, for
example, when using the management CLI. See the schema definition file located at
EAP_HOME/docs/schema/jboss-as-logging_6_0.xsd to view the elements as they
appear in the XML, as there may be differences from the management model.
Attribute Description
autoflush If set to true, the log messages will be sent to the handlers assigned file
immediately upon receipt.
enabled If set to true, the handler is enabled and functioning as normal. If set tofalse, the
handler is ignored when processing log messages.
filter-spec An expression value that defines a filter. The following expression defines a filter
that does not match a pattern: not(match("WFLY.*"))
level The lowest level of log message the log handler records.
424
APPENDIX A. REFERENCE MATERIAL
Attribute Description
name The name of the log handler. Deprecated since the handler’s address contains the
name.
target The system output stream where the output of the log handler is sent. This can be
one of the following:
Attribute Description
append If set to true, all messages written by this handler will be appended to the file if it
already exists. If set to false, a new file will be created each time the application
server launches.
autoflush If set to true, the log messages will be sent to the handlers assigned file
immediately upon receipt.
enabled If set to true, the handler is enabled and functioning as normal. If set tofalse, the
handler is ignored when processing log messages.
file The object that represents the file where the output of this log handler is written
to. It has two configuration properties, relative-to and path.
filter-spec An expression value that defines a filter. The following expression defines a filter
that does not match a pattern: not(match("WFLY.*"))
level The lowest level of log message the log handler records.
name The name of the log handler. Deprecated since the handler’s address contains the
name.
425
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Attribute Description
append If set to true, all messages written by this handler will be appended to the file if it
already exists. If set to false, a new file will be created each time the application
server launches.
autoflush If set to true, the log messages will be sent to the handlers assigned file
immediately upon receipt.
enabled If set to true, the handler is enabled and functioning as normal. If set tofalse, the
handler is ignored when processing log messages.
file Object that represents the file to which the output of this log handler is written. It
has two configuration properties, relative-to and path.
filter-spec An expression value that defines a filter. The following expression defines a filter
that does not match a pattern: not(match("WFLY.*")).
level The lowest level of log message the log handler records.
name The name of the log handler. Deprecated since the handler’s address contains the
name.
suffix This string is included in the suffix appended to rotated logs. The format of the
suffix is a dot (.) followed by a date string which is able to be parsed by the
SimpleDateFormat class.
Attribute Description
append If set to true, all messages written by this handler will be appended to the file if it
already exists. If set to false, a new file will be created each time the application
server launches.
autoflush If set to true the log messages will be sent to the handlers assigned file
immediately upon receipt.
426
APPENDIX A. REFERENCE MATERIAL
Attribute Description
enabled If set to true, the handler is enabled and functioning as normal. If set tofalse, the
handler is ignored when processing log messages.
file Object that represents the file where the output of this log handler is written to. It
has two configuration properties, relative-to and path.
filter-spec An expression value that defines a filter. The following expression defines a filter
that does not match a pattern: not(match("WFLY.*"))
level The lowest level of log message the log handler records.
max-backup-index The maximum number of rotated logs that are kept. When this number is reached,
the oldest log is reused. The default is 1.
If the suffix attribute is used, the suffix of rotated log files is included in the
rotation algorithm. When the log file is rotated, the oldest file whose name starts
with name +suffix is deleted, the remaining rotated log files have their numeric
suffix incremented and the newly rotated log file is given the numeric suffix 1.
name The name of the log handler. Deprecated since the handler’s address contains the
name.
rotate-on-boot If set to true, a new log file will be created on server restart. The default isfalse.
rotate-size The maximum size that the log file can reach before it is rotated. A single
character appended to the number indicates the size units: b for bytes, k for
kilobytes, m for megabytes, g for gigabytes. For example, 50m for 50 megabytes.
suffix This string is included in the suffix appended to rotated logs. The format of the
suffix is a dot (.) followed by a date string which is able to be parsed by the
SimpleDateFormat class.
Attribute Description
append If set to true, all messages written by this handler will be appended to the file if it
already exists. If set to false, a new file will be created each time the application
server launches.
427
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Attribute Description
autoflush If set to true, the log messages will be sent to the handlers assigned file
immediately upon receipt.
enabled If set to true, the handler is enabled and functioning as normal. If set tofalse, the
handler is ignored when processing log messages.
file Object that represents the file where the output of this log handler is written to. It
has two configuration properties, relative-to and path.
filter-spec An expression value that defines a filter. The following expression defines a filter
that does not match a pattern: not(match("WFLY.*"))
level The lowest level of log message the log handler records.
max-backup-index The maximum number of rotated logs that are kept. When this number is reached,
the oldest log is reused. The default is 1.
If the suffix attribute is used, the suffix of rotated log files is included in the
rotation algorithm. When the log file is rotated, the oldest file whose name starts
with name +suffix is deleted, the remaining rotated log files have their numeric
suffix incremented and the newly rotated log file is given the numeric suffix 1.
name The name of the log handler. Deprecated since the handler’s address contains the
name.
rotate-on-boot If set to true, a new log file will be created on server restart. The default isfalse.
rotate-size The maximum size that the log file can reach before it is rotated. A single
character appended to the number indicates the size units: b for bytes, k for
kilobytes, m for megabytes, g for gigabytes. For example, 50m for 50 megabytes.
suffix This string is included in the suffix appended to rotated logs. The format of the
suffix is a dot (.) followed by a date string which is able to be parsed by the
SimpleDateFormat class.
Attribute Description
app-name The app name used when formatting the message in RFC5424 format. By default
the app name is java.
428
APPENDIX A. REFERENCE MATERIAL
Attribute Description
enabled If set to true, the handler is enabled and functioning as normal. If set tofalse, the
handler is ignored when processing log messages.
hostname The name of the host from which the messages are being sent. For example, the
name of the host the application server is running on.
level The lowest level of log message the log handler records.
named-formatter Formats the message of the syslog payload. With this attribute, you can
customize the message as required.
Attribute Description
block-on-reconnect If set to true, the write methods will block when attempting to reconnect. This is
only advisable to be set to true if using an asynchronous handler.
enabled If set to true, the handler is enabled and functioning as normal. If set tofalse, the
handler is ignored when processing log messages.
filter-spec An expression value that defines a filter. The following expression defines a filter
that does not match a pattern: not(match("WFLY.*"))
level The lowest level of log message the log handler records.
outbound-socket- The reference to the outbound socket binding for the socket connection.
binding-ref
protocol The protocol the socket should communicate over. Allowed values are TCP, UDP,
or SSL_TCP.
429
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Attribute Description
ssl-context The reference to the defined SSL context. This is only used if protocol is set to
SSL_TCP.
Attribute Description
enabled If set to true, the handler is enabled and functioning as normal. If set tofalse, the
handler is ignored when processing log messages.
filter-spec An expression value that defines a filter. The following expression defines a filter
that does not match a pattern: not(match("WFLY.*"))
level The lowest level of log message the log handler records.
name The name of the log handler. Deprecated since the handler’s address contains the
name.
Attribute Description
enabled If set to true, the handler is enabled and functioning as normal. If set tofalse, the
handler is ignored when processing log messages.
filter-spec An expression value that defines a filter. The following expression defines a filter
that does not match a pattern: not(match("WFLY.*"))
level The lowest level of log message the log handler records.
430
APPENDIX A. REFERENCE MATERIAL
Attribute Description
name The name of the log handler. Deprecated since the handler’s address contains the
name.
overflow-action How this handler responds when its queue length is exceeded. This can be set to
BLOCK or DISCARD. BLOCK makes the logging application wait until there is
available space in the queue. This is the same behavior as an non-async log
handler. DISCARD allows the logging application to continue but the log
message is deleted.
queue-length Maximum number of log messages that will be held by this handler while waiting
for sub-handlers to respond.
subhandlers The list of log handlers to which this async handler passes its log messages.
Symbol Description
%z The time zone, which must be specified before the date (%d). For example,
%z{GMT}%d{HH:mm:ss,SSS}.
431
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Symbol Description
%n A newline character.
%l The source location of the code calling the log method (slow).
%L The line number of the code calling the log method (slow).
Attribute Description
exception-output-type Indicates how the cause of the logged message, if one is available, is added to the
JSON output. The allowed values are:
detailed
formatted
detailed-and-formatted
key-overrides Allows the names of the keys for the JSON properties to be overridden.
432
APPENDIX A. REFERENCE MATERIAL
Attribute Description
print-details Whether or not details should be printed. The details include the source class
name, source file name, source method name, source module name, source
module version and source line number.
NOTE
record-delimiter The value to be used to indicate the end of a record. If set to null no delimiter will
be used at the end of the record. The default value is a line feed.
zone-id The zone ID for formatting the date and time. The system default is used if left
undefined.
Attribute Description
exception-output-type Indicates how the cause of the logged message, if one is available, is added to the
XML output. The allowed values are:
detailed
formatted
detailed-and-formatted
key-overrides Allows the names of the keys for the XML properties to be overridden.
meta-data Sets the meta data to use in the XML format. Properties are added to each log
message.
namespace-uri Sets the namespace URI used for each record if print-namespace attribute is true.
Note that if no namespace-uri is defined and there are overridden keys no
namespace will be written regardless if the print-namespace attribute is set to
true.
433
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Attribute Description
print-details Whether or not details should be printed. The details include the source class
name, source file name, source method name, source module name, source
module version and source line number.
NOTE
record-delimiter The value to be used to indicate the end of a record. If this is null, no delimiter is
used at the end of the record. The default value is a line feed.
zone-id The zone ID for formatting the date and time. The system default is used if left
undefined.
MariaDB jdbc:mariadb://SERVER_NAME:PORT/DATABASE_NAME
MySQL jdbc:mysql://SERVER_NAME:PORT/DATABASE_NAME
Oracle jdbc:oracle:thin:@SERVER_NAME:PORT:ORACLE_SID
PostgreSQL jdbc:postgresql://SERVER_NAME:PORT/DATABASE_NAME
Sybase jdbc:sybase:Tds:SERVER_NAME:PORT/DATABASE_NAME
NOTE
434
APPENDIX A. REFERENCE MATERIAL
NOTE
Attribute names in this table are listed as they appear in the management model, for
example, when using the management CLI. See the schema definition file located at
EAP_HOME/docs/schema/wildfly-datasources_5_0.xsd to view the elements as they
appear in the XML, as there may be differences from the management model.
435
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
connectable Non-XA, XA Enable the use of CMR, which means that a local
resource can reliably participate in an XA transaction.
436
APPENDIX A. REFERENCE MATERIAL
driver-class Non-XA Only The fully-qualified name of the JDBC driver class.
driver-name Non-XA, XA Defines the JDBC driver the datasource should use.
It is a symbolic name matching the name of installed
driver. If the driver is deployed as JAR, the name is
the name of the deployment.
437
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
FailingConnectionOnly
Only the failing connection is removed. This is the
default setting.
InvalidIdleConnections
The failing connection and idle connections that
share the same credentials and are returned as
invalid by the
ValidatingManagedConnectionFactory.getInvalid
Connections(…) method are removed.
IdleConnections
The failing connection and idle connections that
share the same credentials are removed.
Gracefully
The failing connection and idle connections that
share the same credentials are removed. Active
connections that share the same credentials are
destroyed upon return to the pool.
EntirePool
The failing connection and idle and active
connections that share the same credentials are
removed. This setting is not recommended for
production systems.
AllInvalidIdleConnections
The failing connection and idle connections that
are returned as invalid by the
ValidatingManagedConnectionFactory.getInvalid
Connections(…) method are removed.
AllIdleConnections
The failing connection and all idle connections are
removed.
AllGracefully
The failing connection and all idle connections are
removed. Active connections are destroyed upon
return to the pool.
AllConnections
The failing connection and all idle and active
connections are removed. This setting is not
recommended for production systems.
438
APPENDIX A. REFERENCE MATERIAL
439
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
recovery-username XA Only The user name to use to connect to the resource for
recovery.
440
APPENDIX A. REFERENCE MATERIAL
set-tx-query-timeout Non-XA, XA Whether to set the query timeout based on the time
remaining until transaction timeout. Any configured
query timeout will be used if no transaction exists.
spy Non-XA, XA Enable spy functionality on the JDBC layer. This logs
all JDBC traffic to the datasource. Note that the
logging category jboss.jdbc.spy must also be set
to the log level DEBUG in the logging subsystem.
441
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
TRANSACTION_READ_UNCOMMITT
ED
TRANSACTION_READ_COMMITTED
TRANSACTION_REPEATABLE_REA
D
TRANSACTION_SERIALIZABLE
TRANSACTION_NONE
url-property XA Only The property for the URL property in the xa-
datasource-property values.
442
APPENDIX A. REFERENCE MATERIAL
443
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Name Description
AveragePoolTime The average time that a connection spent in the pool.This value
is in milliseconds.
MaxPoolTime The maximum time for a connection in the pool. This value is in
milliseconds.
444
APPENDIX A. REFERENCE MATERIAL
Name Description
MaxWaitTime The maximum time spent waiting for an exclusive lock on the
pool. This value is in milliseconds.
TotalBlockingTime The total time spent waiting for an exclusive lock on the pool.
This value is in milliseconds.
TotalPoolTime The total time spent by connections in the pool. This value is in
milliseconds.
XACommitTotalTime The total time for all XAResource commit invocations. This value
is in milliseconds.
XAEndAverageTime The average time for an XAResource end invocation. This value
is in milliseconds.
XAEndMaxTime The maximum time for an XAResource end invocation. This value
is in milliseconds.
XAEndTotalTime The total time for all XAResource end invocations. This value is in
milliseconds.
445
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Name Description
XAForgetTotalTime The total time for all XAResource forget invocations. This value is
in milliseconds.
XAPrepareTotalTime The total time for all XAResource prepare invocations. This value
is in milliseconds.
XARecoverTotalTime The total time for all XAResource recover invocations. This value
is in milliseconds.
XARollbackTotalTime The total time for all XAResource rollback invocations. This value
is in milliseconds.
XAStartAverageTime The average time for an XAResource start invocation. This value
is in milliseconds.
446
APPENDIX A. REFERENCE MATERIAL
Name Description
XAStartTotalTime The total time for all XAResource start invocations. This value is
in milliseconds.
Name Description
PreparedStatementCacheAccessCount The number of times that the statement cache was accessed.
PreparedStatementCacheHitCount The number of times that statements from the cache were used.
NOTE
Attribute names in this table are listed as they appear in the management model, for
example, when using the management CLI. See the schema definition file located at
EAP_HOME/docs/schema/wildfly-agroal_1_0.xsd to view the elements as they appear
in the XML, as there may be differences from the management model.
Attribute Description
447
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Attribute Description
Attribute Description
password The password to use for basic authentication with the database.
username The username to use for basic authentication with the database.
Attribute Description
448
APPENDIX A. REFERENCE MATERIAL
Attribute Description
NOTE
Attribute names in this table are listed as they appear in the management model, for
example, when using the management CLI. See the schema definition file located at
EAP_HOME/docs/schema/wildfly-txn_5_0.xsd to view the elements as they appear in
the XML, as there may be differences from the management model.
Attribute Description
default-timeout The default transaction timeout. This defaults to 300 seconds. You can
override this programmatically, on a per-transaction basis.
jdbc-action-store-drop-table Whether JDBC action store should drop tables. The default is false.
jdbc-action-store-table-prefix Optional prefix for table used to write transaction logs in configured
JDBC action store.
jdbc-communication-store-drop- Whether JDBC communication store should drop tables. The default is
table false.
jdbc-communication-store-table- Optional prefix for table used to write transaction logs in configured
prefix JDBC communication store.
jdbc-state-store-drop-table Whether JDBC state store should drop tables. The default is false.
449
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Attribute Description
jdbc-state-store-table-prefix Optional prefix for table used to write transaction logs in configured
JDBC state store.
journal-store-enable-async-io Whether AsyncIO should be enabled for the journal store or not.
Defaults to false. The server should be restarted for this setting to
take effect.
node-identifier The node identifier for the transaction manager. If this option is not set,
you will see a warning upon server startup. This option is required in the
following situations:
object-store-path A relative or absolute file system path where the transaction manager
object store stores data. By default relative to the object-store-
relative-to parameter’s value. If object-store-relative-to is set to an
empty string, this value is treated as an absolute path.
450
APPENDIX A. REFERENCE MATERIAL
Attribute Description
process-id-socket-binding The name of the socket binding configuration to use if the transaction
manager should use a socket-based process ID. Will be undefined if
process-id-uuid is true; otherwise must be set.
process-id-uuid Set to true to use the process identifier to create a unique identifier for
each transaction. Otherwise, the socket-based mechanism is used.
Defaults to true. See process-id-socket-max-ports for more
information. To enable process-id-socket-binding, set process-id-
uuid to false.
socket-binding Specifies the name of the socket binding used by the transaction
periodic recovery listener when recovery-listener is set to true.
status-socket-binding Specifies the socket binding to use for the transaction status manager.
This configuration option is not supported.
use-jdbc-store Use the JDBC store for writing transaction logs. Set to true to enable
and to false to use the default log store type.
451
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Attribute Description
expose-all-logs Whether to expose all logs. The default is false, meaning that only a
subset of transaction logs is exposed.
type Specifies the implementation type of the logging store. The default is
default.
Attribute Description
batch-size The batch size for this CMR resource. The default is 100.
immediate-cleanup Whether to perform immediate cleanup for this CMR resource. The
default is true.
name The table name for storing XIDs. The default is xids.
NOTE
Attribute names in this table are listed as they appear in the management model, for
example, when using the management CLI. See the schema definition file located at
EAP_HOME/docs/schema/wildfly-iiop-openjdk_3_0.xsd to view the elements as they
appear in the XML, as there may be differences from the management model.
Attribute Description
authentication-context The name of the authentication context used when the security
initializer is set to elytron .
452
APPENDIX A. REFERENCE MATERIAL
Attribute Description
client-requires Value that indicates the client SSL required parameters. Valid
values are None, ServerAuth, ClientAuth , and MutualAuth.
Deprecated: Use client-requires-ssl instead.
client-requires-ssl Indicates whether IIOP connections from the server require SSL.
client-ssl-context The name of the SSL context used to create client-side SSL
sockets.
client-supports Value that indicates the client SSL supported parameters. Valid
values are None, ServerAuth, ClientAuth , and MutualAuth.
Deprecated: Use client-requires-ssl instead.
453
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Attribute Description
security-domain The name of the security domain that holds the keystores and
truststores that will be used to establish SSL connections.
server-requires Value that indicates the server SSL required parameters. Valid
values are None, ServerAuth, ClientAuth , and MutualAuth.
Deprecated: Use server-requires-ssl instead.
server-ssl-context The name of the SSL context used to create server-side SSL
sockets.
server-supports Value that indicates the server SSL supported parameters. Valid
values are None, ServerAuth, ClientAuth , and MutualAuth.
Deprecated: Use server-requires-ssl instead.
socket-binding The name of the socket binding configuration that specifies the
ORB port.
ssl-socket-binding The name of the socket binding configuration that specifies the
ORB SSL port.
454
APPENDIX A. REFERENCE MATERIAL
Attribute Description
NOTE
Attribute names in these tables are listed as they appear in the management model, for
example, when using the management CLI. See the schema definition file located at
EAP_HOME/docs/schema/wildfly-resource-adapters_5_0.xsd to view the elements as
they appear in the XML, as there may be differences from the management model.
Attribute Description
bootstrap-context The unique name of the bootstrap context that should be used.
module The module from which the resource adapter will be loaded.
transaction-support The transaction support level of the resource adapter. Valid values are
NoTransaction, LocalTransaction, or XATransaction .
wm-elytron-security-domain Defines the name of the Elytron security domain that should be used.
wm-security Toggle on/off wm.security for this resource adapter. In case of false,
all wm-security-* parameters are ignored, even the defaults.
wm-security-default-groups A default groups list that should be added to the used Subject
instance.
455
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Attribute Description
wm-security-default-principal A default principal name that should be added to the used Subject
instance.
NOTE
If your resource adapter is using bootstrap-context along with a work manager that has
elytron-enabled set to true, you must use the wm-elytron-security-domain attribute
instead of the wm-security-domain attribute for security domain specification.
Attribute Description
use-java-context Setting this to false will bind the object into global JNDI.
Attribute Description
456
APPENDIX A. REFERENCE MATERIAL
Attribute Description
background-validation-millis The amount of time, in milliseconds, that background validation will run.
Changing this value requires a server restart.
capacity-decrementer-class Class defining the policy for decrementing connections in the pool.
capacity-incrementer-class Class defining the policy for incrementing connections in the pool.
class-name The fully qualified class name of a managed connection factory or admin
object.
connectable Enable the use of CMR. This feature means that a local resource can
reliably participate in an XA transaction.
457
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Attribute Description
flush-strategy Specifies how the pool should be flushed in case of an error. Valid values
are:
FailingConnectionOnly
Only the failing connection is removed. This is the default setting.
InvalidIdleConnections
The failing connection and idle connections that share the same
credentials and are returned as invalid by the
ValidatingManagedConnectionFactory.getInvalidConnections(…)
method are removed.
IdleConnections
The failing connection and idle connections that share the same
credentials are removed.
Gracefully
The failing connection and idle connections that share the same
credentials are removed. Active connections that share the same
credentials are destroyed upon return to the pool.
EntirePool
The failing connection and idle and active connections that share the
same credentials are removed. This setting is not recommended for
production systems.
AllInvalidIdleConnections
The failing connection and idle connections that are returned as
invalid by the
ValidatingManagedConnectionFactory.getInvalidConnections(…)
method are removed.
AllIdleConnections
The failing connection and all idle connections are removed.
AllGracefully
The failing connection and all idle connections are removed. Active
connections are destroyed upon return to the pool.
AllConnections
The failing connection and all idle and active connections are
removed. This setting is not recommended for production systems.
idle-timeout-minutes The maximum time, in minutes, a connection may be idle before being
closed. The actual maximum time depends also on the IdleRemover
scan time, which is half of the smallest idle-timeout-minutes value of
any pool. Changing this value requires a server restart.
458
APPENDIX A. REFERENCE MATERIAL
Attribute Description
no-tx-separate-pool Oracle does not like XA connections getting used both inside and
outside a Jakarta Transactions transaction. To workaround the problem
you can create separate sub-pools for the different contexts.
pool-prefill Specifies if the pool should be prefilled. Changing this value requires a
server restart.
recovery-plugin-class-name The fully qualified class name of the recovery plugin implementation.
459
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Attribute Description
sharable Enable the use of sharable connections, which allows lazy association to
be enabled if supported.
use-fast-fail When set to true, fail a connection allocation on the first try if it is
invalid. When set to false, keep trying until the pool is exhausted of all
potential connections.
use-java-context Setting this to false will bind the object into global JNDI.
Name Description
ActiveCount The number of active connections. Each of the connections is either in use by an
application or available in the pool
460
APPENDIX A. REFERENCE MATERIAL
Name Description
AverageBlockingTime The average time spent blocking on obtaining an exclusive lock on the pool. The
value is in milliseconds.
AverageCreationTime The average time spent creating a connection. The value is in milliseconds.
MaxCreationTime The maximum time it took to create a connection. The value is in milliseconds.
MaxWaitCount The maximum number of requests waiting for a connection at the same time.
MaxWaitTime The maximum time spent waiting for an exclusive lock on the pool.
TotalBlockingTime The total time spent waiting for an exclusive lock on the pool. The value is in
milliseconds.
TotalCreationTime The total time spent creating connections. The value is in milliseconds.
NOTE
Attribute names in these tables are listed as they appear in the management model, for
example, when using the management CLI. See the schema definition file located at
EAP_HOME/docs/schema/wildfly-undertow_4_0.xsd to view the elements as they
appear in the XML, as there may be differences from the management model.
Main Attributes
461
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Filter Attributes
Handler Attributes
Server Attributes
application-security-domain
setting
single-sign-on
application-security-domain Attributes
462
APPENDIX A. REFERENCE MATERIAL
single-sign-on Attributes
key-alias Alias of the private key entry used for signing and
verifying back-channel logout connection.
463
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
buffer-size 1024 The size of the buffers. Smaller buffers allow space
to be utilized more effectively.
464
APPENDIX A. REFERENCE MATERIAL
servlet-container
mime-mapping
setting
crawler-session-management
jsp
persistent-sessions
session-cookie
websockets
welcome-file
servlet-container Attributes
default-buffer-cache default The buffer cache to use for caching static resources.
465
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
disable-file-watch-service false If set to true, then the file watch service will not be
used to monitor exploded deployments for changes.
This attribute overrides the io.undertow.disable-
file-system-watcher system property.
466
APPENDIX A. REFERENCE MATERIAL
mime-mapping Attributes
crawler-session-management Attributes
Configures special session handling for crawler bots.
NOTE
/subsystem=undertow/servlet-container=default/setting=crawler-session-
management:add
/subsystem=undertow/servlet-container=default/setting=crawler-session-
management:read-resource
jsp Attributes
NOTE
When using the management CLI to manage the jsp element, it is available under
settings in the servlet-container element. For example:
/subsystem=undertow/servlet-container=default/setting=jsp:read-resource
467
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
468
APPENDIX A. REFERENCE MATERIAL
persistent-sessions Attributes
NOTE
/subsystem=undertow/servlet-container=default/setting=persistent-sessions:add
/subsystem=undertow/servlet-container=default/setting=persistent-sessions:read-
resource
session-cookie Attributes
NOTE
When using the management CLI to manage the session-cookie element, it is available
under settings in the servlet-container element. For example:
/subsystem=undertow/servlet-container=default/setting=session-cookie:add
/subsystem=undertow/servlet-container=default/setting=session-cookie:read-resource
469
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
websockets Attributes
NOTE
When using the management CLI to manage the websockets element, it is available
under settings in the servlet-container element. For example:
/subsystem=undertow/servlet-container=default/setting=websockets:read-resource
welcome-file Attributes
Defines a welcome file and has no options.
Filter Attributes
These components can be found at /subsystem=undertow/configuration=filter.
custom-filter Filters
470
APPENDIX A. REFERENCE MATERIAL
error-page Filters
The error pages
expression-filter Filters
A filter parsed from the Undertow expression language.
gzip Filters
Defines the gzip filter and has no attributes.
mod-cluster Filters
The mod-cluster filter component has the following structure:
mod-cluster
balancer
load-balancing-group
node
context
471
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
http2-header-table-size 4096 The size of the header table used for HPACK
compression, in bytes. This amount of memory will be
allocated per connection for compression. Larger
values use more memory but may give better
compression.
http2-initial-window-size 65535 The flow control window size, in bytes, that controls
how quickly the client can send data to the server.
472
APPENDIX A. REFERENCE MATERIAL
NOTE
473
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
worker default The XNIO worker that is used to send the advertise
notifications.
load-balancing-group Attributes
Defines a load balancing group and has no options.
474
APPENDIX A. REFERENCE MATERIAL
uri The URI that the load balancer uses to connect to the
node.
request-limit Filters
475
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
response-header Filters
Response header filter allows you to add custom headers.
rewrite Filters
Handler Attributes
These components can be found at /subsystem=undertow/configuration=handler.
file Attributes
476
APPENDIX A. REFERENCE MATERIAL
path Path on the file system from where file handler will
serve resources.
reverse-proxy attributes
The reverse-proxy handler component has the following structure:
reverse-proxy
host
477
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
NOTE
enable-http2 false If true, then the proxy will attempt to use HTTP/2 to
connect to the back end. If it is not supported, it will
fall back to HTTP/1.1.
Server Attributes
The server component has the following structure:
server
478
APPENDIX A. REFERENCE MATERIAL
ajp-listener
host
filter-ref
location
filter-ref
setting
access-log
console-access-log
http-invoker
single-sign-on
http-listener
https-listener
server Attributes
ajp-listener Attributes
479
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
decode-url true If this is true then the parser will decode the URL and
query parameters using the selected character
encoding, defaulting to UTF-8. If this is false they will
not be decoded. This will allow a later handler to
decode them into whatever charset is desired.
480
APPENDIX A. REFERENCE MATERIAL
record-request-start-time false Whether to record the request start time, to allow for
request time to be logged. This has a small but
measurable performance impact.
secure false If this is true, then requests that originate from this
listener are marked as secure, even if the request is
not using HTTPS.
481
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
host Attributes
default-response-code 404 If set, this will be response code sent back in case
requested context does not exist on server.
filter-ref Attributes
482
APPENDIX A. REFERENCE MATERIAL
location Attributes
filter-ref Attributes
access-log Attributes
NOTE
When using the management CLI to manage the access-log element, it is available under
settings in the host element. For example:
/subsystem=undertow/server=default-server/host=default-host/setting=access-log:add
/subsystem=undertow/server=default-server/host=default-host/setting=access-
log:read-resource
483
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
extended false Whether the log uses the extended log file format.
pattern common The access log pattern. For details about the options
available for this attribute, see Provided Undertow
Handlers in the JBoss EAP Development Guide.
NOTE
/subsystem=undertow/server=d
efault-server/http-
listener=default:write-
attribute(name=record-
request-start-time,value=true)
use-server-log false Whether the log should be written to the server log,
rather than a separate file.
console-access-log Attributes
484
APPENDIX A. REFERENCE MATERIAL
attributes {remote-host= Specifies log data to include in the console access log
{},remote- output, or customizations to default data.
user={},date-
time=
{},request-
line=
{},response-
code={},bytes-
sent={}}
http-invoker Attributes
path wildfly-services The path that the services are installed under.
single-sign-on Attributes
NOTE
485
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
NOTE
When using the management CLI to manage the single-sign-on element, it is available
under settings in the host element. For example:
/subsystem=undertow/server=default-server/host=default-host/setting=single-sign-
on:add
/subsystem=undertow/server=default-server/host=default-host/setting=single-sign-
on:read-resource
IMPORTANT
http-listener Attributes
486
APPENDIX A. REFERENCE MATERIAL
decode-url true Whether the parser will decode the URL and query
parameters using the selected character encoding,
defaulting to UTF-8. If this is false they will not be
decoded. This will allow a later handler to decode
them into whatever charset is desired.
http2-header-table-size 4096 The size, in bytes, of the header table used for
HPACK compression. This amount of memory will be
allocated per connection for compression. Larger
values use more memory but may give better
compression.
http2-initial-window-size 65535 The flow control window size, in bytes, that controls
how quickly the client can send data to the server.
487
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
488
APPENDIX A. REFERENCE MATERIAL
record-request-start-time false Whether to record the request start time, to allow for
request time to be logged. This has a small but
measurable performance impact.
489
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
https-listener Attributes
decode-url true Whether the parser will decode the URL and query
parameters using the selected character encoding,
defaulting to UTF-8. If this is false they will not be
decoded. This will allow a later handler to decode
them into whatever charset is desired.
490
APPENDIX A. REFERENCE MATERIAL
http2-header-table-size 4096 The size, in bytes, of the header table used for
HPACK compression. This amount of memory will be
allocated per connection for compression. Larger
values use more memory but may give better
compression.
http2-initial-window-size 65535 The flow control window size, in bytes, that controls
how quickly the client can send data to the server.
491
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
492
APPENDIX A. REFERENCE MATERIAL
record-request-start-time false Whether to record the request start time, to allow for
request time to be logged. This has a small but
measurable performance impact.
secure false If this is true then requests that originate from this
listener are marked as secure, even if the request is
not using HTTPS.
verify-client NOT_REQUES The desired SSL client authentication mode for SSL
TED channels. Deprecated: Where an SSLContext is
referenced it should be configured directly for the
required mode of client verification.
493
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Name Description
bytes-received The number of bytes that have been received by this listener.
bytes-sent The number of bytes that have been sent out on this listener.
error-count The number of 500 responses that have been sent by this listener.
processing-time The total processing time of all requests handed by this listener.
Name Description
bytes-received The number of bytes that have been received by this listener.
bytes-sent The number of bytes that have been sent out on this listener.
error-count The number of 500 responses that have been sent by this listener.
processing-time The total processing time of all requests handed by this listener.
494
APPENDIX A. REFERENCE MATERIAL
Name Description
bytes-received The number of bytes that have been received by this listener.
bytes-sent The number of bytes that have been sent out on this listener.
error-count The number of 500 responses that have been sent by this listener.
processing-time The total processing time of all requests handed by this listener.
HTTP Method Jakarta Server Pages Static HTML Static HTML by File Handler
GET OK OK OK
POST OK NOT_ALLOWED OK
HEAD OK OK OK
NOTE
For servlets, the default behavior depends on its implementation, except for the TRACE
method, which has a default behavior of NOT_ALLOWED.
NOTE
495
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
NOTE
Attribute names in these tables are listed as they appear in the management model, for
example, when using the management CLI. See the schema definition file located at
EAP_HOME/docs/schema/wildfly-remoting_4_0.xsd to view the elements as they
appear in the XML, as there may be differences from the management model.
IMPORTANT
The above attributes of the remoting element are deprecated. These attributes should
now be configured using the io subsystem.
496
APPENDIX A. REFERENCE MATERIAL
receive-buffer-size 8192 The size of the largest buffer that this endpoint will
accept over a connection.
send-buffer-size 8192 The size of the largest buffer that this endpoint will
transmit over a connection.
497
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
NOTE
When using the management CLI to update the endpoint element, it is available under
configuration in the remoting element. For example:
/subsystem=remoting/configuration=endpoint/.
Connector Attributes
The connector component has the following structure:
connector
property
security
sasl
property
sasl-policy
policy
sasl-protocol remote The protocol to pass into the SASL mechanisms used
for authentication.
498
APPENDIX A. REFERENCE MATERIAL
Security Attributes
The security component allows you to configure the security for the connector, but contains no direct
configuration attributes. It can be configured using its nested components, such as sasl.
499
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
high
medium
low
sasl-policy Attributes
The sasl-policy component allows you to specify an optional policy to use to narrow down the available
set of mechanisms, but contains no direct configuration attributes. It can be configured using its nested
components, such as policy.
500
APPENDIX A. REFERENCE MATERIAL
http-connector
sasl-protocol remote The protocol to pass into the SASL mechanisms used
for authentication.
501
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
outbound-connection
property
NOTE
The above property attributes are related to the XNIO Options that will be used during
the connection creation.
remote-outbound-connection
502
APPENDIX A. REFERENCE MATERIAL
local-outbound-connection
NOTE
Attribute names in these tables are listed as they appear in the management model, for
example, when using the management CLI. See the schema definition file located at
EAP_HOME/docs/schema/wildfly-io_3_0.xsd to view the elements as they appear in
the XML, as there may be differences from the management model.
503
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
task-core-threads 2 The number of threads for the core task thread pool.
The following are example templates used for the various Jakarta Server Faces modules required when
504
APPENDIX A. REFERENCE MATERIAL
The following are example templates used for the various Jakarta Server Faces modules required when
installing a different Jakarta Server Faces version for JBoss EAP. See Installing a Jakarta Server Faces
Implementation for full instructions.
NOTE
Be sure to use the appropriate values for the following replaceable variables in the
template:
IMPL_NAME
VERSION
<dependencies>
<module name="javax.faces.api:IMPL_NAME-VERSION"/>
<module name="javaee.api"/>
<module name="javax.servlet.jstl.api"/>
<module name="org.apache.xerces" services="import"/>
<module name="org.apache.xalan" services="import"/>
<module name="org.jboss.weld.core"/>
<module name="org.jboss.weld.spi"/>
<module name="javax.xml.rpc.api"/>
<module name="javax.rmi.api"/>
<module name="org.omg.api"/>
</dependencies>
<resources>
<resource-root path="impl-VERSION.jar"/>
</resources>
</module>
NOTE
Be sure to use the appropriate values for the following replaceable variables in the
template:
IMPL_NAME
VERSION
505
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
<dependencies>
<module name="javax.faces.api:IMPL_NAME-VERSION">
<imports>
<include path="META-INF/**"/>
</imports>
</module>
<module name="javaee.api"/>
<module name="javax.servlet.jstl.api"/>
<module name="org.apache.xerces" services="import"/>
<module name="org.apache.xalan" services="import"/>
<resources>
<resource-root path="IMPL_NAME-impl-VERSION.jar"/>
</resources>
</module>
NOTE
Be sure to use the appropriate values for the following replaceable variables in the
template:
IMPL_NAME
VERSION
506
APPENDIX A. REFERENCE MATERIAL
<resources>
<resource-root path="jsf-api-VERSION.jar"/>
</resources>
</module>
NOTE
Be sure to use the appropriate values for the following replaceable variables in the
template:
IMPL_NAME
VERSION
<resources>
<resource-root path="myfaces-api-VERSION.jar"/>
</resources>
</module>
NOTE
Be sure to use the appropriate values for the following replaceable variables in the
template:
IMPL_NAME
VERSION
INJECTION_VERSION
WELD_VERSION
507
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
<resources>
<resource-root path="wildfly-jsf-injection-INJECTION_VERSION.jar"/>
<resource-root path="weld-core-jsf-WELD_VERSION.jar"/>
</resources>
<dependencies>
<module name="com.sun.jsf-impl:IMPL_NAME-VERSION"/>
<module name="java.naming"/>
<module name="java.desktop"/>
<module name="org.jboss.as.jsf"/>
<module name="org.jboss.as.web-common"/>
<module name="javax.servlet.api"/>
<module name="org.jboss.as.ee"/>
<module name="org.jboss.as.jsf"/>
<module name="javax.enterprise.api"/>
<module name="org.jboss.logging"/>
<module name="org.jboss.weld.core"/>
<module name="org.jboss.weld.api"/>
<module name="javax.faces.api:IMPL_NAME-VERSION"/>
</dependencies>
</module>
NOTE
Be sure to use the appropriate values for the following replaceable variables in the
template:
IMPL_NAME
VERSION
INJECTION_VERSION
WELD_VERSION
<resources>
<resource-root path="wildfly-jsf-injection-INJECTION_VERSION.jar"/>
<resource-root path="weld-jsf-WELD_VERSION.jar"/>
</resources>
<dependencies>
<module name="com.sun.jsf-impl:IMPL_NAME-VERSION"/>
<module name="javax.api"/>
<module name="org.jboss.as.web-common"/>
508
APPENDIX A. REFERENCE MATERIAL
<module name="javax.servlet.api"/>
<module name="org.jboss.as.jsf"/>
<module name="org.jboss.as.ee"/>
<module name="org.jboss.as.jsf"/>
<module name="javax.enterprise.api"/>
<module name="org.jboss.logging"/>
<module name="org.jboss.weld.core"/>
<module name="org.jboss.weld.api"/>
<module name="org.wildfly.security.elytron"/>
<module name="javax.faces.api:IMPL_NAME-VERSION"/>
</dependencies>
</module>
NOTE
Be sure to use the appropriate value for the VERSION replaceable variable in the
template.
<resources>
<resource-root path="commons-digester-VERSION.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="org.apache.commons.collections"/>
<module name="org.apache.commons.logging"/>
<module name="org.apache.commons.beanutils"/>
</dependencies>
</module>
Main Attributes
Channel Attributes
Stack Attributes
NOTE
Attribute names in these tables are listed as they appear in the management model, for
example, when using the management CLI. See the schema definition file located at
EAP_HOME/docs/schema/jboss-as-jgroups_5_0.xsd to view the elements as they
appear in the XML, as there may be differences from the management model.
509
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Channel Attributes
The channel element has the following structure:
channel
fork
protocol
protocol
channel Attributes
Stack Attributes
The stack element has the following structure:
stack
protocol
relay
remote-site
transport
thread-pool
510
APPENDIX A. REFERENCE MATERIAL
stack Attributes
statistics-enabled false Indicates whether or not all protocols in the stack will
collect statistics.
protocol Attributes
For a list of commonly used protocols, see the JGroups Protocols section.
module org.jgroups The module with which to resolve the protocol type.
relay Attributes
module org.jgroups The module with which to resolve the protocol type.
remote-site Attributes
511
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
transport Attributes
rack Rack, such as the server rack, identifier for this node.
Used by Infinispan’s topology-aware consistent hash.
site Site, such as the data center, identifier for this node.
Used by Infinispan’s topology-aware consistent hash.
512
APPENDIX A. REFERENCE MATERIAL
thread-pool Attributes
min-threads 2 The core thread pool size, which is smaller than max-
threads . If undefined, the core thread pool size is
the same as max-threads.
ASYM_ENCRYPT Encryption Uses a secret key, stored in a coordinator on the cluster, for
encrypting messages between cluster members.
azure.AZURE_PIN Discovery Supports node discovery using Microsoft Azure’s blob storage.
G
FD_ALL Failure Detection Provides failure detection based on a simple heartbeat protocol.
FD_SOCK Failure Detection Provides failure detection based on a ring of TCP sockets
created between cluster members.
513
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
MERGE3 Merge Merges the subclusters together in the event of a cluster split.
MFC Flow Control Provides multicast flow control between a sender and all cluster
members.
pbcast.GMS Group Handles group membership, including new members joining the
Membership cluster, leave requests by existing members, and SUSPECT
messages for crashed members.
pbcast.NAKACK2 Message Ensures message reliability and order, guaranteeing that all
Transmission messages sent by one sender will be received in the order they
were sent.
pbcast.STABLE Message Stability Deletes messages that have been seen by all members.
PING Discovery Initial discovery of members, with support for dynamic discovery
of cluster members.
TCPPING Discovery Contains a static list of cluster member’s addresses to form the
cluster.
UFC Flow Control Provides unicast flow control between a sender and all cluster
members
UNICAST3 Message Ensures message reliability and order for unicast messages,
Transmission guaranteeing that all messages sent by one sender will be
received in the order they were sent.
VERIFY_SUSPECT Failure Detection Verifies that a suspected member has died by pinging the
member one final time before evicting it.
514
APPENDIX A. REFERENCE MATERIAL
module org.jgroups The module with which to resolve the protocol type.
Authentication Protocols
The authentication protocols are used to perform authentication, and are primarily responsible for
ensuring that only authenticated members can join the cluster. These protocols sit below the GMS
protocol, so that they may listen for requests to join the cluster.
AUTH
SASL
AUTH Attributes
While the AUTH protocol contains no additional attributes, it must have a token defined as a child
element.
NOTE
When defining this protocol, the auth-protocol element is used instead of the protocol
element.
Token Types
When using Elytron for security, it is recommended to use one of the following authentication tokens.
These authentication tokens were intentionally designed for use with Elytron, and may not be used with
legacy security configurations.
Token Description
cipher-token An authentication token where the shared secret is transformed. RSA is the
default algorithm used for the transformation.
digest-token An authentication token where the shared secret is transformed. SHA-256 is the
default algorithm used for the transformation.
The following authentication tokens are inherited from JGroups, and are eligible for use in any
configuration where authentication is desired.
515
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Token Description
MD5Token An authentication token where the shared secret is encrypted using either an MD5
or SHA hash. MD5 is the default algorithm used for the encryption.
X509Token An authentication token where the shared secret is encrypted using an X509
certificate.
SASL Attributes
516
APPENDIX A. REFERENCE MATERIAL
Discovery Protocols
The following protocols are used to find an initial membership for the cluster, which can then be used to
determine the current coordinator. A list of the discovery protocols are below.
AZURE_PING
JDBC_PING
MPING
PING
S3_PING
TCPGOSSIP
TCPPING
AZURE_PING Attributes
container The name of the blob container to use for PING data.
This must be a valid DNS name.
JDBC_PING Attributes
NOTE
When defining a JDBC_PING protocol, the jdbc-protocol element is used instead of the
protocol element.
517
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
S3_PING Attributes
80 if
use_
ssl is
false.
TCPGOSSIP Attributes
518
APPENDIX A. REFERENCE MATERIAL
NOTE
TCPPING Attributes
NOTE
Encrypt Protocols
The following protocols are used to secure the communication stack. Encryption is based on a shared
secret key that all members of the cluster have. This key is either acquired from a shared keystore, when
using SYM_ENCRYPT or from a public/private key exchange, when using ASYM_ENCRYPT. When
defining any of the following protocols an encrypt-protocol element is created in the resulting XML.
NOTE
If using ASYM_ENCRYPT, then the same stack must have an AUTH protocol defined.
The AUTH protocol is optional when using SYM_ENCRYPT.
ASYM_ENCRYPT
SYM_ENCRYPT
ASYM_ENCRYPT Attributes
519
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
SYM_ENCRYPT Attributes
FD_ALL
FD_SOCK
VERIFY_SUSPECT
Merge Protocols
If the cluster becomes split, then the MERGE3 protocol is responsible for merging the subclusters back
520
APPENDIX A. REFERENCE MATERIAL
together. While this protocol is responsible for merging the cluster members back together, this will not
merge the state of the cluster. The application is responsible for handling the callback to merge states.
This protocol does not have any additional attributes beyond the generic attributes.
Message Stability
The pbcast.STABLE protocol is responsible for garbage collecting messages that have been seen by all
members of the cluster. This protocol initiates a stable message containing message numbers for a given
member, called a digest. Once all members of the cluster have received the others' digests, then the
message may be removed from the retransmission table. This protocol does not have any additional
attributes beyond the generic attributes.
pbcast.NAKACK2
pbcast.UNICAST3
Deprecated Protocols
The following protocols have been deprecated, and have been replaced by a protocol that contains only
the class name. For instance, instead of specifying org.jgroups.protocols.ASYM_ENCRYPT, the
protocol name would be ASYM_ENCRYPT.
org.jgroups.protocols.ASYM_ENCRYPT
org.jgroups.protocols.AUTH
org.jgroups.protocols.JDBC_PING
org.jgroups.protocols.SYM_ENCRYPT
org.jgroups.protocols.TCPGOSSIP
org.jgroups.protocols.TCPPING
NOTE
521
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
NOTE
mod_manager
The context of a mod_manager directive is VirtualHost in all cases, except when mentioned otherwise.
server config context implies that the directive must be outside a VirtualHost configuration. If not, an
error message is displayed and the Apache HTTP Server does not start.
522
APPENDIX A. REFERENCE MATERIAL
523
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
<Location /mod_cluster-
manager>
SetHandler mod_cluster-
manager
Require ip 127.0.0.1
</Location>
NOTE
524
APPENDIX A. REFERENCE MATERIAL
NOTE
proxy
load-provider=dynamic
custom-load-metric
load-metric
load-provider=simple
ssl
The load-provider=dynamic resource allows you to configure factors, such as CPU, sessions, heap,
memory, and weight to determine the load balancing behavior.
The load-provider=simple resource allows setting only a static constant as the factor attribute. This
helps when the user does not need dynamic or complex rules to load balance the incoming HTTP
requests.
NOTE
Attribute names in these tables are listed as they appear in the management model, for
example, when using the management CLI. See the schema definition file located at
EAP_HOME/docs/schema/jboss-as-mod-cluster_3_0.xsd to view the elements as they
appear in the XML, as there may be differences from the management model.
525
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
526
APPENDIX A. REFERENCE MATERIAL
DEFAULT
Drain sessions before web application undeploy
only if the web application is non-distributable.
ALWAYS
Always drain sessions before web application
undeploy, even for distributable web applications.
NEVER
Do not drain sessions before web application
undeploy.
527
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
528
APPENDIX A. REFERENCE MATERIAL
type The type of the metric. Valid values are cpu , mem ,
heap , sessions, receive-traffic, send-traffic,
requests, or busyness .
529
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
Property Description
worker.list A comma separated list of worker names that will be used by mod_jk.
Property Description
type The type of worker. The default type is ajp13. Other possible values areajp14, lb,
status. For more information on these directives, see the Apache Tomcat
Connectors Reference at https://tomcat.apache.org/connectors-
doc/reference/workers.html.
Property Description
balance_workers Specifies the worker nodes that the load balancer must manage. You can use the
directive multiple times for the same load balancer. It consists of a comma-
separated list of worker node names.
sticky_session Specifies whether requests from the same session are always routed to the same
worker. The default is 1, meaning that sticky sessions are enabled. To disable
sticky sessions, set it to 0. Sticky sessions should usually be enabled, unless all of
your requests are truly stateless.
Property Description
host The host name or IP address of the back-end server. The back-end server must
support the ajp protocol stack. The default value is localhost.
port The port number of the back-end server instance listening for defined protocol
requests. The default value is 8009, which is the default listening port for AJP13
workers. The default value for AJP14 workers is 8011.
530
APPENDIX A. REFERENCE MATERIAL
Property Description
ping_mode The conditions under which connections are probed for network status. The
probe uses an empty AJP13 packet for CPing, and expects a CPong in response.
Specify the conditions by using a combination of directive flags. The flags are not
separated by a comma or any white-space. The ping_mode can be any
combination of C, P, I, and A.
A - All. A shortcut for CPI, which specifies that all connection probes are
used.
ping_timeout, The timeout values for the connection probe settings above. The value is
connect_timeout, specified in milliseconds, and the default value for ping_timeout is 10000 .
prepost_timeout,
connection_ping_interva
l
lbfactor Specifies the load-balancing factor for an individual back-end server instance.
This is useful to give a more powerful server more of the workload. To give a
worker 3 times the default load, set this to 3: worker.my_worker.lbfactor=3
The example below demonstrates load balancing with sticky sessions between two worker nodes, node1
and node2, listening on port 8009.
# Define Node1
# modify the host as your host IP or DNS name.
worker.node1.port=8009
worker.node1.host=node1.mydomain.com
worker.node1.type=ajp13
worker.node1.ping_mode=A
worker.node1.lbfactor=1
# Define Node2
# modify the host as your host IP or DNS name.
worker.node2.port=8009
worker.node2.host= node2.mydomain.com
worker.node2.type=ajp13
531
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
worker.node2.ping_mode=A
worker.node2.lbfactor=1
# Load-balancing behavior
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=node1,node2
worker.loadbalancer.sticky_session=1
Further configuration details for Apache mod_jk are out of the scope of this document and can be found
in the Apache documentation.
NOTE
Attribute names in this table are listed as they appear in the management model, for
example, when using the management CLI. See the schema definition file located at
EAP_HOME/docs/schema/wildfly-security-manager_1_0.xsd to view the elements as
they appear in the XML, as there may be differences from the management model.
Attribute Description
NOTE
On Red Hat Enterprise Linux 8, standard system OpenSSL is supported thus installation
of OpenSSL from JBoss Core Services is not necessary anymore.
NOTE
532
APPENDIX A. REFERENCE MATERIAL
NOTE
1. Download the OpenSSL package from the Software Downloads page that pertains to your
operating system and architecture.
You can add the OpenSSL path to the JAVA_OPTS variable in the standalone.conf or
domain.conf configuration file using the following argument.
JAVA_OPTS="$JAVA_OPTS -Dorg.wildfly.openssl.path=JBCS_OPENSSL_PATH
You can define a system property that specifies the OpenSSL path using the following
management CLI command.
/system-property=org.wildfly.openssl.path:add(value=JBCS_OPENSSL_PATH)
IMPORTANT
Regardless of the method you use, you must perform a server restart for
either the JAVA_OPTS value or the system property to take effect. A server
reload is not sufficient.
1. Ensure that the system is registered to the JBoss Core Services channel:
a. Determine the JBoss Core Services CDN repository name for your operating system
version and architecture:
RHEL 6: jb-coreservices-1-for-rhel-6-server-rpms
RHEL 7: jb-coreservices-1-for-rhel-7-server-rpms
3. Once the installation completes, the JBCS OpenSSL libraries will be available in /opt/rh/jbcs-
533
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
3. Once the installation completes, the JBCS OpenSSL libraries will be available in /opt/rh/jbcs-
httpd24/root/usr/lib64, or just /opt/rh/jbcs-httpd24/root/usr/lib on x86 architecture.
You can update the WILDFLY_OPTS variable for the eap7-standalone or eap7-domain
settings in the service configuration file.
WILDFLY_OPTS="$WILDFLY_OPTS -
Dorg.wildfly.openssl.path=JBCS_OPENSSL_PATH"
You can define a system property that specifies the OpenSSL path using the following
management CLI command.
/system-property=org.wildfly.openssl.path:add(value=JBCS_OPENSSL_PATH)
IMPORTANT
Regardless of the method you use, you must perform a server restart for
either the WILDFLY_OPTS value or the system property to take effect. A
server reload is not sufficient.
You can reconfigure the elytron subsystem to give OpenSSL priority so that it is used in all
cases by default.
NOTE
Although OpenSSL is installed in the elytron subsystem, it is not the default TLS
provider.
/subsystem=elytron:write-attribute(name=initial-providers, value=combined-providers)
/subsystem=elytron:undefine-attribute(name=final-providers)
reload
In the elytron subsystem, the OpenSSL provider can also be specified on the ssl-context
resource. That way, the OpenSSL protocol can be selected on a case-by-case basis instead of
using the default priority.
To create the ssl-context resource and use the OpenSSL libraries in your Elytron-based
SSL/TLS configuration, use the following command.
/subsystem=elytron/server-ssl-context=httpsSSC:add(key-manager=localhost-manager,
trust-manager=ca-manager, provider-name=openssl)
reload
534
APPENDIX A. REFERENCE MATERIAL
To use the OpenSSL libraries in your legacy security subsystem SSL/TLS configuration:
/core-service=management/security-realm=ApplicationRealm/server-identity=ssl:write-
attribute(name=protocol,value=openssl.TLSv1.2)
reload
openssl.TLS
openssl.TLSv1
openssl.TLSv1.1
openssl.TLSv1.2
JBoss EAP will automatically try to search for the OpenSSL libraries on the system and use them. You
can also specify a custom OpenSSL libraries location by using the org.wildfly.openssl.path property
during JBoss EAP startup. Only the OpenSSL library version 1.0.2 or greater provided by JBoss Core
Services is supported.
If OpenSSL is loaded properly, you will see a message in the server.log during JBoss EAP startup,
similar to:
java.compiler
java.datatransfer
java.desktop
java.instrument
java.jnlp
java.logging
java.management
java.management.rmi
java.naming
java.prefs
java.rmi
java.scripting
535
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
java.se: This module alias aggregates the following set of base modules:
java.compiler
java.datatransfer
java.desktop
java.instrument
java.logging
java.management
java.management.rmi
java.naming
java.prefs
java.rmi
java.scripting
java.security.jgss
java.security.sasl
java.sql
java.sql.rowset
java.xml
java.xml.crypto
java.security.jgss
java.security.sasl
java.smartcardio
java.sql
java.sql.rowset
java.xml
java.xml.crypto
javafx.base
javafx.controls
javafx.fxml
javafx.graphics
536
APPENDIX A. REFERENCE MATERIAL
javafx.media
javafx.swing
javafx.web
jdk.accessibility
jdk.attach
jdk.compiler
jdk.httpserver
jdk.jartool
jdk.javadoc
jdk.jconsole
jdk.jdi
jdk.jfr
jdk.jsobject
jdk.management
jdk.management.cmm
jdk.management.jfr
jdk.management.resource
jdk.net
jdk.plugin.dom
jdk.scripting.nashorn
jdk.sctp
jdk.security.auth
jdk.security.jgss
jdk.unsupported
jdk.xml.dom
537
Red Hat JBoss Enterprise Application Platform 7.4 Configuration Guide
538