Prepare Interview

Exams Attended

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Glassfish Interview Questions and Answers

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:

Related interview subjects

Core Java interview questions and answers - Total 306 questions
Tomcat interview questions and answers - Total 16 questions
Apache Wicket interview questions and answers - Total 26 questions
Java Applet interview questions and answers - Total 29 questions
JAXB interview questions and answers - Total 18 questions
JMS interview questions and answers - Total 64 questions
Log4j interview questions and answers - Total 35 questions
Struts interview questions and answers - Total 84 questions
RMI interview questions and answers - Total 31 questions
Apache Camel interview questions and answers - Total 20 questions
JDBC interview questions and answers - Total 27 questions
Java 11 interview questions and answers - Total 24 questions
JPA interview questions and answers - Total 41 questions
EJB interview questions and answers - Total 80 questions
GWT interview questions and answers - Total 27 questions
Kotlin interview questions and answers - Total 30 questions
Glassfish interview questions and answers - Total 8 questions
Google Gson interview questions and answers - Total 8 questions
JSP interview questions and answers - Total 49 questions
J2EE interview questions and answers - Total 25 questions
Apache Tapestry interview questions and answers - Total 9 questions
Java Swing interview questions and answers - Total 27 questions
Java Mail interview questions and answers - Total 27 questions
Hibernate interview questions and answers - Total 52 questions
JSF interview questions and answers - Total 24 questions
Java 8 interview questions and answers - Total 30 questions
Java 15 interview questions and answers - Total 16 questions
JBoss interview questions and answers - Total 14 questions
Web Services interview questions and answers - Total 10 questions
RichFaces interview questions and answers - Total 26 questions
Servlets interview questions and answers - Total 34 questions
Java Beans interview questions and answers - Total 57 questions
Spring Boot interview questions and answers - Total 50 questions
JUnit interview questions and answers - Total 24 questions
Spring Framework interview questions and answers - Total 53 questions
Java Design Patterns interview questions and answers - Total 15 questions
©2023 WithoutBook