JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle GlassFish Server 3.1 Quick Start Guide
search filter icon
search icon

Document Information

1.  Quick Start for Basic Features

About This Quick Start Guide

Default Paths and File Names

Default Administration Values

Starting and Stopping the Default Domain

To Start the Default Domain

To Stop the Default Domain

Starting and Stopping the Database Server

To Start the Java DB Server

To Stop the Java DB Server

Starting the Administration Console

To Start the Administration Console

Deploying and Undeploying Applications

To Obtain the Sample Application

Deploying and Undeploying the Sample Application From the Command Line

To Deploy the Sample Application From the Command Line

To List Deployed Applications From the Command Line

To Undeploy the Sample Application From the Command Line

Deploying and Undeploying Applications by Using the Administration Console

To Deploy the Sample Application by Using the Administration Console

To View Deployed Applications in the Administration Console

To Undeploy the Sample Application by Using the Administration Console

Deploying and Undeploying the Sample Application Automatically

To Deploy the Sample Application Automatically

To Undeploy the Sample Application Automatically

High Availability Clustering and Load Balancing

Clusters of GlassFish Server Instances

Session Persistence and Failover

Load Balancing for Clustered Configurations

Updating and Extending an Existing Installation

To Access the Graphical Update Tool From the Command Line

To Access Update Tool by Using the Administration Console

Removing GlassFish Server 3.1 Software

To Remove GlassFish Server Software on UNIX, Linux, and Mac OS X Systems

To Remove GlassFish Server Software on Windows Systems

For More Information

Product Documentation

GlassFish Communities

Tutorials

Java EE 6 Samples

2.  Use Cases for Production Deployments

Deploying and Undeploying Applications

The process of configuring and enabling applications to run within the GlassFish Server framework is referred to as deployment.

This section explains how to deploy, list, and undeploy applications. The procedures in this section use the hello.war sample application. The following topics are addressed here:

To Obtain the Sample Application

  1. Download a copy of the hello.war sample application from http://glassfish.java.net/downloads/quickstart/hello.war.
  2. Save the hello.war file in the directory of your choice.

    This directory is referred to as sample-dir.

Deploying and Undeploying the Sample Application From the Command Line

GlassFish Server provides asadmin subcommands for performing the following deployment-related tasks:

To Deploy the Sample Application From the Command Line

Before You Begin

The sample application must be available before you start this task. To download the sample, see To Obtain the Sample Application. At least one GlassFish Server domain must be started before you deploy the sample application.

  1. Run the asadmin deploy command.

    The general form for the command is as follows:

    as-install/bin/asadmin deploy war-name

    To deploy the hello.war sample, the command is as follows:

    as-install/bin/asadmin deploy sample-dir/hello.war
  2. Access the hello application by typing the following URL in your browser:
    http://localhost:8080/hello

    The application's start page is displayed, and you are prompted to type your name.

    Hi, my name is Duke. What's yours?
  3. Type your name and click Submit.

    The application displays a customized response, giving you a personal Hello.

See Also

For more information about the deploysubcommand, see deploy(1).

For more information about deploying applications from the command line, see Oracle GlassFish Server 3.1 Application Deployment Guide.

To List Deployed Applications From the Command Line

To Undeploy the Sample Application From the Command Line

See Also

For more information about the undeploy subcommand, see undeploy(1).

Deploying and Undeploying Applications by Using the Administration Console

The graphical Administration Console of GlassFish Server enables you to perform the following deployment-related tasks:

To Deploy the Sample Application by Using the Administration Console

Before You Begin

The sample application must be available before you start this task. To download the sample, see To Obtain the Sample Application. At least one GlassFish Server domain must be started before you deploy the sample application.

  1. Launch the Administration Console by typing the following URL in your browser:
    http://localhost:4848
  2. Click the Applications node in the tree on the left.

    The Applications page is displayed.

  3. Click the Deploy button.

    The Deploy Applications or Modules page is displayed.

  4. Select Packaged File to be Uploaded to the Server, and click Browse.
  5. Navigate to the location in which you saved the hello.war sample, select the file, and click Open.

    You are returned to the Deploy Applications or Modules page.

  6. Specify a description in the Description field, for example:

    hello

  7. Accept the other default settings, and click OK.

    You are returned to the Applications page.

  8. Select the check box next to the hello application and click the Launch link to run the application.

    The default URL for the application is as follows:

    http://localhost:8080/hello/

See Also

For more information, see the Administration Console online help.

To View Deployed Applications in the Administration Console

  1. Launch the Administration Console by typing the following URL in your browser:
    http://localhost:4848
  2. Click the Applications node in the tree on the left.

    Expand the node to list deployed applications. Deployed applications are also listed in the table on the Applications page.

To Undeploy the Sample Application by Using the Administration Console

  1. Launch the Administration Console by typing the following URL in your browser:
    http://localhost:4848
  2. Click the Applications node in the tree on the left.

    The Applications page is displayed.

  3. Select the check box next to the hello sample application.
  4. Remove or disable the application.
    • To remove the application, click the Undeploy button.
    • To disable the application, click the Disable button.

See Also

For more information, see the Administration Console online help.

Deploying and Undeploying the Sample Application Automatically

GlassFish Server enables you to performing the following deployment-related tasks automatically:

To Deploy the Sample Application Automatically

You can deploy applications automatically by placing them in the as-install/domains/domain-name/autodeploy directory, where domain-name is the name of the domain for which you want to configure automatic deployment. For this example, use the default domain, domain1:

as-install/domains/domain1/autodeploy

Before You Begin

The sample application must be available before you start this task. To download the sample, see To Obtain the Sample Application.

To Undeploy the Sample Application Automatically

  1. Change to the domain's autodeploy directory.

    cd as-install/domains/domain-name/autodeploy

  2. Delete the sample application's WAR file to undeploy and remove the application.
    • On UNIX, Linux, and Mac OS X systems, type this command:
      rm hello.war
    • On Windows systems, type this command:
      del hello.war