Chapter 3. Directory Structure

Installing the JBoss distribution creates a jboss-4.0.4 directory that contains server start scripts, JARs, server configuration sets and working directories. You need to know your way around the distribution layout to locate JARs for compiling code, updating configurations, deploying your code, etc. Figure 3.1, “The JBoss AS directory structure” illustrates the installation directory of the JBoss server.

The JBoss AS directory structure

Figure 3.1. The JBoss AS directory structure

Throughout this book we refer to the top-level jboss-4.0.4 directory as the JBOSS_DIST directory. In Figure 3.1, “The JBoss AS directory structure”, the default server configuration file set is shown expanded. It contains a number of subdirectories: conf, data, deploy, lib, log, and tmp. In a clean installation, only the conf, deploy, and lib directories will exist. Several of the locations may be overridden. For these locations, the org.jboss.system.server.ServerConfig interface constant and its corresponding system property string are shown. The names ending in URL correspond to locations that can be specified using a URL to access remote locations, for example, HTTP URLs against a web server. Table 3.1, “The JBoss top-level directory structure” shows the top-level directories and their function.

Table 3.1. The JBoss top-level directory structure

binAll the entry point JARs and start scripts included with the JBoss distribution are located in the bin directory.
clientThe JARs that are required for clients that run outside of JBoss are located in the client directory.
server The JBoss server configuration sets are located under the server directory. The default server configuration set is the server/default set. JBoss ships with minimal, default and all configuration sets. The subdirectories and key configuration files contained default configuration set are discussed in more detail in Chapter 4, The Default Server Configuration File Set
lib The lib directory contains startup JARs used by JBoss. Do not place your own libraries in this directory.

Table 3.2, “The JBoss server configuration directory structure” shows the directories inside of the server configuration directory and their function.

Table 3.2. The JBoss server configuration directory structure

conf The conf directory contains the jboss-service.xml bootstrap descriptor file for a given server configuration. This defines the core services that are fixed for the lifetime of the server.
data The data directory is available for use by services that want to store content in the file system.
deploy The deploy directory is the default location the hot deployment service looks to for dynamic deployment content. This may be overridden through the URLDeploymentScanner URLs attribute.
lib The lib directory is the default location for static Java libraries that should not be hot deployed. All JARs in this directory are loaded into the shared classpath at startup.
logThe log directory is the directory log files are written to. This may be overridden through the conf/log4j.xml configuration file.
tmpThe tmp directory is used by JBoss to store temporarily files such as unpacked deployments.

The contents of the conf and deploy directories will be shown in the following section.