Let's now try to start JBoss EAP6 in the standalone mode. Go to the bin
directory and run standalone.sh
. The server output is shown in the following screenshot:
Now let's look at some details on the server output to understand the startup process.
We can see several important things from the server output. The following is the first one:
Started 123 of 177 services (53 services are passive or on-demand)
From the previous log, we can see that not all the components are started during the EAP6 startup process. This design greatly speeds up the startup time of EAP6. We can see that some services are started by default during the start process:
These components are called subsystems. These subsystems are configured in the standalone.xml
file upon navigating through standalone/configuration
.
Now let's see the actual command in standalone.sh
that starts the EAP6 server:
eval \"$JAVA\" -D\"[Standalone]\" $JAVA_OPTS \ \"-Dorg.jboss.boot.log.file=$JBOSS_LOG_DIR/server.log\" \ \"-Dlogging.configuration=file:$JBOSS_CONFIG_DIR/logging.properties\" \ -jar \"$JBOSS_HOME/jboss-modules.jar\" \ -mp \"${JBOSS_MODULEPATH}\" \ -jaxpmodule "javax.xml.jaxp-provider" \ org.jboss.as.standalone \ -Djboss.home.dir=\"$JBOSS_HOME\" \ -Djboss.server.base.dir=\"$JBOSS_BASE_DIR\" \ "$SERVER_OPTS" "&"
Tip
Downloading the example code
You can download the example code files for all Packt Publishing books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
From the previous command, we can see that jboss-modules.jar
is the bootstrap JAR file for the whole EAP6 server, and the entry point is org.jboss.as.standalone
, which is specified in the following command:
-jar \"$JBOSS_HOME/jboss-modules.jar\" org.jboss.as.standalone
We'll see more details about the startup process later. Now let's check the configuration file of the standalone mode.
The structure of standalone.xml
is as follows:
As shown in the previous screenshot, standalone.xml defines multiple aspects of the standalone service. Let's have a brief view:
Besides the default file standalone.xml
, EAP6 has provided some other profiles for the standalone mode.
Tip
There is only one profile per standalone configuration file. In contrast, multiple profiles could be defined in the domain configuration file.
We can check them in the standalone/configuration
directory:
These files define the different profiles for different purposes. The following is a summary of their differences:
To use these alternative configurations during startup, we can use the -c
option when calling standalone.sh
. For example, if we want to use standalone-ha.xml
, the command is as follows:
$ ./standalone.sh -c standalone-ha.xml
Please note that the -c
option assumes that the configuration is located at $JBOSS_HOME/standalone/
.