Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
WildFly Configuration, Deployment, and Administration - Second Edition
WildFly Configuration, Deployment, and Administration - Second Edition

WildFly Configuration, Deployment, and Administration - Second Edition: Build a functional and efficient WildFly server with this step-by-step, practical guide , Second Edition

eBook
$9.99 $32.99
Paperback
$54.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Table of content icon View table of contents Preview book icon Preview Book

WildFly Configuration, Deployment, and Administration - Second Edition

Chapter 1. Installing WildFly

The Java language has undergone many changes since its first release and will continue to adapt to meet the needs of the developer. Oracle, which acquired Sun in 2010, stated that its high-level Java strategy is to enhance and extend the reach of Java to new and emerging software development objectives; simplify, optimize, and integrate the Java platform into new deployment architectures; and invest in the Java developer community allowing for increased participation.

This has certainly been true in the Enterprise edition of Java, the main focus of which has been improved developer productivity, providing support for HTML5, and meeting enterprise demands. Out of all the Enterprise Java releases, Java EE 7 has been the most transparent and open to community participation. By allowing public feedback, the demands of the community can be realized and used to help shape Java EE 7 for the better, ultimately adding to the growth and success of Enterprise Java.

In addition, a large number of open source projects are used within the application server, such as Hibernate and Undertow. Integrating all these libraries does not come without a price because each library has evolved with complexity and requires more and more additional libraries to work.

As most IT experts agree, the challenge for today's application servers is to combine a rich set of features requested by customers along with a lightweight and flexible container configuration.

What's new in WildFly 8?

WildFly 8 is the direct continuation to the JBoss AS project. The renaming of the community version of JBoss AS was done to reduce confusion between the open source JBoss server, the JBoss community, and the JBoss Enterprise Application Platform (JBoss EAP). WildFly 8 is free and open source, with support coming from the JBoss community, whereas JBoss EAP is a licensed product that comes with support from RedHat.

The most notable updates in WildFly 8 from earlier versions are as follows:

  • Java EE7 certification: WildFly is a fully compliant Java EE enterprise server, which means that it provides reference implementations for all Java Specification Requests (JSRs) that make up Java EE 7. JSRs are basically change requests for the Java language. For more information on how JSRs work, refer to https://www.jcp.org/en/jsr/overview.
  • Arrival of Undertow: JBoss Web has been completely removed and replaced with Undertow. Undertow is a cutting-edge web server that supports non-blocking and blocking handlers, web sockets, and asynchronous servlets. It has been designed for scalability and maximum throughput. It is easy to use, easy to configure, and is highly customizable.
  • Port Reduction: The number of open ports has been greatly reduced in WildFly. Only two ports are open: 8080 and 9990. This has been achieved by multiplexing protocols over HTTP using the HTTP upgrade feature of Undertow.
  • Security Manager: You can now configure per-deployment security permissions.
  • Logging: Several enhancements have been made to WildFly logging. You can now view logfiles via the management interface, define custom formatters, and configure logging per-deployment.
  • Clustering: Clustering in WildFly is heavily refactored and includes many new features, including web sessions, single sign-on, and mod_cluster support for Undertow. There is also a new public clustering API and new @Stateful EJB caching implementation.
  • Command-line interface (CLI): You now have the ability to define an alias when connecting to a server, and the CLI GUI has additional functionality allowing you to explore any node in the tree.

In this chapter, we will cover the following topics:

  • Installing the Java environment
  • Installing WildFly 8
  • Installing JBoss tools
  • Exploring the application server filesystem
  • Understanding the WildFly kernel

Getting started with the application server

As far as hardware requirements are concerned, you should be aware that the server distribution, at the time of writing, requires about 150 MB of hard disk space and allocates a minimum of 64 MB and a maximum of 512 MB for a standalone server.

In order to get started, we are going to perform the following steps:

  1. Download and install the Java Development Kit.
  2. Download and install WildFly 8.
  3. Download and install the Eclipse development environment. While we will use Eclipse in this book, you are free to use your IDE of choice.

At the end of this chapter, you will have all the required software installed and will be ready to start working with the application server.

Installing the Java environment

WildFly is written in Java; therefore it needs a Java Virtual Machine (JVM) in which to run, along with the standard edition Java libraries. So, before we can get started setting up or learning about WildFly, we first need to install the Java Development Kit (JDK).

To use WildFly, you will need at least Java SE 7 or above. Although there is no plan to use Java 8 language changes within the WildFly 8.x source code, WildFly is compiled against Java 8. It is recommended that you use the latest version of Java SE 8 to run WildFly.

So, let's move to the Oracle download page, http://www.oracle.com/technetwork/java/javase/downloads/index.html, which now hosts all JDK downloads, as shown in the following screenshot:

Installing the Java environment

This will take you to the download page for the latest JDK. At the time of writing, this was Java 8 update 5. You will need to accept the license agreement before downloading the JDK. Choose to download the latest version of Java for your operating system. Have a look at the following screenshot:

Installing the Java environment

The download will take a few minutes depending how fast your network is.

Installing Java on Linux

Installing Java on Linux is very straightforward. Once the download is complete, extract the tar.gz file to your chosen install location. This command extracts the archive to your current directory:

tar -xzvf jdk-8u5-linux-x64.tar.gz

Next, you need to add the path as an environment variable. This can be achieved by adding the following lines to your user profile script (the .profile file found in your home directory):

export JAVA_HOME=/installDir/jdk1.8.0_05
export PATH=$JAVA_HOME/bin:$PATH

Installing Java on Windows

Windows users can simply run the executable (.exe) file to start the installation. The name of the installer varies depending on the operating system and your system architecture (32-bit or 64-bit); however, the steps will be the same—just the name will change. At the time of writing, the installer for the latest version of Java for 64-bit Windows is called jdk-8u5-windows-x64.exe.

When using Windows, you should stay away from installation paths that include empty spaces, such as C:\Program Files, as this leads to some issues when referencing the core libraries. An installation path such as C:\Software\Java or simply C:\Java is a better alternative.

When the installation is complete, you will need to update a couple of settings on the computer so that it will know where to find Java. The most important setting is JAVA_HOME, which is directly referenced by the WildFly startup script.

If you are running Windows XP/2000, follow these steps:

  1. Right-click on My Computer, and select Properties from the context menu.
  2. On the Advanced tab, click on the Environment Variables button.
  3. Then, in the System variables box, click on New.
  4. Name the new variable JAVA_HOME, and give a value of the path to your JDK installation; I recommend something like C:\Java\jdk1.8.0_05.
    Installing Java on Windows

    Tip

    Windows 7 tip

    Because of increased security in Windows 7, standard users must have User Account Control (UAC) turned on to change the environment variables, and the change must be completed via user accounts. In the User Accounts window, under Tasks, select Change my environment variables. Use the New, Edit, or Delete button to amend environment variables

  5. Now it's time to modify the system's PATH variable. Double-click on the PATH system variable. In the box that pops up, navigate to the end of the Variable Value line, add a semicolon to the end, and then add the path to your JDK. This will be something like %JAVA_HOME%\bin.

Installing WildFly 8

The WildFly application server can be downloaded for free from the WildFly site, http://www.wildfly.org/downloads/. Have a look at the following screenshot:

Installing WildFly 8

You will notice that there is an option to download a minimalistic core distribution. This is aimed at developers who want to build their own application runtime using the WildFly 8 architecture.

Choose to download the full Java EE7 distribution. Like JBoss AS 7, WildFly does not come with an installer. It is simply a matter of extracting the compressed archive to a location of your choosing.

Linux users can extract the file using the tar or unzip command (depending on the type of compressed file you downloaded):

tar -xzvf wildfly-8.1.0.Final.tar.gz
unzip wildfly-8.1.0.Final.zip

For those of you using Windows, you can use WinZip or WinRAR, taking care to choose a folder that does not contain empty spaces.

Tip

Security warning

Unix/Linux users should be aware that WildFly does not require root privileges, as none of the default ports used by WildFly are below the privileged port range of 1024. To reduce the risk of users gaining root privileges through WildFly, install and run WildFly as a non-root user.

Starting WildFly

After installing WildFly, it is wise to perform a simple startup test to validate that there are no problems with your Java configuration. To test your installation, move to the bin directory of your WildFly install and issue the following command:

  • For Linux/Unix users:
    $ ./standalone.sh
    
  • For Windows users:
    > standalone.bat
    

The following screenshot shows a sample WildFly 8 startup console:

Starting WildFly

The preceding command starts up a WildFly standalone instance that's equivalent to starting the application server with the run.sh script used by releases prior to JBoss AS 7. The run.sh file remains in the WildFly bin directory but is merely a placeholder and will not start the application server.

Notice how fast the application server starts. This is due to the modular architecture of WildFly. Essential services are started concurrently on boot-up, and non-critical services are started only when needed, resulting in an exceptionally fast startup. Local caching means that the server will start even quicker second time round!

If you need to customize the startup properties of your application server, then you need to open and modify the standalone.conf file (or standalone.conf.bat for Windows users). This file contains the memory requirements of WildFly. The following is the Linux core section of it:

if [ "x$JAVA_OPTS" = "x" ]; then
   JAVA_OPTS="-Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true"
   JAVA_OPTS="$JAVA_OPTS -Djboss.modules.system.pkgs=$JBOSS_MODULES_SYSTEM_PKGS -Djava.awt.headless=true"
fi

Tip

Java SE 8 users

PermGen has been replaced with Metaspace in Java 8. If you are using Java 8, then remove the -XX:MaxPermSize=256m property from the standalone.conf file, and replace it with -XX:MaxMetaspaceSize=256m. This will prevent VM warnings being printed to your WildFly logs on startup.

By default, the application server starts with a minimum heap space memory requirement of 64 MB and a maximum requirement of 512 MB. This will be just enough to get started; however, if you need to run a core Java EE application on it, you will likely require a minimum of 1 GB of heap space. More realistically, you will need 2 GB or more depending on your application type. Generally speaking, 32-bit machines cannot execute a process whose space exceeds 4 GB; however, on 64-bit machines, there's essentially no limit to process the size.

You can verify that the server is reachable from the network by simply pointing your browser to the application server's welcome page, which is reachable by default at the well-known address: http://localhost:8080. Have a look at the following screenshot:

Starting WildFly

Connecting to the server with the command-line interface

If you have been using releases of the application server prior to JBoss AS 7, you might have heard about the twiddle command-line utility that queries the MBeans installed on the application server. This utility was replaced in JBoss AS 7 and is still used in WildFly. Its replacement is a more sophisticated interface named the command-line interface (CLI), which can be found in the JBOSS_HOME/bin folder.

Tip

References to JBOSS_HOME

Although the community version of JBoss AS has been renamed to WildFly, you will see that the properties in the startup scripts continue to use the property, JBOSS_HOME, to reference the install directory of WildFly. For this reason, we will continue to use JBOSS_HOME when referring to the root install of WildFly.

Just launch the jboss-cli.sh script (or jboss-cli.bat for Windows users), and you will be able to manage the application server via a shell interface, as shown in the following screenshot. Bear in mind that the server needs to be running in order to connect via the CLI.

Connecting to the server with the command-line interface

Once you are in the shell session, if you are unsure of what commands can be issued, you can simply press the Tab button to display all possible commands. If your command is partly typed, and there is only one possible matching command, your command will be autocompleted. Those of you who use Linux will be used to this type of command-line assistance.

In the preceding screenshot, we have just connected to the server using the connect command, which, by default, uses the loopback server address and plugs into port number 9990.

Note

The CLI is discussed in depth in Chapter 7, Using the Management Interfaces, which is all about the server-management interfaces. We will have an initial taste of its basic functionalities in the following sections, to get you accustomed to this powerful tool.

Stopping WildFly

Probably the easiest way to stop WildFly is to send an interrupt signal using Ctrl + C. This should be done in the same console window in which you issued the startup command, that is, where the server is running.

However, if your WildFly process was launched in the background or is running on another machine (see in the following sections), then you can use the CLI interface to issue an immediate shutdown command as follows:

[disconnected /] connect
[standalone@localhost:9990 /] shutdown
[disconnected /]

Locating the shutdown script

There is actually one more option to shut down the application server, which is pretty useful if you need to shut down the server from within a script. This option consists of passing the --connect option to the admin shell, thereby switching off the interactive mode as follows:

jboss-cli.sh --connect command=:shutdown       # Unix / Linux
jboss-cli.bat --connect command=:shutdown      # Windows

Stopping WildFly on a remote machine

Shutting down an application server running on a remote machine is just a matter of connecting and providing the server's remote address to the CLI:

[disconnected /] connect 192.168.1.10

[192.168.1.10:9990 /] shutdown

Note

Remotely accessing WildFly via the CLI requires authentication. Check out Chapter 10, Securing WildFly, for more information about it. It also requires that the management interface on the remote WildFly install is opened to allow remote connections. This is covered in detail in Chapter 7, Using the Management Interfaces.

Restarting WildFly

The CLI contains a lot of useful commands. One of the most helpful options is the ability to reload all or part of the server configuration using the reload command.

When issued on the root node path of the server, WildFly reloads all the services configuration, as shown in the following command:

[disconnected /] connect

[standalone@localhost:9990 /] reload

Installing the Eclipse environment

Although the main focus of this book is the administration of the WildFly application server, we are also concerned with application packaging and deployment. For this reason, we will sometimes add examples that require a development environment to be installed on your machine.

The development environment used in this book is Eclipse. Eclipse is known by developers worldwide and contains a huge set of plugins, building on its core functionality. If you are comfortable with another IDE, then feel free to use it, but this book will demonstrate Eclipse only. At the time of writing this, only Eclipse and NetBeans have plugins for WildFly.

So let's move to the Eclipse download page, located at http://www.eclipse.org/downloads.

From this page, download the latest Enterprise edition. The compressed package contains all the Java EE plugins already installed and requires about 248 MB of disk space. Have a look at the following screenshot:

Installing the Eclipse environment

Tip

If you are using Java 8, you should make sure you download Eclipse Luna (4.4) or the patched Version of 4.3.

Once you have downloaded Eclipse, unzip it to a folder of your choice. The extracted folder will be called eclipse. To start Eclipse, navigate to the eclipse folder and run:

$ ./eclipse

Windows users can simply double-click on the executable file contained in the eclipse folder (the one with the big, blue, round eclipse icon).

Installing JBoss tools

The next step is to install the WildFly 8 adapter, which is a part of the suite of plugins named JBoss tools. Installing new plugins in Eclipse is pretty simple; just perform the following steps:

  1. From the menu, navigate to Help | Eclipse Marketplace.
  2. Then, search for the plugin you want to install (in this case, type jboss tools).
  3. Finally, click on Install as shown in the following screenshot:
    Installing JBoss tools

Make sure you select the version of JBoss tools that matches your version of Eclipse, for example, Luna or Kepler. In this case, we are using Eclipse Luna, so I have selected the Luna version of JBoss tools. If you want to install just the WildFly adapter, select JBossAS Tools. Agree to the terms and click on OK. Restart Eclipse when prompted to do so.

You can now set up the WildFly server in Eclipse by performing the following steps:

  1. Navigate to New | Server.
  2. Expand the JBoss Community node.
  3. Select the option, WildFly 8, as shown in the following screenshot:
    Installing JBoss tools
  4. Make sure you select your installed Java 8 JRE.
  5. Point the home directory to that of your WildFly root directory, as shown in the following screenshot:
    Installing JBoss tools

Exploring the application server filesystem

Now that we are done with the installation of all the necessary tools, we will concentrate on the application server structure. The first thing you'll notice when you browse through the application server folders is that its filesystem is basically divided into two core parts: the dichotomy reflects the distinction between standalone servers and domain servers.

The concept of a domain server is not new in the market of application servers, however, it was only introduced in JBoss with AS 7 as a way to manage and coordinate a set of instances of the application server. An application server node which is not configured as part of a domain is qualified as a standalone server. A standalone server resembles, in practice, a single instance of the application server you used to see in releases of the application server prior to JBoss AS 7.

We will discuss the concept of domains in detail in Chapter 5, Configuring a WildFly Domain. For the time being, we will explore the different filesystem structures for both kinds of servers.

From a bird's-eye perspective, we can see that the main filesystem is split in two: one section that is pertinent to domain servers and another that is relative to standalone servers. The following diagram depicts the tree of the application server:

Exploring the application server filesystem

In the next section, we will dig deeper into the folder structure of the WildFly application server, dissecting its content and looking at what it is used for.

The bin folder

The bin folder is where you will find all your startup scripts, such as standalone.sh and domain.sh. In addition to the startup scripts, you can find standalone.conf, which can be used to customize WildFly's bootstrap process.

As you saw earlier, the bin folder also includes the jboss-cli.sh script (jboss-cli.bin for Windows users), which starts the interactive CLI. You will also find various other useful scripts, such as add-user.sh and vault.sh. This folder also contains the web services utility scripts (wsconsume.sh and wsprovide.sh) used to generate the web services definition language and the corresponding Java interfaces.

There are several subfolders within the bin directory. The service folder and the init.d folder contain programs that allow you to install WildFly as service on Windows and Linux, respectively.

The docs folder

The docs folder contains two subfolders, examples and schema. The schema folder contains all the .xsd schema definition files used by the configuration as schema.

The examples folder contains numerous configuration examples, from a minimalistic standalone example to an ec2 HA example (HA meaning high availability, and ec2 referring to Amazon Elastic Compute Cloud).

The domain folder

The next folder is the domain folder, which contains the domain structure split across a set of folders:

  • The configuration folder contains all the configuration files:
    • The main configuration file is domain.xml, which contains all services that are used by the nodes of the domain. It also configures the socket-binding interfaces for all services.
    • Another key file for domains is host.xml, which is used to define the host controller (HC).
    • The last file contained in the configuration folder is logging.properties, which is used to define the logging format of the bootstrap process for both the process controller (PC) and host controller.
  • The content folder is used as a repository to store deployed modules.
  • The lib folder hosts the subfolder ext, which is there to support Java SE/EE style extensions. Some of the application server deployers are able to scan this folder for additional libraries that are picked up by the local class loader. Nevertheless, this approach is not recommended and is maintained only for compliance with the language specifications. The modules folder should be used to install your libraries within WildFly.
  • The log folder, as you might imagine, contains the logging output of the domain. The file, by default, is truncated every time the server is rebooted.
  • The servers folder holds a set of subfolders for each server defined in the configuration file. The most useful directory contained beneath each server is the log folder, which is the location where single instances emit their log.
  • The data folder is used by the application server to store its runtime data, such as transaction logging.
  • Finally, the tmp folder is used to store temporary files written by the server.

The standalone folder

If you are running the application server in standalone mode, this is the part of the filesystem you will be interested in. Its structure is quite similar to the domain folder with the notable exception of a deployment folder. Let's proceed with order. Just below the standalone folder, you will find the following set of subdirectories:

  • configuration
  • data
  • deployments
  • lib
  • log
  • tmp

The content and use of these subdirectories is explained as follows:

  • The configuration folder contains the application server configuration files. As a matter of fact, the application server ships with a set of different configuration files, each one using a different set of extensions. Launching the standalone startup script without passing in any parameters will, by default, use the standalone.xml configuration file.

    Besides standalone.xml, this folder contains the logging.properties file that configures the logging of the bootstrap process. The other files you will find here are mgmt-users.properties and mgmt-group.properties, which can be used to secure the management interfaces. Security is discussed in detail in Chapter 10, Securing WildFly.

  • The data folder is used by the application server to store its runtime data, such as transaction logging.
  • The deployments folder is the location in which users can place their deployment content (for example, WAR, EAR, JAR, and SAR files) to have it automatically deployed in the server runtime. Users, particularly those running production systems, are encouraged to use WildFly's management APIs to upload and deploy deployment content instead of relying on the deployment scanner subsystem that periodically scans this directory. See Chapter 6, Application Structure and Deployment, for more details.
  • The lib folder hosts the subfolder ext, which is used to define extensions of the application server. The same considerations for the domain's lib path apply here.
  • The log folder contains the logs emitted by the standalone instance of the application server. The default logfile, named server.log, is, by default, truncated every time the server is rebooted. This can be configured within the standalone.xml file.
  • The tmp folder is used to save temporary files written by WildFly.

The welcome-content folder

The welcome-content folder contains the default page, which is loaded when you browse to the root of your application server (http://localhost:8080). In terms of web server configuration, this is the Web root context.

The modules folder

Beneath the modules folder, you will find the application server's set of libraries, which are a part of the server distribution.

Historically, JBoss AS releases used to manage their set of libraries in different ways. Let's recap to bring about some order. Earlier, Release 4.x was used to define the core server libraries into the JBOSS_HOME/server libraries. Thereafter, each server definition had its specific library in the server/<servername>/lib folder.

This approach was pretty simple, however, it led to a useless proliferation of libraries that were replicated in the default/all server distribution.

Releases 5.x and 6.x had the concept of the common/lib folder, which was the main repository for all modules that were common to all server definitions. Each server distribution still contained a server/<servername>/lib path for the libraries that were specific to that server definition. Unchanged from the earlier release was the repository for core server modules comprised by JBOSS_HOME/server.

JBoss AS 7 followed a more modular approach improving over all the earlier approaches. This modular approach remains unchanged in WildFly. The server bootstrap library, jboss-modules.jar, can be found in the root of the application server. This single archive is all you need to bootstrap WildFly's application server kernel.

The main system modules are located in the system/layers/base folder under the modules folder. This has changed slightly in WildFly as, in JBoss AS 7, all modules were defined directly in the modules folder.

The following table outlines the diverse approaches used across different server releases:

AS release

Bootstrap libraries

Server libraries

4.x

JBOSS_HOME/server

JBOSS_HOME/server/<server>/lib

5.x and 6.x

JBOSS_HOME/server

JBOSS_HOME/common/lib

and

JBOSS_HOME/server/<server>/lib

7.x and 8.x

JBOSS_HOME/jboss-modules.jar

JBOSS_HOME/modules

Listing all the modules will take up too much space, however, the module repository layout is often the same as the module name. For example, the org.jboss.as.ejb3 module can be found in the org/jboss/as/ejb3 subfolder of the modules folder. This approach to organizing the modules certainly makes sense, and if you are used to a maven repository layout structure, you will have no problem getting your head around it.

In the last section of this chapter, we will see how modules are actually loaded by the application server.

Understanding WildFly's kernel

WildFly's kernel was redesigned in JBoss AS 7. Understanding the details of the modular kernel will help you understand concepts introduced later in the book. The kernel is based on two main projects, as follows:

  • JBoss Modules: This project handles class loading of resources in the container. You can think about JBoss modules as a thin bootstrap wrapper for executing an application in a modular environment.
  • Modular Service Container (MSC): This project provides a way to install, uninstall, and manage services used by a container. MSC further enables resource injection into services and dependency management between services.

The following diagram depicts the basic architecture of WildFly's server kernel:

Understanding WildFly's kernel

With this information, we can now progress to the loading of server modules.

Loading application server modules

Learning more about JBoss modules is essential if you want to understand the server configuration discussed in the next few chapters. At its heart, a module is really just a wrapper for a JAR file but treated by the application container as a module. The reason for this is class loading and dependency management, as each module can be treated as a pluggable unit, as depicted by the next diagram. WildFly has two different types of modules; the only difference between them is the way they are packaged:

  • Static modules
  • Dynamic modules

Have a look at the following screenshot:

Loading application server modules

Using a static module is the simplest way to load a module, and it's used as the default module when starting up the application server. Static modules are defined within the JBOSS_HOME/modules/system/layers/base directory. Each module has a configuration file called module.xml. The following example shows the contents of the javax.batch.api module.xml file:

<module xmlns="urn:jboss:module:1.3" name="javax.batch.api">
    <resources>
        <resource-root path="jboss-batch-api_1.0_spec-1.0.0.Final.jar"/>
    </resources>
    <dependencies>
        <module name="javax.api"/>
        <module name="javax.enterprise.api"/>
    </dependencies>    
</module>

As you can see, a module definition contains two main elements, the resources defined in the module (and their path) and the module's dependencies. In this example, the main resource is jboss-batch-api_1.0_spec-1.0.0.Final.jar, contained in the same folder as the module.xml file. It has dependencies on two other modules, javax.api and javax.enterprise.api.

A module which is defined with a main-class element is said to be executable. In other words, the module name can be listed on the command line, and the standard static main(String[]) method in the named module's main-class will be loaded and executed.

Tip

Creating custom static modules is useful should you have many applications deployed to your server, which rely on the same third-party libraries. This means that you do not have to deploy multiple applications with the same bundled libraries. The other benefit to creating custom static modules is that you can declare explicit dependencies on other static modules. Installing modules is covered in Chapter 3, Configuring Enterprise Services, in which we install a JDBC driver as a module.

The other way to approach the module repository is by using dynamic modules. This can be achieved in two ways, as follows:

  • Firstly, we can add the module information, such as its dependencies, within the MANIFEST file within your JAR, for example, in the Main class mypackage/MyClass:
    Dependencies: org.jboss.logging
  • The second way to do this is by adding the dependency to the jboss-deployment-structure.xml file, as shown in the following code:
    <jboss-deployment-structure>
      <deployment>
        <dependencies>
          <module name="org.jboss.logging" />
        </dependencies>
      </deployment>
    </jboss-deployment-structure>

We will cover this in more detail in Chapter 6, Application Structure and Deployment, in which we explain class loading.

Summary

In this chapter, we outlined the latest features that come shipped with WildFly.

We have seen that WildFly is composed of modular architecture, and that the kernel of WildFly is made up of two separate projects: JBoss Modules and MSC.

This modular architecture results in an exceptionally light kernel that is able to load modules as required, resulting in a quicker startup time.

The physical structure of the application server reflects the dichotomy between standalone servers and domain servers, the former being a single node instance and the latter a set of managed resources controlled by a domain controller and a host controller.

In the next chapter, we will dig deeper into the details of how to configure the application server, focusing our attention on the standalone server configuration file (standalone.xml), which contains the configuration for both the core application server and the stack of enterprise services running on top of it.

Left arrow icon Right arrow icon

Description

This book is aimed at Java developers, system administrators, application testers using WildFly, and anyone who performs a DevOps role. Whether you are completely new to WildFly or just require an understanding of WildFly's new features, this book is for you.
Estimated delivery fee Deliver to United States

Economy delivery 10 - 13 business days

Free $6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Nov 28, 2014
Length: 402 pages
Edition : 2nd
Language : English
ISBN-13 : 9781783286232
Languages :
Concepts :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to United States

Economy delivery 10 - 13 business days

Free $6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

Product Details

Publication date : Nov 28, 2014
Length: 402 pages
Edition : 2nd
Language : English
ISBN-13 : 9781783286232
Languages :
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 164.97
WildFly Configuration, Deployment, and Administration - Second Edition
$54.99
WildFly Performance Tuning
$54.99
Java EE 7 Development with WildFly
$54.99
Total $ 164.97 Stars icon
Banner background image

Table of Contents

13 Chapters
1. Installing WildFly Chevron down icon Chevron up icon
2. Configuring the Core WildFly Subsystems Chevron down icon Chevron up icon
3. Configuring Enterprise Services Chevron down icon Chevron up icon
4. The Undertow Web Server Chevron down icon Chevron up icon
5. Configuring a WildFly Domain Chevron down icon Chevron up icon
6. Application Structure and Deployment Chevron down icon Chevron up icon
7. Using the Management Interfaces Chevron down icon Chevron up icon
8. Clustering Chevron down icon Chevron up icon
9. Load-balancing Web Applications Chevron down icon Chevron up icon
10. Securing WildFly Chevron down icon Chevron up icon
11. WildFly, OpenShift, and Cloud Computing Chevron down icon Chevron up icon
A. CLI References Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.4
(5 Ratings)
5 star 40%
4 star 60%
3 star 0%
2 star 0%
1 star 0%
M. Eisele Apr 01, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Travelling has downsides. Especially when coming back to the office to catch up with all the tasks being actively postponed. One of them has been sitting here for too long: It took me a while to get this latest review for Packt Publishing out the door. But this is the good side of traveling, you have plenty of time to read and educate yourself on topics.AbstractWildFly 8 is a modular, lightweight, Java EE-compliant application server. Application deployment and management is simplified with WildFly's centralized and easy-to-use administration interface. It supports high availability and latest web technologies, such as web sockets and a non-blocking API. There was previously a lack of a system-administration-free platform that allowed the scaling of Java EE applications, but WildFly 8 in combination with OpenShift fills that gap.The book starts with an explanation of the installation of WildFly and application server configuration. Then, it moves on to the configuration of enterprise services and also explores the new web container Undertow. It then covers domain configuration, application deployment, and application server management. By the end of the book, you will have a firm grasp of all the important aspects of clustering, load balancing, and WildFly security. This guide is invaluable for anyone who works with or is planning to switch to WildFly.About the AuthorChristopher Ritchie (@ChrisRitchie123|blog) is a Sun Certified Programmer with over 10 years of software experience. Having worked in both the UK and South Africa markets, he has worked on a variety of software applications, ranging from online gaming to telecoms and Internet banking. He has a keen interest in the WildFly application server and is an advocate of Java EE technologies. He currently works as a technical lead at the company he confounded, Sports Science Medicine Software, in South Africa. The company's core product is a research-based application that allows the profiling of soccer players through injury and exposure assessment.The Content353 net pages without intro and appendix is a good deal for this book. Eleven chapters cover nearly every aspect of WildFly. This includes basics, like installation and goes all the way to cloud computing with WildFly on OpenShift. The separate chapter on securing WildFly is my personal highlight here. The book was build on top of WildFly version 8.x which fully supports Java EE 7 development on top of Java SE 7.Chapter 1: Installing WildFlyChapter 2: Configuring the Core WildFly SubsystemsChapter 3: Configuring Enterprise ServicesChapter 4: The Undertow Web ServerChapter 5: Configuring a WildFly DomainChapter 6: Application Structure and DeploymentChapter 7: Using the Management InterfacesChapter 8: ClusteringChapter 9: Load-balancing Web ApplicationsChapter 10: Securing WildFlyChapter 11: WildFly, OpenShift, and Cloud ComputingWriting and StyleGenerally the instructions are clear and the many screen-shots are helpful. The overall level of detail and mixed in complexity is appropriate and in case you need it you can download the source code from Packt. I like the clear English writing which identifies the author as a native speaker. I would have wished for more command line examples and a little less XML snippets. The conceptual pictures in the book could be a bit clearer and bigger. But this is pretty much everything I have to criticize.Conclusion and recommendationIf you are looking for a most complete introduction and you're tired about trying to find the bits and pieces in the online documentation, this book is for you. Also, if you are the kind of person which needs examples and screenshots this book is for you. The very appealing writing style helps in getting all the points across. The unique selling point obviously is the end-to-end coverage of all related topics in a detailed enough way to let you experience WildFly installed locally and on OpenShift.
Amazon Verified review Amazon
Diego Verissimo Lakatos Apr 06, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I liked this book very much because it's written on a simple language that anyone with some knowledge about Java EE can understand, learn and administer an wildfly environment. I never work with WildFly before and the book helped me to deploy the WildFly into a very important customer. Although the book seems to be superficial it explains very well the concepts, in a clear and objective language.
Amazon Verified review Amazon
Abhishek Apr 01, 2015
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
This book covers the breadth and depth of WildFly 8 application server and talks about topics such asInstallation and configuration of WildFly, its subsystems, Enterprise services and containers as well as Undertow (web container)Domain configuration, application deployment, high availability and security managementOpenShift cloud (PaaS) platformChapter 1: Installing WildflyThis lesson is a gentle introduction to Wildfly. It’s aimed at helping you get up and running with an environment so that you can work on the server. It discusses basic topics and covers- Details around installation of Java and Wildfly application server- Basic administrative operations such as startup, shutdown and reboot- Set up of Eclipse (for Java EE) and JBoss Tools (Eclipse plugin)- Wildfly file system (server installation directory) along with kernel and server modulesFor me, the highlight of the chapter were the sections around Wildfly Kernel and Modules. It provides a great launching pad for upcoming topics!Chapter 2: Configuring the Core WildFly SubsystemsThis chapter provides an overview of Wildfly configuration which is composed of several sub systems which are configured as a part of the standalone.xml or domain.xml (configuration file)- Server subsystems such as Extensions, Profiles, System properties, Deployments etc- Thread pool system – discusses configuration revolving around thread factory and thread pools such as bounded queue thread pool, scheduled thread pool, queueless thread pool etc- Dwells into the server logging configuration discusses different handlers of the logging subsystem – console, async, size-rotating, custom handlers and moreChapter 3: Configuring Enterprise ServicesThis lesson discusses Wildfly subsystems corresponding to Java EE services and their respective configurations- JDBC driver and Datasource configuration- EJB container configuration including session, stateless, MDB and EJB timers related details- Configuring the JMS/Messaging system- JTA (transaction manager) configuration- Tuning and configuring container resources related to Concurrency utilities API – Managed thread factory, Managed Executor service and managed scheduled executor serviceChapter 4: The Undertow Web serverAs the name indicates, this chapter introduces the basic concepts of Undertow (new web container implementation in Wildfly) as well as its configuration related artifacts.- Quick tour of the Undertow component architecture- Configuration of server listener. host along with servlet container components- Walkthrough of creation and deployment of a Maven based Java EE 7 project along with components like JSF, EJB, CDI, JPAChapter 5: Configuring a Wildfly DomainChapter 5 is all about the concept of a domains in Wildfly and the nuances related to their configuration. It concludes with a section which helps the reader configure a custom domain and apply the concepts introduced in the lesson- An overview of domains and related configuration in Wildfly and administrative basics such as start/stop- Configuration related to core facets of a domain – host.xml, domain.xml, domain controller etc- Tuning domain specific JVM options- Configuration of a test (custom) domainChapter 6: Application Structure and DeploymentThe chapter discusses important topics such as application package structure of different Java EE components and how to deploy various flavors of Java EE applications on Wildfly- Review of application packaging options – JAR, EAR, WAR- Deployment of applications on Wildfly – standalone and domain mode using both command line and Admin console- The chapter ends with a solid section covering Java EE classloading requirements and how Wildfly handles itChapter 7: Using the Management InterfacesAgain, as evident in the name of the chapter itself, its not surprising to know that this lesson covers the management options available in Wildfly- Usage of the command line interface for execution of various tasks- The Wildfly Web Console and the options it offersChapters 8,9: Clustering and Load-balancingChapters 8,9 cover Wildfly clustering, HA and load balancing capabilities in detail.- Basic setup and configuration of a Wildfly clusters- Infinispan subsystem configuration along with details of Hibernate cache setup- Clustering of JMS system, EJBs and JPA entities- Installation and configuration of Apache web server and modules like mod_jk, mod_proxy and mod_cluster- Using CLI for mod_cluster and web context management as well as troubleshooting tipsChapter 10: Securing WildflyThis chapter covers- Introduction to the Wildfly security subsystem and details of commonly used Login Modules – Database and LDAP- Securing Java EE components – Web tier, EJBs and web services- Protecting the Web Admin console along with configurations related to transport layer securityChapter 11: WildFly, OpenShift and Cloud ComputingThis lesson is dedicated to Cloud Computing as a technology and how OpenShift- Overview of Cloud Computing – basics, advantages, types, options- Introduction to OpenShift and setup process of the client related tools- Walkthrough of cartridge installation and the process of building and deploying a sample application to OpenShift- Log management and basic administrative tasks using CLI tools- start, stop, restart etc- Using OpenShift with Eclipse and instructions on how to scale your applicationsStandout featuresSome of the points which in my opinion were great- We often spend years working with containers (application servers, web servers etc) without really knowing what’s going on beneath. There is a reason behind this – the core concepts (application kernels, modules, container configuration, threading setup etc) are pretty complex and often not that well explained. This book does a great job at covering these topics and presenting the core of Wildfly in a simple manner- Intuitive and clear diagrams (lots of them!)- Enjoyed the chapter on OpenShift – provides a great platform for exploring PaaS capabilities and getting up and running with OpenShift- The reader will also benefit a lot by picking up a lot of Java EE related fundamentals as well as cutting edge features of Java EE 7.
Amazon Verified review Amazon
Glaucio Guerra Apr 06, 2015
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
This book is very simple to read, the organization from the basic to advanced steps it can help even those who nerver had any contact with WildFly application server. I liked the advanced topics that explain how to create an scalable environment using cluster and a load balance as solution for High Availability. Another very interesting topic is about OpenShift, the red hat Cloud platform. I highly recommend this book for people trying a deeper overview of WildFly, focus on administration, configuration and installation steps. This book is not a manual, nor a WildFly seller book. It's recommended for technical people, including developers who want to know more about WildFly and advanced topics used in this application server.
Amazon Verified review Amazon
Rodrigo Emygdio Jan 14, 2015
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
At the beginning, I had some misconception about this book. When I was starting to read this book, I saw that the material have a good variety of information about wildfly. The book start describing the base information that a developer or administrator need to begin understand this great application server for J2EE (Wildfly). And each chapter delved into all necessary important conception about Wildfly. I strongly recommend this book.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela