Oracle GlassFish Server 3.0.1 Quick Start Guide

Deploying an Application From the Command Line

You can deploy applications from the command line using the asadmin deploy command.

ProcedureTo 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 Obtaining a Sample Application. At least one GlassFish Server domain must be started before you deploy the sample application.

  1. Use the asadmin deploy command.

    The general form for the command is:


    as-install/bin/asadmin deploy war-name
    

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


    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

See deploy(1) for more information about the deploy command.

See the Oracle GlassFish Server 3.0.1 Application Deployment Guide for more information about deploying applications from the command line.

ProcedureTo List Deployed Applications From the Command Line

  1. Use the asadmin list-applications command:


    as-install/bin/asadmin list-applications
    

ProcedureTo Undeploy the Sample Application From the Command Line

  1. Use the asadmin undeploy command.

    The general form for the command is:


    as-install/bin/asadmin undeploy war-name
    

    For war-name, use the literal hello, not the full hello.war name.

    For the hello.war example, the command is:


    as-install/bin/asadmin undeploy hello
    
See Also

See undeploy(1) for more information about the undeploy command.