oracle.com
GlassFish Server 3.1.1

GlassFish Server 3.1.1 Quick Start Guide

GlassFish Server provides a server for the development and deployment of Java Platform, Enterprise Edition (Java EE platform) applications and web technologies based on Java technology. GlassFish Server 3.1.1 provides the following:

The following topics are addressed in this guide:

About This Quick Start Guide

GlassFish Server 3.1.1 Quick Start Guide demonstrates key features of the GlassFish Server product and enables you to quickly learn the basics. Step-by-step procedures introduce you to product features and enable you to use them immediately.

This guide assumes that you have already obtained and installed the GlassFish Server 3.1.1 software. For more information about installing GlassFish Server 3.1.1, see the Oracle GlassFish Server 3.1 Installation Guide.

Instructions and examples in this guide that apply to all supported operating systems use the forward slash character (/) as path separators in all file names and commands. Ensure that you use the correct character for the system on which GlassFish Server is installed. For example:

This guide provides basic information only. For comprehensive information about GlassFish Server and other entities mentioned in this guide, see For More Information.

To review additional details about this release before you begin using the software, see the Oracle GlassFish Server 3.1 Release Notes. The Release Notes provide important information about the GlassFish Server 3.1 release, including details about new features, information about known issues and possible workarounds, and tips for installing and working with GlassFish Server 3.1.1 software.

When this Quick Start Guide is updated, the most recent version is available in the Oracle GlassFish Server 3.1.1 documentation library.

Default Paths and File Names

The following table describes the default paths and file names that are used in this book.

Table 1 Default Paths and File Names

Placeholder

Description

Default Value

as-install

Represents the base installation directory for GlassFish Server.

In configuration files, as-install is represented as follows:

${com.sun.aas.installRoot}

Installations on the Oracle Solaris operating system, Linux operating system, and Mac operating system:

user’s-home-directory/glassfish3/glassfish

Windows, all installations:

SystemDrive:\glassfish3\glassfish

as-install-parent

Represents the parent of the base installation directory for GlassFish Server.

Installations on the Oracle Solaris operating system, Linux operating system, and Mac operating system:

user’s-home-directory/glassfish3

Windows, all installations:

SystemDrive:\glassfish3

domain-root-dir

Represents the directory in which a domain is created by default.

as-install/domains/

domain-dir

Represents the directory in which a domain's configuration is stored.

In configuration files, domain-dir is represented as follows:

${com.sun.aas.instanceRoot}

domain-root-dir/domain-name

Default Administration Values

The following table lists default administration values for GlassFish Server. See Default Paths and File Names for more information about the as-install and domain-dir placeholders.

Table 2 Default Administration Values

Item

Default Value or Location

Domain name

domain1

Master password

changeit

asadmin(1M) command-line utility

as-install/bin

Configuration files

domain-dir/config

Log files

domain-dir/logs

Administration server port

4848

HTTP port

8080

HTTPS port

8181

Pure JMX clients port

8686

Message Queue port

7676

IIOP port

3700

IIOP/SSL port

3820

IIOP/SSL port with mutual authentication

3920

Starting and Stopping the Default Domain

When you install GlassFish Server, a default domain named domain1 is created. The following procedures describe how to start and stop domain1 when it is the only domain. For information about starting and stopping a domain when there are multiple domains, see Chapter 3, Administering Domains, in Oracle GlassFish Server 3.1 Administration Guide.

To Start the Default Domain

Before You Begin

GlassFish Server software must be installed before you start the domain.

To Stop the Default Domain

Starting and Stopping the Database Server

A database server is not started by default when you start the GlassFish Server domain. If your applications require a database back end, you must start and stop the database server manually.

The following procedures describe how to start and stop the Java DB server that is bundled with GlassFish Server. For information about starting and stopping other database servers, see the documentation for your specific product.

For the list of database products supported in this release, see the Oracle GlassFish Server 3.1-3.1.1 Release Notes.

For more information about database connectivity, see Chapter 12, Administering Database Connectivity, in Oracle GlassFish Server 3.1 Administration Guide.

To Start the Java DB Server

Before You Begin

At least one GlassFish Server domain must be started before you start the database server.

To Stop the Java DB Server

Starting the Administration Console

The GlassFish Server Administration Console provides a browser interface for configuring, administering, and monitoring GlassFish Server.

To Start the Administration Console

Before You Begin

At least one GlassFish Server domain must be started.

  1. Type the URL in your browser.

    The default URL for the Administration Console on the local host is as follows:

    http://localhost:4848
  2. If prompted, log in to the Administration Console.

    You will be prompted to log in if you chose to require an administration password at the time GlassFish Server was installed.

See Also

For more information, see the Administration Console online help.

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

Updating and Extending an Existing Installation

GlassFish Server provides an administrative tool called Update Tool that enables you to install updates and add-on components to your existing GlassFish Server installation. Update Tool can be accessed as a standalone graphical tool from the command line or as a browser-based graphical tool from the Administration Console. For more information about Update Tool, see Update Tool in Oracle GlassFish Server 3.1 Administration Guide.

To Access the Graphical Update Tool From the Command Line

See Also

A command-line interface is also available for Update Tool. The command-line interface uses the pkg command and enables you to perform most of the tasks provided by the graphical version. For more information about the pkg command, see Chapter 11, Extending and Updating GlassFish Server, in Oracle GlassFish Server 3.1 Administration Guide.

To Access Update Tool by Using the Administration Console

Before You Begin

At least one GlassFish Server domain must be started before you launch the Administration Console.

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

For more information, see the Administration Console online help.

Removing GlassFish Server 3.1.1 Software

Before removing the GlassFish Server software, stop the following processes:

For more information about performing these tasks, see Chapter 2, Uninstalling Oracle GlassFish Server 3.1, in Oracle GlassFish Server 3.1 Installation Guide.

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

  1. Change to the as-install-parent directory, which contains the uninstallation program.
  2. If necessary, grant execute permissions to the uninstallation program file.
    chmod +x ./uninstall.sh
  3. Run the uninstallation program.
    ./uninstall.sh
  4. Examine the contents of the remaining installation directories and remove any files or directories that you do not want, including hidden directories prefixed with a dot.

To Remove GlassFish Server Software on Windows Systems

  1. Change to the as-install-parent directory, which contains the uninstallation program.
  2. Run the uninstallation program.
    uninstall.exe
  3. Examine the contents of the remaining installation directories and remove any files or directories that you do not want, including hidden directories prefixed with a dot.

For More Information

Additional resources are available to help you learn more about GlassFish Server 3.1.1 and related technologies.

The following resources are described here:

Product Documentation

Comprehensive product documentation is available and includes the following.

GlassFish Communities

The following resources will help you connect with other users, learn more about GlassFish Server, and get help if needed.

Tutorials

The following tutorials provide working examples and detailed instructions for creating enterprise applications for the Java EE 6 platform.

Java EE 6 Samples

The sample applications demonstrate Java EE 6 technologies. The samples are available through Update Tool and also as part of the Java EE 6 SDK distributions. The SDK distributions are available from the Java EE downloads page.


Company Info   |   Contact   |   Copyright © 2011 Oracle Corporation   |   Legal Notices