Top 13 Glassfish Interview Questions
Q1. How To Start And Stop Database Server Through Glassfish?
A database server isn't always began through default whilst you start the GlassFish Server domain. If your programs require a database back quit, you need to start and forestall the database server manually.
The following techniques describe how to start and prevent the Java DB server this is bundled with GlassFish Server. For facts about beginning and stopping other database servers, see the documentation in your unique product.
To Start the Java DB Server
At least one GlassFish Server domain need to be started out earlier than you begin the database server.
Run the asadmin start-database command.
The trendy shape for the command is as follows:
as-install/bin/asadmin begin-database --dbhome directory-direction
For example, to begin the Java DB server from its default vicinity:
as-install/bin/asadmin start-database --dbhome as-set up-discern/javadb
To Stop the Java DB Server
Run the asadmin forestall-database command:
as-install/bin/asadmin prevent-database.
Q2. How To Deploy And Undeploy Applications In Glassfish Command Line?
The procedure of configuring and allowing packages to run within the GlassFish Server
framework is mentioned asdeployment.
To Obtain the Sample Application
Download a replica of thehello.Warsample software fromhttp://glassfish.Java.Internet/
downloads/quickstart/hello.Warfare.
Save thehello.Warfile within the listing of your preference.
This directory is referred to as pattern-dir
To Deploy the Sample Application From the Command Line
The pattern software should be available earlier than you start this undertaking. To down load the pattern, see “To Obtain the Sample Application” on page @At least one GlassFish Server area should be commenced before you install the pattern utility.
Run the asadmin set up command.
The widespread form for the command is as follows:
as-install/bin/asadmin installation warfare-name
To installation the hey.Conflict pattern, the command is as follows:
as-deploy/bin/asadmin deploy pattern-dir/hello.Struggle
Access thehelloapplication by means of typing the following URL to your browser:
http://localhost:8080/hello
The application's start page is displayed, and you're triggered to type your call.
Type your call and click Submit.
The software shows a customized reaction, supplying you with a private Hello.
To List Deployed Applications From the Command Line
Run the asadmin listing-applications command:
as-set up/bin/asadmin listing-applications
To Undeploy the Sample Application From the Command Line
Run the asadmin undeploy command.
The trendy shape for the command is as follows:
as-set up/bin/asadmin undeploy warfare-call
Forwar-name, use the literal whats up, now not the whole hiya.Warname.
For the hey.Struggle instance, the command is as follows:
as-deploy/bin/asadmin undeploy howdy
Q3. How To Start And Stop The Default Domain?
When you install GlassFish Server, a default area nameddomain1 is created. The following procedures describe how to begin and stopdomain1when it is the most effective domain.
To Start the Default Domain
GlassFish Server software should be hooked up earlier than you begin the area.
Run the asadmin start-area command with out an operand:
as-installation/bin/asadmin start-domain
The command starts offevolved the default domain, domain1.
For starting any domain (e.G domain name: employee): as-deploy/bin/asadmin start-domain employee
To Stop the Default Domain
Run the asadmin prevent-domain command without an operand:
as-installation/bin/asadmin forestall-domain
The command stops the default area, domain@for stopping any area (e.G area call: employee): as-deploy/bin/asadmin stop-area worker
Q4. Can I Evaluate Oracle Glassfish Server Or Oracle Glassfish Server Control Before Purchasing A Subscription?
Yes. Organizations interested by evaluating the technology can download it from e-transport.
Q5. What Are The Default Administrator Values For Glassfish Server?
Domain name : domain1
Master password : changeit
asadmin(1M) command-line application : as-set up/bin
Configuration documents : area-dir/config
Log documents : domain-dir/logs
Administration server port : 4848
HTTP port : 8080
HTTPS port : 8181
Pure JMX customers port : 8686
Message Queue port : 7676
IIOP port : 3700
IIOP/SSL port : 3820
IIOP/SSL port with mutual authentication : 3920
Q6. How To Start Administration Console In Glassfish?
The GlassFish Server Administration Console provides a browser interface for configuring,
administering, and tracking GlassFish Server.
To Start the Administration Console
At least one GlassFish Server domain should be commenced.
Type the URL on your browser.
The default URL for the Administration Console on the neighborhood host is as follows:
http://localhost:4848
If brought about, log in to the Administration Console.
You could be triggered to log in if you selected to require an management password on the time GlassFish Server turned into hooked up.
Q7. How To Deploy And Undeploy Application Automatically In Glassfish?
To Deploy the Sample Application Automatically
You can deploy programs automatically by placing them within the as-installation/domains/domain-call/autodeploydirectory, wheredomain-nameis the name of the area for which you want to configure computerized deployment.
For this case, use the default domain, domain1:
as-deploy/domains/domain1/autodeploy
The sample utility ought to be available before you start this mission.
Copy the applicationWAR document to theas-installation/domain names/domain-name/autodeploydirectory.
On UNIX, Linux, and Mac OS X systems, type this command:
cp pattern-dir/howdy.Battle as-deploy/domain names/area-call/autodeploy
OnWindows structures, kind this command:
replica pattern-dirhello.Battle as-installdomainsdomain-nameautodeploy
GlassFish Server mechanically discovers and deploys the application. The default URL for the software is as follows:
http://localhost:8080/howdy/
To Undeploy the Sample Application Automatically
Change to the area'sautodeploydirectory.
Cd as-installation/domains/area-name/autodeploy
Delete the sample application'sWAR record to undeploy and get rid of the software.
On UNIX, Linux, and Mac OS X structures, type this command:
rm whats up.Warfare
OnWindows systems, type this command:
del good day.Struggle
Q8. What Is The Relationship Between Sun Glassfish Enterprise Server And Oracle Glassfish Server?
Sun GlassFish Enterprise Server changed into renamed Oracle GlassFish Server in February 2010 when Oracle Corporation received Sun Microsystems.
Q9. Does Oracle Glassfish Server Include All Oracle Glassfish Server Control Features?
All Oracle GlassFish Server Control features are available with an Oracle GlassFish Server license.
Q10. What Is Glassfish Application Server?
GlassFish Server Open Source Edition offers a server for the development and deployment of Java Platform, Enterprise Edition (Java EE platform) programs and web technologies
based on Java generation. GlassFish Server three.1 affords the following:
A lightweight and extensible core based on OSGi Alliance standards
A internet field
An clean-to-use Administration Console for configuration and management
Update Tool connectivity for updates and add-on additives
Support for high availability clustering and load balancing.
Q11. When Should I Deploy Oracle Glassfish Server 2 Versus Oracle Glassfish Server three?
Oracle GlassFish Server 2 is satisfactory for deployments that require aid for Java Platform, Enterprise Edition 5 (Java EE five) fashionable, centralized administration, or clustering support for excessive availability. Oracle GlassFish Server 3 is good for agencies that want to leverage Java EE 6 preferred, improve developer productiveness, and permit lightweight deployments using the Java EE 6 Web Profile. It additionally offers service availability through the mod_jk load balancing.
Q12. What Is The Difference Between Sun Glassfish Enterprise Manager And Oracle Glassfish Server Control?
Sun GlassFish Enterprise Manager might be rebranded as Oracle GlassFish Server Control in the next release of the product.
Q13. How To Deploy And Undeploy Applications By Using The Administration Console?
The graphical Administration Console of GlassFish Server allows you to perform the subsequent deployment-associated duties:
To Deploy the Sample Application by Using the Administration Console
The pattern utility must be available earlier than you begin this mission. At least one GlassFish Server domain ought to be started before you set up the pattern utility.
Launch the Administration Console via typing the following URL in your browser: http://localhost:4848
Click the Applications node inside the tree on the left. The Applications web page is displayed.
Click the Deploy button. The Deploy Applications or Modules web page is displayed.
Select Packaged File to be Uploaded to the Server, and click on Browse.
Navigate to the region in that you stored thehello.Warsample, choose the document, and click on Open .You are returned to the Deploy Applications or Modules page.
Specify a description in the Description area, as an instance: hiya
Accept the opposite default settings, and click OK.You are returned to the Applications web page.
Select the check field subsequent to thehelloapplication and click the Launch hyperlink to run the software.
The default URL for the software is as follows:
http://localhost:8080/good day/
To View Deployed Applications inside the Administration Console
1) Launch the Administration Console by means of typing the subsequent URL to your browser:
http://localhost:4848
2) Click the Applications node inside the tree on the left.
Expand the node to list deployed applications. Deployed packages are also listed in the table at the Applications web page.
To Undeploy the Sample Application by way of Using the Administration Console
Launch the Administration Console by using typing the following URL for your browser http://localhost:4848
Click the Applications node within the tree on the left.
The Applications web page is displayed.
Select the take a look at box subsequent to thehellosample software.
Remove or disable the utility.
To cast off the application, click on the Undeploy button.
To disable the software, click the Disable button.
