2.9. Filesystem Paths

2.9.1. Filesystem Paths

JBoss Enterprise Application Platform 6 uses logical names for a filesystem paths. The domain.xml, host.xml and standalone.xml configurations all include a section where paths can be declared. Other sections of the configuration can then reference those paths by their logical name, avoiding the declaration of the absolute path for each instance. This benefits configuration and administration efforts as it allows specific host configurations to resolve to universal logical names.
For example, the logging subsystem configuration includes a reference to the jboss.server.log.dir path that points to the server's log directory.

Example 2.8. Relative path example for the logging directory

<file relative-to="jboss.server.log.dir" path="server.log"/>
JBoss Enterprise Application Platform 6 automatically provides a number of standard paths without any need for the user to configure them in a configuration file.

Table 2.7. Standard Paths

Value Description
jboss.home The root directory of the JBoss EAP 6 distribution.
user.home The user home directory.
user.dir The user's current working directory.
java.home The Java installation directory
jboss.server.base.dir The root directory for an individual server instance.
jboss.server.data.dir The directory the server will use for persistent data file storage.
jboss.server.log.dir The directory the server will use for log file storage.
jboss.server.tmp.dir The directory the server will use for temporary file storage.
jboss.domain.servers.dir The directory under which a host controller will create the working area for individual server instances in a managed domain.
Users can add their own paths or override all except the first five of the above by adding a path element to their configuration file. The following example shows a new relative path declaration relative to the root directory for the individual server instance.

Example 2.9. Format of a relative path

<path name="examplename" path="example/path" relative-to="jboss.server.data.dir"/>
The structure of a path declaration uses the following attributes.

Table 2.8. Path Attributes

Attribute Description
name The name of the path.
path The actual filesystem path. Treated as an absolute path, unless the relative-to attribute is specified, in which case the value is treated as relative to that path.
relative-to An optional attribute indicating the name of another previously named path, or of one of the standard paths provided by the system.
A path element in a domain.xml configuration file only requires the name attribute. It does not need to include any information indicating what the actual filesystem path is, as shown in the following example.

Example 2.10. Domain path example

<path name="example"/>
This configuration simply declares that there is a path named example that the other parts of the domain.xml configuration can reference. The actual filesystem location declared by example is specific to the respective host.xml configuration files of the host instances joining the domain groups. If this approach is used, there must be a path element in each machine's host.xml that specifies what the actual filesystem path is.

Example 2.11. Host path example

<path name="example" path="path/to/example" />
A path element in a standalone.xml must include the specification of the actual filesystem path.