To Create a Domain From a Custom Template

A custom template enables you to customize the configuration of any domain that you create from the template.

  1. Create a domain to use as the basis for the template.

    For more information, see To Create a Domain.

  2. Use the asadmin utility or the Administration Console to configure the domain.

    Your configuration changes will be included in the template that you create from the domain.

  3. Copy the domain's domain.xml file under a new name to the as-install/lib/templates directory.

    A domain's domain.xml file is located in the domain-dir/config directory.

  4. In a plain text editor, edit the file that you copied to replace with tokens values that are to be substituted when a domain is created.

    Each token is identified as %%%token-name%%%, where token-name is one of the following names:

    ADMIN_PORT

    Represents the port number of the HTTP port or the HTTPS port for administration. This token is replaced with one of the following values in the command to create a domain from the template:

    • The value of the --adminport option

    • The value of the domain.adminPort property

    CONFIG_MODEL_NAME

    Represents the name of the configuration that is created for the domain that is being created. This token is replaced with the string server-config.

    DOMAIN_NAME

    Represents the name of the domain that is being created. This token is replaced with the operand of create-domain subcommand.

    HOST_NAME

    Represents the name of the host on which the domain is being created. This token is replaced with the fully qualified host name of the host where the domain is being created.

    HTTP_PORT

    Represents the port number of the port that is used to listen for HTTP requests. This token is replaced with one of the following values in the command to create a domain from the template:

    • The value of the --instanceport option

    • A value that the create-domain subcommand calculates from the value of the --portbase option

    • The value of the domain.instancePort property

    HTTP_SSL_PORT

    Represents the port number of the port that is used to listen for secure HTTP requests. This token is replaced with one of the following values in the command to create a domain from the template:

    • A value that the create-domain subcommand calculates from the value of the --portbase option

    • The value of the http.ssl.port property

    JAVA_DEBUGGER_PORT

    Represents the port number of the port that is used for connections to the Java Platform Debugger Architecture (JPDA) debugger. This token is replaced with one of the following values in the command to create a domain from the template:

    • A value that the create-domain subcommand calculates from the value of the --portbase option

    • The value of the java.debugger.port property

    JMS_PROVIDER_PORT

    Represents the port number for the Java Message Service provider. This token is replaced with one of the following values in the command to create a domain from the template:

    • A value that the create-domain subcommand calculates from the value of the --portbase option

    • The value of the jms.port property

    JMX_SYSTEM_CONNECTOR_PORT

    Represents the port number on which the JMX connector listens. This token is replaced with one of the following values in the command to create a domain from the template:

    • A value that the create-domain subcommand calculates from the value of the --portbase option

    • The value of the domain.jmxPort property

    ORB_LISTENER_PORT

    Represents the port number of the port that is used for IIOP connections. This token is replaced with one of the following values in the command to create a domain from the template:

    • A value that the create-domain subcommand calculates from the value of the --portbase option

    • The value of the orb.listener.port property

    ORB_MUTUALAUTH_PORT

    Represents the port number of the port that is used for secure IIOP connections with client authentication. This token is replaced with one of the following values in the command to create a domain from the template:

    • A value that the create-domain subcommand calculates from the value of the --portbase option

    • The value of the orb.mutualauth.port property

    ORB_SSL_PORT

    Represents the port number of the port that is used for secure IIOP connections. This token is replaced with one of the following values in the command to create a domain from the template:

    • A value that the create-domain subcommand calculates from the value of the --portbase option

    • The value of the orb.ssl.port property

    OSGI_SHELL_TELNET_PORT

    Represents the port number of the port that is used for connections to the Apache Felix Remote Shell. This shell uses the Felix shell service to interact with the OSGi module management subsystem. This token is replaced with one of the following values in the command to create a domain from the template:

    • A value that the create-domain subcommand calculates from the value of the --portbase option

    • The value of the osgi.shell.telnet.port property

    SERVER_ID

    Represents the name of the DAS for the domain that is being created. This token is replaced with the string server.


    Tip - For information about how these tokens are used in the default template, examine the as-install/lib/templates/domain.xml file.


  5. Create the domain that you want to be based on a custom template.

    In the command to create the domain, pass the name of file that you edited in the previous step as the --template option of the create-domain(1) subcommand.

  6. Before starting the domain, verify that the domain's domain.xml file is valid.

    Use the verify-domain-xml(1) subcommand for this purpose.

    Information about the options for this subcommand is included in the subcommand's help page.

See Also

You can also view the full syntax and options of the subcommands by typing the following commands at the command line.