© 2017 The original authors.

1. Getting Started with WildFly 23

WildFly 23 is the latest release in a series of JBoss open-source application server offerings. WildFly 23 is an exceptionally fast, lightweight and powerful implementation of the Jakarta Platform specifications. The state-of-the-art architecture built on the Modular Service Container enables services on-demand when your application requires them. The table below lists the technologies available in WildFly 23 server configuration profiles.

Jakarta EE Platform Technology Jakarta EE Full Platform Jakarta EE Web Profile WildFly 23 Full Platform WildFly 23 Web Profile

Jakarta WebSocket

X

X

X

X

Jakarta JSON Processing 1.1

X

X

X

X

Jakarta JSON Binding Specification 1.0

X

X

X

X

Jakarta Servlet 4.0

X

X

X

X

Jakarta Server Faces 2.3

X

X

X

X

Jakarta Expression Language 3.0

X

X

X

X

Jakarta Server Pages 2.3

X

X

X

X

Jakarta Standard Tag Library 1.2

X

X

X

X

Jakarta Batch 1.0

X

 — 

X

 — 

Jakarta Concurrency

X

X

X

X

Jakarta Contexts and Dependency Injection 2.0

X

X

X

X

Jakarta Dependency Injection

X

X

X

X

Jakarta Bean Validation 2.0

X

X

X

X

Jakarta Enterprise Beans 3.2

XCMP 2.0Optional

X(Lite)

XCMP 2.0Not Available

X(Lite)

Jakarta Interceptors 1.2

X

X

X

X

Jakarta Connectors 1.7

X

 — 

X

X

Jakarta Persistence 2.2

X

X

X

X

Jakarta Annotations 1.3

X

X

X

X

Jakarta Messaging 2.0

X

 — 

X

 — 

Jakarta Transactions 1.3

X

X

X

X

Jakarta Mail 1.6

X

 — 

X

X

Jakarta RESTful Web Services 2.1

X

X

X

X

Jakarta Enterprise Web Services 1.3

X

 — 

X

 — 

Jakarta XML Web Services Specification 2.3

X

X

X

X

Jakarta Web Services Metadata

X

 — 

X

 — 

Jakarta XML RPC 1.1

Optional

 — 

 — 

 — 

Jakarta SOAP with Attachments 1.3

X

 — 

X

 — 

Jakarta XML Registries

Optional

 — 

 — 

 — 

Jakarta XML Binding Specification 2.3

X

X

X

X

Jakarta Authentication 1.1

X

 — 

X

 — 

Jakarta Authorization 1.5

X

 — 

X

 — 

Jakarta EE Application Deployment 1.2

Optional

 — 

 — 

 — 

Jakarta Management 1.1

X

 

X

 

Jakarta Debugging Support for Other Languages 1.0

X

X

X

X

Jakarta Security 1.0

X

X

X

X

Missing ActiveMQ Artemis and Jakarta Messaging?

The WildFly Web Profile doesn’t include Jakarta Messaging (provided by ActiveMQ Artemis) by default. If you want to use messaging, make sure you start the server using the "Full Platform" configuration.

This document provides a quick overview on how to download and get started using WildFly 23 for your application development. For in-depth content on administrative features, refer to the WildFly 23 Admin Guide.

1.1. Download

WildFly 23 distributions can be obtained from:

WildFly 23 provides a single distribution available in zip or tar file formats.

  • wildfly-23.0.0.Final.zip

  • wildfly-23.0.0.Final.tar.gz

1.2. Requirements

  • Java SE 8 or later. We recommend that you use the latest available update of the current long-term support Java release.

1.3. Installation

Simply extract your chosen download to the directory of your choice. You can install WildFly 23 on any operating system that supports the zip or tar formats. Refer to the Release Notes for additional information related to the release.

1.4. WildFly - A Quick Tour

Now that you’ve downloaded WildFly 23, the next thing to discuss is the layout of the distribution and explore the server directory structure, key configuration files, log files, user deployments and so on. It’s worth familiarizing yourself with the layout so that you’ll be able to find your way around when it comes to deploying your own applications.

1.4.1. WildFly Directory Structure

DIRECTORY DESCRIPTION

appclient

Configuration files, deployment content, and writable areas used by the application client container run from this installation.

bin

Start up scripts, start up configuration files and various command line utilities like Vault, add-user and Java diagnostic reportavailable for Unix and Windows environments

bin/client

Contains a client jar for use by non-maven based clients.

docs/schema

XML schema definition files

docs/examples/configs

Example configuration files representing specific use cases

domain

Configuration files, deployment content, and writable areas used by the domain mode processes run from this installation.

modules

WildFly is based on a modular classloading architecture. The various modules used in the server are stored here.

standalone

Configuration files, deployment content, and writable areas used by the single standalone server run from this installation.

welcome-content

Default Welcome Page content

Standalone Directory Structure

In " standalone " mode each WildFly 23 server instance is an independent process (similar to previous JBoss AS versions; e.g., 3, 4, 5, or 6). The configuration files, deployment content and writable areas used by the single standalone server run from a WildFly installation are found in the following subdirectories under the top level "standalone" directory:

DIRECTORY DESCRIPTION

configuration

Configuration files for the standalone server that runs off of this installation. All configuration information for the running server is located here and is the single place for configuration modifications for the standalone server.

data

Persistent information written by the server to survive a restart of the server

deployments

End user deployment content can be placed in this directory for automatic detection and deployment of that content into the server’s runtime.NOTE: The server’s management API is recommended for installing deployment content. File system based deployment scanning capabilities remain for developer convenience.

lib/ext

Location for installed library jars referenced by applications using the Extension-List mechanism

log

standalone server log files

tmp

location for temporary files written by the server

tmp/auth

Special location used to exchange authentication tokens with local clients so they can confirm that they are local to the running AS process.

Domain Directory Structure

A key feature of WildFly 23 is the managing multiple servers from a single control point. A collection of multiple servers are referred to as a " domain ". Domains can span multiple physical (or virtual) machines with all WildFly instances on a given host under the control of a Host Controller process. The Host Controllers interact with the Domain Controller to control the lifecycle of the WildFly instances running on that host and to assist the Domain Controller in managing them. The configuration files, deployment content and writeable areas used by domain mode processes run from a WildFly installation are found in the following subdirectories under the top level "domain" directory:

DIRECTORY DESCRIPTION

configuration

Configuration files for the domain and for the Host Controller and any servers running off of this installation. All configuration information for the servers managed wtihin the domain is located here and is the single place for configuration information.

content

an internal working area for the Host Controller that controls this installation. This is where it internally stores deployment content. This directory is not meant to be manipulated by end users.Note that "domain" mode does not support deploying content based on scanning a file system.

lib/ext

Location for installed library jars referenced by applications using the Extension-List mechanism

log

Location where the Host Controller process writes its logs. The Process Controller, a small lightweight process that actually spawns the other Host Controller process and any Application Server processes also writes a log here.

servers

Writable area used by each Application Server instance that runs from this installation. Each Application Server instance will have its own subdirectory, created when the server is first started. In each server’s subdirectory there will be the following subdirectories:data — information written by the server that needs to survive a restart of the serverlog — the server’s log filestmp — location for temporary files written by the server

tmp

location for temporary files written by the server

tmp/auth

Special location used to exchange authentication tokens with local clients so they can confirm that they are local to the running AS process.

1.4.2. WildFly 23 Configurations

Standalone Server Configurations
  • standalone.xml (default)

    • Jakarta web profile certified configuration with the required technologies plus those noted in the table above.

  • standalone-ha.xml

    • Jakarta web profile certified configuration with high availability

  • standalone-full.xml

    • Jakarta Full Platform certified configuration including all the required technologies

  • standalone-full-ha.xml

    • Jakarta Full Platform certified configuration with high availability

  • standalone-microprofile.xml

    • A configuration oriented toward microservices, providing our MicroProfile platform implementations combined with Jakarta RESTful Web Services and technologies Jakarta RESTful Web Services applications commonly use to integrate with external services.

  • standalone-microprofile-ha.xml

    • A configuration oriented toward microservices, similar to standalone-microprofile.xml but with support for high availability web sessions and distributed Hibernate second level caching.

Domain Server Configurations
  • domain.xml

    • Jakarta full and web profiles available with or without high availability

Important to note is that the domain and standalone modes determine how the servers are managed not what capabilities they provide.

1.4.3. Starting WildFly 23

To start WildFly 23 using the default web profile configuration in " standalone" mode, change directory to $JBOSS_HOME/bin.

./standalone.sh

To start the default web profile configuration using domain management capabilities,

./domain.sh

1.4.4. Starting WildFly with an Alternate Configuration

If you choose to start your server with one of the other provided configurations, they can be accessed by passing the --server-config argument with the server-config file to be used.

To use the Full Platform with clustering capabilities, use the following syntax from $JBOSS_HOME/bin:

./standalone.sh --server-config=standalone-full-ha.xml

Similarly to start an alternate configuration in domain mode:

./domain.sh --domain-config=my-domain-configuration.xml

Alternatively, you can create your own selecting the additional subsystems you want to add, remove, or modify.

Test Your Installation

After executing one of the above commands, you should see output similar to what’s shown below.

=========================================================================
 
  JBoss Bootstrap Environment
 
  JBOSS_HOME: /opt/wildfly-10.0.0.Final
 
  JAVA: java
 
  JAVA_OPTS:  -server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=com.yourkit,org.jboss.byteman -Djava.awt.headless=true
 
=========================================================================
 
11:46:11,161 INFO  [org.jboss.modules] (main) JBoss Modules version 1.5.1.Final
11:46:11,331 INFO  [org.jboss.msc] (main) JBoss MSC version 1.2.6.Final
11:46:11,391 INFO  [org.jboss.as] (MSC service thread 1-6) WFLYSRV0049: WildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final) starting
<snip>
11:46:14,300 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final) started in 1909ms - Started 267 of 553 services (371 services are lazy, passive or on-demand)

As with previous WildFly releases, you can point your browser to http://localhost:8080 (if using the default configured http port) which brings you to the Welcome Screen:

images/wildfly.png

From here you can access links to the WildFly community documentation set, stay up-to-date on the latest project information, have a discussion in the user forum and access the enhanced web-based Administration Console. Or, if you uncover a defect while using WildFly, report an issue to inform us (attached patches will be reviewed). This landing page is recommended for convenient access to information about WildFly 23 but can easily be replaced with your own if desired.

1.4.5. Managing your WildFly 23

WildFly 23 offers two administrative mechanisms for managing your running instance:

  • web-based Administration Console

  • command-line interface

Authentication

By default WildFly 23 is now distributed with security enabled for the management interfaces, this means that before you connect using the administration console or remotely using the CLI you will need to add a new user, this can be achieved simply by using the add-user.sh script in the bin folder.

After starting the script you will be guided through the process to add a new user: -

./add-user.sh
What type of user do you wish to add?
 a) Management User (mgmt-users.properties)
 b) Application User (application-users.properties)
(a):

In this case a new user is being added for the purpose of managing the servers so select option a.

You will then be prompted to enter the details of the new user being added: -

Enter the details of the new user to add.
Realm (ManagementRealm) :
Username :
Password :
Re-enter Password :

It is important to leave the name of the realm as 'ManagementRealm' as this needs to match the name used in the server’s configuration, for the remaining fields enter the new username, password and password confirmation.

Provided there are no errors in the values entered you will then be asked to confirm that you want to add the user, the user will be written to the properties files used for authentication and a confirmation message will be displayed.

The modified time of the properties files are inspected at the time of authentication and the files reloaded if they have changed, for this reason you do not need to re-start the server after adding a new user.

Administration Console

To access the web-based Administration Console, simply follow the link from the Welcome Screen. To directly access the Management Console, point your browser at:

port 9990 is the default port configured.
<management-interfaces>
   <native-interface security-realm="ManagementRealm">
      <socket-binding native="management-native"/>
   </native-interface>
   <http-interface security-realm="ManagementRealm">
      <socket-binding http="management-http"/>
   </http-interface>
</management-interfaces>

If you modify the management-http socket binding in your running configuration: adjust the above command accordingly. If such modifications are made, then the link from the Welcome Screen will also be inaccessible.

If you have not yet added at least one management user an error page will be displayed asking you to add a new user, after a user has been added you can click on the 'Try Again' link at the bottom of the error page to try connecting to the administration console again.

Command-Line Interface

If you prefer to manage your server from the command line (or batching), the jboss-cli.sh script provides the same capabilities available via the web-based UI. This script is accessed from $JBOSS_HOME/bin directory; e.g.,

$JBOSS_HOME/bin/jboss-cli.sh --connect
Connected to standalone controller at localhost:9990

Notice if no host or port information provided, it will default to localhost:9990.

When running locally to the WildFly process the CLI will silently authenticate against the server by exchanging tokens on the file system, the purpose of this exchange is to verify that the client does have access to the local file system. If the CLI is connecting to a remote WildFly installation then you will be prompted to enter the username and password of a user already added to the realm.

Once connected you can add, modify, remove resources and deploy or undeploy applications. For a complete list of commands and command syntax, type help once connected.

1.4.6. Modifying the Example DataSource

As with previous JBoss application server releases, a default data source, ExampleDS , is configured using the embedded H2 database for developer convenience. There are two ways to define datasource configurations:

  1. as a module

  2. as a deployment

In the provided configurations, H2 is configured as a module. The module is located in the $JBOSS_HOME/modules/com/h2database/h2 directory. The H2 datasource configuration is shown below.

<subsystem xmlns="urn:jboss:domain:datasources:1.0">
    <datasources>
        <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS">
            <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url>
            <driver>h2</driver>
            <pool>
                <min-pool-size>10</min-pool-size>
                <max-pool-size>20</max-pool-size>
                <prefill>true</prefill>
            </pool>
            <security>
                <user-name>sa</user-name>
                <password>sa</password>
            </security>
        </datasource>
        <xa-datasource jndi-name="java:jboss/datasources/ExampleXADS" pool-name="ExampleXADS">
           <driver>h2</driver>
           <xa-datasource-property name="URL">jdbc:h2:mem:test</xa-datasource-property>
           <xa-pool>
                <min-pool-size>10</min-pool-size>
                <max-pool-size>20</max-pool-size>
                <prefill>true</prefill>
           </xa-pool>
           <security>
                <user-name>sa</user-name>
                <password>sa</password>
           </security>
        </xa-datasource>
        <drivers>
            <driver name="h2" module="com.h2database.h2">
                <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
            </driver>
        </drivers>
  </datasources>
</subsystem>

The datasource subsystem is provided by the IronJacamar project. For a detailed description of the available configuration properties, please consult the project documentation.

Configure Logging in WildFly

WildFly logging can be configured with the web console or the command line interface. You can get more detail on the Logging Configuration page.

Turn on debugging for a specific category with CLI:

/subsystem=logging/logger=org.jboss.as:add(level=DEBUG)

By default the server.log is configured to include all levels in it’s log output. In the above example we changed the console to also display debug messages.