Oracle GlassFish Server 3.0.1 Administration Guide

Configuration Tasks

Some configuration tasks must be performed directly after installation for your GlassFish Server environment to work as intended. For example, if you are using a database with GlassFish Server, you need to set up database connectivity right away.

Some configuration situations are ongoing and will require you to make changes many times during the life of your installation. You can use either the Administration Console or the asadmin utility to modify the configuration. Changes are automatically applied to the appropriate configuration file.

The following topics are addressed here:

Initial Configuration Tasks

This section maps the common configuration tasks to the command–line procedures in this guide. In some situations, the resource or service is automatically enabled and your configuration tasks involve adjusting or changing the default settings to suit your specific needs.

The following resources and services frequently require configuration immediately after installation:

System Properties

See Administering System Properties.


The initial domain1 is created during installation. Additional configuration tasks might include such tasks as configuring additional domains or setting up automatic restart. See Chapter 3, Administering Domains.


The initial tasks for configuring the JVM include creating JVM options and profilers. See Chapter 4, Administering the Virtual Machine for the Java Platform.


By default, logging is enabled, so basic logging works without additional configuration. However, you might want to change log levels, property values, or the location of log files. See Chapter 7, Administering the Logging Service.


By default, the monitoring service is enabled. However, monitoring for the individual modules is not enabled, so your first monitoring task is to enable monitoring for the modules that you want to monitor. See Chapter 8, Administering the Monitoring Service.

Life Cycle Modules

See Chapter 9, Administering Life Cycle Modules.

Database Connectivity

The initial tasks involved in configuring GlassFish Server to connect to the Java DB database include creating a Java Database Connectivity (JDBC) connection pool, creating a JDBC resource, and integrating a JDBC driver. See Chapter 14, Administering Database Connectivity .

EIS Connectivity

The initial tasks involved in configuring GlassFish Server to connect to an enterprise information system (EIS) include creating a connector connection pool, creating a connector resource, editing a resource adapter configuration, creating a connector security map, creating a connector work security map, and creating an administered object (if needed). See Chapter 15, Administering EIS Connectivity.

Internet Connectivity

The initial tasks involved in making deployed web applications accessible by internet clients include creating HTTP network listeners and virtual servers, and configuring the HTTP listeners for SSL (if needed). See Chapter 16, Administering Internet Connectivity.

Object Request Broker (ORB)

An initial configuration task might involve creating an IIOP listener. See Chapter 17, Administering the Object Request Broker (ORB).

JavaMail Service

An initial configuration task might involve creating a JavaMail resource. See Chapter 18, Administering the JavaMail Service.

Java Message Service (JMS)

Initial configuration tasks might include creating a physical destination, creating connection factories or destination resources, creating a JMS host (if the default JMS host is not adequate), adjusting connection pool settings (if needed), and configuring resource adapters for JMS. See Chapter 19, Administering the Java Message Service (JMS).

JNDI Service

An initial configuration task might involve creating a JNDI resource. See Chapter 20, Administering the Java Naming and Directory Interface (JNDI) Service.

Information and instructions for accomplishing the tasks by using the Administration Console are contained in the Administration Console online help.

How Dotted Names Work for Configuration

After the initial configuration is working, you will continue to manage ongoing configuration for the life of your GlassFish Server installation. You might need to adjust resources to improve productivity, or issues might arise that require settings to be modified or defaults to be reset. In some situations, an asadmin subcommand is provided for updating, such as the update-connector-work-security-map subcommand. However, most updating is done by using the list, get, and set subcommands with dotted names. For detailed information about dotted names, see the dotted-names(5ASC) help page.

Note –

Dotted names also apply to monitoring, but the method is different. For information on using dotted names for monitoring, see How the Monitoring Tree Structure Works.

The general process for working with configuration changes on the command line is as follows:

  1. List the modules for the component of interest.

    The following single mode example uses the | (pipe) character and the grep command to narrow the search:

    asadmin list "*" | grep http | grep listener

    Information similar to the following is returned:
  2. Get the attributes that apply to the module you are interested in.

    The following multimode example gets the attributes and values for http-listener-1:

    asadmin> get* 

    Information similar to the following is returned:

    server.http-service.http-listener.http-listener-1.acceptor-threads = 1
    server.http-service.http-listener.http-listener-1.address =
    server.http-service.http-listener.http-listener-1.blocking-enabled = false
    server.http-service.http-listener.http-listener-1.default-virtual-server = server
    server.http-service.http-listener.http-listener-1.enabled = true
    server.http-service.http-listener.http-listener-1.external-port = = inet = http-listener-1
    server.http-service.http-listener.http-listener-1.port = 8080
    server.http-service.http-listener.http-listener-1.redirect-port = = false
    server.http-service.http-listener.http-listener-1.server-name =
    server.http-service.http-listener.http-listener-1.xpowered-by = true
  3. Modify an attribute by using the set subcommand.

    This example sets the security-enabled attribute of http-listener-1 to true:

    asadmin> set = true

Configuration Files

The bulk of the configuration information about GlassFish Server resources, applications, and server instances is stored in the domain.xml configuration file. This file is the central repository for a given administrative domain and contains an XML representation of the GlassFish Server domain model. Default location for the domain.xml file is as-install/glassfish3/glassfish/domains/domain-name/config. For details on the domain.xml file, see Oracle GlassFish Server 3.0.1 Domain File Format Reference.

The file is used to configure logging levels for individual modules. The file is located in the same directory as the domain.xml file. For further information on the file, see Setting Log Levels.

The asenv.conf file is located in the as-install/glassfishv3/glassfish/config directory. It's purpose is to store the GlassFish Server environment variables, such as the installation location of the database, Message Queue, and so on.

Note –

Changes are automatically applied to the appropriate configuration file. Do not edit the configuration files directly. Manual editing is prone to error and can have unexpected results.

Impact of Configuration Changes

Configuration changes often require that you restart GlassFish Server for the changes to take effect. In other cases, changes are applied dynamically without requiring that GlassFish Server be restarted. The procedures in this guide indicate when you need to restart the server.

Configuration Changes That Require Server Restart

When making any of the following configuration changes, you must restart the server for the changes to take effect:

Dynamic Configuration Changes

With dynamic configuration, changes take effect while the server is running. To make the following configuration changes, you do not need to restart the server: