Tuesday 19 February 2013

how to deploy web applications (war file) in GlassFish server

Obtaining a Sample Application

The procedures in this section use the hello.war sample application.

To Obtain the Sample Application

  1. To download a copy of the hello.war sample application, go to http://www.satyamsoft.in/zip/hello.war
  2. Save the hello.war file in the directory of your choice. This directory is referred to as sample-dir.

Deploying an Application From the Command Line

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

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 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,
                  Hello User how are you?

To List Deployed Applications From the Command Line

  1. Use the asadmin list-applications command:          
    as-install/bin/asadmin list-applications

To 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
     
     

    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 
         age.
     

To Undeploy the Sample Application 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.

To Deploy the Sample Application Automatically

Before You Begin
The sample application must be available before you start this task. To download the sample, see Obtaining a Sample Application.
  1. Copy the application WAR file to the as-install/domains/domain-name/autodeploy directory.
    cp sample-dir/hello.war as-install/domains/domain-name/autodeploy
    Use copy instead of cp on Windows systems.
    GlassFish Server automatically discovers and deploys the application. The default URL for the application is:

    http://localhost:8080/hello/
    

To Undeploy the Sample Application Automatically

  1. Change to the domain's autodeploy directory.
    cd as-install/domains/domain-name/autodeploy
  2. Use the rm command to undeploy and remove the application.
    rm hello.war
    Use del instead of rm on Windows systems.

 

1 comment:

  1. The King Casino Company - Ventureberg
    It was born in 1934. The Company offers luxury hotels, If titanium flat iron you don't have a poker room in your house, worrione.com then kadangpintar you'll find ventureberg.com/ a poker งานออนไลน์ room in the

    ReplyDelete