The domain.xml file contains most of the Sun JavaTM System Enterprise Server configuration. The domain.xml file is located in the domain configuration directory, which is typically domain-dir/config.
There is no DTD file or schema that determines the format of the domain.xml file. The server's configuration is dictated by the Java interfaces with appropriate annotations and domain.xml serves as a seed for that configuration. At any point in time, the overall structure of an XML element present in domain.xml is clearer when one sees the Java interface in the package com.sun.enterprise.config.serverbeans. Thus these Java interfaces take the place of the DTD file in previous releases.
This file is further described in the following sections:
Settings in the Enterprise Server deployment descriptors override corresponding settings in the domain.xml file unless otherwise stated. For more information about the Enterprise Server deployment descriptors, see the Sun GlassFish Enterprise Server v3 Prelude Application Deployment Guide.
In this manual, the term default is used in its broader sense, and not in the specific way it is used in the XML 1.0 standard. A default value is an initial value or the value used if no value is present in the XML file. A default value can be any of the following:
A value supplied by the XML parser when no value is found in the domain.xml file. The relevant element or attribute is optional.
A value supplied by the Enterprise Server when no value is found in the domain.xml file and the XML parser doesn’t provide a value. The relevant element or attribute is optional.
An initial value supplied when the domain.xml file is created. The relevant element or attribute might or might not be optional.
Removal of initial values in domain.xml is not recommended because attributes may be left without values or values may revert to internal defaults. Explicitly changing values is recommended.
Variables and variable references are needed for two reasons:
Parts of the Enterprise Server share much configuration information but differ in specific details.
Parts of the configuration come from the system environment but must still be captured in the configuration.
Variable references appear in the domain.xml file as strings that begin with the characters ${ and end with the character }. For example, the string ${com.sun.enterprise.myVar} is a reference to the variable com.sun.enterprise.myVar .
Variables are defined both outside of and within domain.xml. Predefined variables that exist outside of domain.xml are defined as Java System Properties. Within domain.xml, a variable is defined using the system-property element or the jvm-options element.
The system-property element’s name attribute is the name of a variable; its value attribute is the definition of the variable. For example, the following system-property element defines a port-number variable with the value 6500:
<system-property name="port-number" value="6500"/>
Multiple system-property subelements are permitted within server, config, and domain elements.
A variable defined in the jvm-options element is a Java System Property with the -D flag. For example, the following jvm-options element defines a port-number variable with the value 5500:
<jvm-option>-Dport-number=5500</jvm-option>
Multiple definitions for the same variable are permitted. The Enterprise Server determines the actual value of a variable by searching for its first definition in a strict hierarchy of the elements within domain.xml. The hierarchy is as follows:
server -> config -> jvm-options -> domain -> System
Implicit in this hierarchy is the notion of reference and containment. A variable referenced in a server element is only looked up:
In the config element that references that specific server
In the jvm-options subelements of the config element referenced by that server
One element references another when an attribute of the referencing element has the same value as an attribute of the referenced element. For example, the application-ref element references a module that is deployed to its parent server element. The application-ref element’s ref attribute has the same value as the name attribute of an application element.
The referencing application-ref element might look like this:
<application-ref ref="MyServlet"/>
The referenced application element might look like this:
<application name="MyServlet" location="myservletdir"/>
The element hierarchy for the domain.xml file is as follows. To make the hierarchy more readable, elements having property as their last or only subelement are marked with a P, and the property subelements are not shown. Parent/child relationships between elements are shown, but not cardinality. For those details, see the element descriptions.
domain P . system-applications . . application P . . . engine P . applications . . application P . . . engine P . resources . . jdbc-resource P . . jdbc-connection-pool P . configs . . config P . . . http-service P . . . . access-log . . . . request-processing . . . . keep-alive . . . . connection-pool . . . . http-protocol . . . . http-file-cache . . . . http-listener P . . . . . ssl . . . . virtual-server P . . . . . http-access-log . . . iiop-service . . . . orb P . . . . ssl-client-config . . . . . ssl . . . . iiop-listener P . . . . . ssl . . . admin-service P . . . . jmx-connector P . . . . . ssl . . . . das-config P . . . web-container P . . . . session-config . . . . . session-manager . . . . . . manager-properties P . . . . . . store-properties P . . . . . session-properties P . . . ejb-container P . . . . ejb-timer-service P . . . mdb-container P . . . jms-service P . . . . jms-host P . . . log-service P . . . . module-log-levels P . . . security-service P . . . . auth-realm P . . . . jacc-provider P . . . . audit-module P . . . . message-security-config . . . . . provider-config P . . . . . . request-policy . . . . . . response-policy . . . transaction-service P . . . monitoring-service P . . . . module-monitoring-levels P . . . java-config P . . . . profiler P . . . . . jvm-options . . . . jvm-options . . . thread-pools . . . . thread-pool P . . . system-property . servers . . server P . . . application-ref . . . resource-ref . . . system-property . system-property