Quick Start for Basic Features
- 1 Quick Start for Basic Features
- About This Quick Start Guide
- Default Paths and File Names
- Default Administration Values
- Starting and Stopping the Default Domain
- Starting and Stopping the Database Server
- Starting the Administration Console
- Deploying and Undeploying Applications
- High Availability Clustering and Load Balancing
- For More Information
1 Quick Start for Basic Features
Eclipse GlassFish provides a server for the development and deployment of Java Platform, Enterprise Edition (Jakarta EE platform) applications and web technologies based on Java technology. Eclipse GlassFish 7 provides the following:
-
A lightweight and extensible core based on OSGi Alliance standards
-
A web container
-
An easy-to-use Administration Console for configuration and management
-
Support for high availability clustering and load balancing
The following topics are addressed here:
About This Quick Start Guide
Eclipse GlassFish 7 Quick Start Guide demonstrates key features of the Eclipse GlassFish product and enables you to quickly learn the basics. Step-by-step procedures introduce you to product features and enable you to use them immediately.
This guide assumes that you have already obtained and installed the Eclipse GlassFish 7 software. For more information about installing Eclipse GlassFish 7, see the Eclipse GlassFish Installation Guide.
Instructions and examples in this guide that apply to all supported
operating systems use the forward slash character (/) as path
separators in all file names and commands. Ensure that you use the
correct character for the system on which Eclipse GlassFish is installed.
For example:
-
UNIX, Linux, or Mac OS X systems: as-install
/bin/asadmin -
Windows systems: as-install
\bin\asadmin
This guide provides basic information only. For comprehensive information about Eclipse GlassFish and other entities mentioned in this guide, see For More Information.
To review additional details about this release before you begin using the software, see the Eclipse GlassFish Release Notes. The Release Notes provide important information about the Eclipse GlassFish 7 release, including details about new features, information about known issues and possible workarounds, and tips for installing and working with Eclipse GlassFish 7 software.
Default Paths and File Names
The following table describes the default paths and file names that are used in this book.
Table 1-1 Default Paths and File Names
| Placeholder | Description | Default Value |
|---|---|---|
as-install |
Represents the base installation directory for Eclipse GlassFish. |
Installations on the Oracle Solaris operating system, Linux operating system, and Mac OS operating system: user’s-home-directory Installations on the Windows operating system: SystemDrive |
as-install-parent |
Represents the parent of the base installation directory for Eclipse GlassFish. |
Installations on the Oracle Solaris operating system, Linux operating system, and Mac operating system: user’s-home-directory Installations on the Windows operating system: SystemDrive |
domain-root-dir |
Represents the directory in which a domain is created by default. |
as-install |
domain-dir |
Represents the directory in which a domain’s configuration is stored. |
domain-root-dir |
instance-dir |
Represents the directory for a server instance. |
domain-dir |
Default Administration Values
The following table lists default administration values for Eclipse GlassFish. See Default Paths and File Names for more information about the as-install and domain-dir placeholders.
Table 1-2 Default Administration Values
| Item | Default Value or Location |
|---|---|
Domain name |
|
Master password |
|
|
as-install |
Configuration files |
domain-dir |
Log files |
domain-dir |
Administration server port |
|
HTTP port |
|
HTTPS port |
|
Pure JMX clients port |
|
Message Queue port |
|
IIOP port |
|
IIOP/SSL port |
|
IIOP/SSL port with mutual authentication |
|
Starting and Stopping the Default Domain
When you install Eclipse GlassFish, a default domain named domain1 is
created. The following procedures describe how to start and stop
domain1 when it is the only domain. For information about starting and
stopping a domain when there are multiple domains, see
"Administering Domains" in Eclipse GlassFish Administration Guide.
Starting and Stopping the Database Server
A database server is not started by default when you start the Eclipse GlassFish 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 Apache Derby server that is bundled with Eclipse GlassFish. For information about starting and stopping other database servers, see the documentation for your specific product.
For the list of database products supported in this release, see the Eclipse GlassFish Release Notes.
For more information about database connectivity, see "Administering Database Connectivity" in Eclipse GlassFish Administration Guide.
To Start the Apache Derby Server
Before You Begin
At least one Eclipse GlassFish 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 Apache Derby server from its default location:
as-install/bin/asadmin start-database --dbhome as-install-parent/javadb
Starting the Administration Console
The Eclipse GlassFish Administration Console provides a browser interface for configuring, administering, and monitoring Eclipse GlassFish.
To Start the Administration Console
Before You Begin
At least one Eclipse GlassFish domain must be started.
-
Type the URL in your browser.
The default URL for the Administration Console on the local host is as follows:
http://localhost:4848 -
If prompted, log in to the Administration Console.
You will be prompted to log in if you chose to require an administration password at the time Eclipse GlassFish was installed.
See Also
For more information, see the Administration Console online help.
Deploying and Undeploying Applications
The process of configuring and enabling applications to run within the Eclipse GlassFish framework is referred to as deployment.
This section explains how to deploy, list, and undeploy applications.
The procedures in this section use the hello.war sample application.
The following topics are addressed here:
To Obtain the Sample Application
-
Download a copy of the
hello.warsample application fromhttps://glassfish.org/downloads/quickstart/hello.war. -
Save the
hello.warfile in the directory of your choice.This directory is referred to as sample-dir.
Deploying and Undeploying the Sample Application From the Command Line
Eclipse GlassFish provides asadmin subcommands for performing the
following deployment-related tasks:
To Deploy the Sample Application From the Command Line
Before You Begin
The sample application must be available before you start this task. To download the sample, see To Obtain the Sample Application. At least one Eclipse GlassFish domain must be started before you deploy the sample application.
-
Run the
asadmin deploycommand.The general form for the command is as follows:
as-install/bin/asadmin deploy war-nameTo deploy the
hello.warsample, the command is as follows:as-install/bin/asadmin deploy sample-dir/hello.war -
Access the
helloapplication by typing the following URL in your browser:http://localhost:8080/helloThe application’s start page is displayed, and you are prompted to type your name.
Hi, my name is Duke. What's yours? -
Type your name and click Submit.
The application displays a customized response, giving you a personal
Hello.
See Also
For more information about the deploy subcommand, see
deploy(1).
For more information about deploying applications from the command line, see the Eclipse GlassFish Application Deployment Guide.
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
For war-name, use the literal hello, not the full hello.war name.
For the hello.war example, the command is as follows:
as-install/bin/asadmin undeploy hello
See Also
For more information about the undeploy subcommand, see
undeploy(1).
Deploying and Undeploying Applications by Using the Administration Console
The graphical Administration Console of Eclipse GlassFish enables you to perform the following deployment-related tasks:
To Deploy the Sample Application by Using the Administration Console
Before You Begin
The sample application must be available before you start this task. To download the sample, see To Obtain the Sample Application. At least one Eclipse GlassFish domain must be started before you deploy the sample application.
-
Launch the Administration Console by typing the following URL in your browser:
http://localhost:4848 -
Click the Applications node in the tree on the left.
The Applications page is displayed.
-
Click the Deploy button.
The Deploy Applications or Modules page is displayed.
-
Select Packaged File to be Uploaded to the Server, and click Browse.
-
Navigate to the location in which you saved the
hello.warsample, select the file, and click Open.You are returned to the Deploy Applications or Modules page.
-
Specify a description in the Description field, for example:
hello -
Accept the other default settings, and click OK.
You are returned to the Applications page.
-
Select the check box next to the
helloapplication and click the Launch link to run the application.The default URL for the application is as follows:
http://localhost:8080/hello/
See Also
For more information, see the Administration Console online help.
To View Deployed Applications in the Administration Console
-
Launch the Administration Console by typing the following URL in your browser:
http://localhost:4848 -
Click the Applications node in the tree on the left.
Expand the node to list deployed applications. Deployed applications are also listed in the table on the Applications page.
To Undeploy the Sample Application by Using the Administration Console
-
Launch the Administration Console by typing the following URL in your browser:
http://localhost:4848 -
Click the Applications node in the tree on the left.
The Applications page is displayed.
-
Select the check box next to the
hellosample application. -
Remove or disable the application.
-
To remove the application, click the Undeploy button.
-
To disable the application, click the Disable button.
-
See Also
For more information, see the Administration Console online help.
Deploying and Undeploying the Sample Application Automatically
Eclipse GlassFish enables you to performing the following deployment-related tasks automatically:
To Deploy the Sample Application Automatically
You can deploy applications automatically by placing them in the
domain-dir/autodeploy directory, where domain-dir is the directory of
the domain for which you want to configure automatic deployment. For
this example, use the default domain, domain1, in the default
domain-root-dir, which is as-install/domains:
as-install/domains/domain1/autodeploy
Before You Begin
The sample application must be available before you start this task. To download the sample, see To Obtain the Sample Application.
Copy the application WAR file to the domain-dir/autodeploy directory.
-
On UNIX, Linux, and Mac OS X systems, type this command:
cp sample-dir/hello.war as-install/domains/domain-dir/autodeploy -
On Windows systems, type this command:
copy sample-dir\hello.war as-install\domains\domain-dir\autodeploy
Eclipse GlassFish 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’s
autodeploydirectory.cd as-install\domains\domain-dir\autodeploy -
Delete the sample application’s WAR file to undeploy and remove the application.
-
On UNIX, Linux, and Mac OS X systems, type this command:
rm hello.war -
On Windows systems, type this command:
del hello.war
-
High Availability Clustering and Load Balancing
Eclipse GlassFish enables multiple Eclipse GlassFish instances to be clustered to provide high availability through failure protection, scalability, and load balancing. The subsections that follow provide an overview of high availability clustering and load balancing for Eclipse GlassFish.
Clusters of Eclipse GlassFish Instances
A cluster is a collection of Eclipse GlassFish instances that work together as one logical entity. A cluster provides a runtime environment for one or more Java Platform, Enterprise Edition (Jakarta EE) applications. A cluster provides high availability through failure protection, scalability, and load balancing.
A Eclipse GlassFish instance is a single Virtual Machine for the Java platform (Java Virtual Machine or JVM machine) on a single node in which Eclipse GlassFish is running. A node defines the host where the Eclipse GlassFish instance resides. The JVM machine must be compatible with the Java Platform, Enterprise Edition (Jakarta EE).
Eclipse GlassFish instances form the basis of an application deployment. An instance is a building block in the clustering, load balancing, and session persistence features of Eclipse GlassFish. Each instance belongs to a single domain and has its own directory structure, configuration, and deployed applications. Every instance contains a reference to a node that defines the host where the instance resides.
For more information, see the following documentation:
-
"Administering Eclipse GlassFish Nodes" in Eclipse GlassFish High Availability Administration Guide
-
"Administering Eclipse GlassFish Clusters" in Eclipse GlassFish High Availability Administration Guide
-
"Administering Eclipse GlassFish Instances" in Eclipse GlassFish High Availability Administration Guide
Session Persistence and Failover
Storing session state data enables the session state to be recovered after the failover of an instance in a cluster. Recovering the session state enables the session to continue without loss of information. Eclipse GlassFish supports in-memory session replication on other servers in the cluster for maintaining HTTP session and stateful session bean data.
For more information, see "Configuring High Availability Session Persistence and Failover" in Eclipse GlassFish High Availability Administration Guide.
Load Balancing for Clustered Configurations
Eclipse GlassFish supports web server and hardware-based load balancing for clustered configurations. A load balancer is deployed with a cluster, and provides the following features:
-
Allows an application or service to be scaled horizontally across multiple physical (or logical) hosts yet still present the user with a single URL
-
Insulates the user from host failures or server crashes when used with session persistence
-
Enhances security by hiding the internal network from the user
Eclipse GlassFish is compatible with the Apache HTTP
server mod_jk module for load balancing.
Eclipse GlassFish load balancing configurations can vary widely depending on the needs of your enterprise. For complete information about configuring load balancing in Eclipse GlassFish, see the following documentation:
-
" Configuring HTTP Load Balancing" in Eclipse GlassFish High Availability Administration Guide
-
" RMI-IIOP Load Balancing and Failover" in Eclipse GlassFish High Availability Administration Guide
For More Information
Additional resources are available to help you learn more about Eclipse GlassFish 7 and related technologies.
The following resources are described here:
Product Documentation
Comprehensive product documentation is available and includes the following.
-
Eclipse GlassFish Release Notes: Latest details about new features, known issues, and tips for installing and working with Eclipse GlassFish software.
Tutorials
The following tutorials provide working examples and detailed instructions for creating enterprise applications for the Jakarta EE platform.
-
Your First Cup: An Introduction to the Jakarta EE Platform. For beginning Jakarta EE programmers, this short tutorial explains the entire process for developing a simple enterprise application. The sample application is a web application that consists of a component that is based on the Enterprise JavaBeans specification, a JAX-RS web service, and a JavaServer Faces component for the web front end.
-
The Jakarta EE Tutorial. This comprehensive tutorial explains how to use Jakarta EE platform technologies and APIs to develop Jakarta EE applications.
Jakarta EE Examples
Jakarta EE Examples - The example applications demonstrate Jakarta EE technologies.