Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Glassfish Interview Questions and Answers

Question: How to deploy and undeploy application automatically in Glassfish?
Answer:
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? Yes No

Most helpful rated by users:

©2024 WithoutBook