Glassfish Interview Questions and Answers
The Best LIVE Mock Interview - You should go through before Interview
Experienced / Expert level questions & answers
Ques 1. How to start and stop database server through Glassfish?
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.
To Start the Java DB Server
At least one GlassFish Server domain must be started before you start the database server.
Run the asadmin start-database command.
The general form for the command is as follows:
as-install/bin/asadmin start-database --dbhome directory-path
For example, to start the Java DB server from its default location:
as-install/bin/asadmin start-database --dbhome as-install-parent/javadb
To Stop the Java DB Server
Run the asadmin stop-database command:
as-install/bin/asadmin stop-database
Is it helpful?
Add Comment
View Comments
Ques 2. How to deploy and undeploy application automatically in Glassfish?
To Deploy the Sample Application Automatically
You can deploy applications automatically by placing them in the
as-install/domains/domain-name/autodeploydirectory, wheredomain-nameis 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
The sample application must be available before you start this task.
Copy the applicationWAR file to theas-install/domains/domain-name/autodeploydirectory.
■ On UNIX, Linux, and Mac OS X systems, type this command:
cp sample-dir/hello.war as-install/domains/domain-name/autodeploy
■ OnWindows systems, type this command:
copy sample-dirhello.war as-installdomainsdomain-nameautodeploy
GlassFish Server automatically discovers and deploys the application. The default URL for the application is as follows:
http://localhost:8080/hello/
To Undeploy the Sample Application Automatically
Change to the domain'sautodeploydirectory.
cd as-install/domains/domain-name/autodeploy
Delete the sample application'sWAR file to undeploy and remove the application.
■ On UNIX, Linux, and Mac OS X systems, type this command:
rm hello.war
■ OnWindows systems, type this command:
del hello.war
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 |