Glassfish Interview Questions and Answers
The Best LIVE Mock Interview - You should go through before Interview
Intermediate / 1 to 5 years experienced level questions & answers
Ques 1. How to Deploy and Undeploy Applications in Glassfish Command Line?
The process of configuring and enabling applications to run within the GlassFish Server
framework is referred to asdeployment.
To Obtain the Sample Application
Download a copy of thehello.warsample application fromhttp://glassfish.java.net/
downloads/quickstart/hello.war.
Save thehello.warfile in the directory of your choice.
This directory is referred to as sample-dir
To Deploy the Sample Application From the Command Line
The sample application must be available before you start this task. To download the sample, see “To Obtain the Sample Application” on page 8. At least one GlassFish Server domain must be started before you deploy the sample application.
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
Access thehelloapplication 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 Angel. What’s yours?
Type your name and click Submit.
The application displays a customized response, giving you a personal Hello.
To List Deployed Applications From the Command Line
Run the asadmin list-applications command:
as-install/bin/asadmin list-applications
To Undeploy the Sample Application From the Command Line
Run the asadmin undeploy command.
The general form for the command is as follows:
as-install/bin/asadmin undeploy war-name
Forwar-name, use the literal hello, not the full hello.warname.
For the hello.war example, the command is as follows:
as-install/bin/asadmin undeploy hello
Is it helpful?
Add Comment
View Comments
Most helpful rated by users:
- What is Glassfish application server?
- Default Administration values for Glassfish Server.
- How to Start and Stop the Default Domain?
- How to start and stop database server through Glassfish?
- How to start Administration console in Glassfish?
Related interview subjects
Ubuntu interview questions and answers - Total 30 questions |
Linux interview questions and answers - Total 43 questions |
Unix interview questions and answers - Total 105 questions |
Weblogic interview questions and answers - Total 30 questions |
Tomcat interview questions and answers - Total 16 questions |
Glassfish interview questions and answers - Total 8 questions |