GlassFish Server

GlassFish Application Server

GlassFish is an open-source Java EE application server that provides enterprise-level reliability, performance, clustering, and centralized administration through its web-based management console.

GlassFish Overview

GlassFish was started by Sun Microsystems for the Java EE platform and is now sponsored by Oracle. It is distributed under the Common Development and Distribution License and the GNU General Public License with the Classpath Exception.

The server provides a broad feature set, full clustering capabilities, and centralized management through the GlassFish administration panel. This functionality also means that GlassFish generally consumes more resources than lightweight servlet containers.

GlassFish Installation

1

Open the environment wizard

Sign in to the platform dashboard and click New Environment.

2

Select GlassFish

Open the Java tab and choose GlassFish from the application-server section.

Select GlassFish in the Java topology wizard
Choose GlassFish from the Java application-server list.
3

Create and open the environment

Complete the topology configuration and create the environment. When provisioning finishes, click Open in Browser beside the GlassFish node.

Open the GlassFish server in a browser
Open the newly created GlassFish server from the dashboard.

Deploy a Java Application

Upload the Java application WAR package through Deployment Manager and deploy it to the GlassFish environment.

Open the GlassFish Administration Panel

The GlassFish administration panel can be opened directly from the platform dashboard. The admin interface opens in a new browser tab.

Open the GlassFish administration panel
Access the GlassFish administration panel from the dashboard.
i

Cluster name

The platform uses gfcluster as the GlassFish cluster. Apply cluster-level changes to gfcluster.

GlassFish admin console and gfcluster
Use the gfcluster entry for cluster-level administration.

Public IP and GlassFish Admin Port

When a public IP is attached to the application-server node, the default GlassFish administration port is 4848. The listener is configured in:

/opt/glassfish3/glassfish/domains/domain1/config/domain.xml

Add or update the admin listener as follows:

<http-listener id="admin-listener"
  port="4848"
  address="0.0.0.0"
  default-virtual-server="__asadmin"
  server-name="" />
GlassFish admin-listener configuration
Configure the GlassFish admin listener in domain.xml.
i

Derby database

The internal GlassFish Derby database is disabled by default to reduce resource consumption.

Resource Consumption

The following values illustrate the documented memory consumption for several GlassFish topologies.

ConfigurationIdleWith Admin Panel Open
1 GlassFish node530–540 MB (5 Cloudlets)800–820 MB (7 Cloudlets)
2 GlassFish nodes, HA off820–830 MB (9 Cloudlets)980–1000 MB (10 Cloudlets)
3 GlassFish nodes1050–1060 MB (11 Cloudlets)1210–1220 MB (13 Cloudlets)
4 GlassFish nodes, HA off1430–1450 MB (14 Cloudlets)1560–1580 MB (15 Cloudlets)
2 GlassFish nodes, HA on830–850 MB (9 Cloudlets)1030–1050 MB (10 Cloudlets)
4 GlassFish nodes, HA on1360–1380 MB (14 Cloudlets)1590–1610 MB (16 Cloudlets)

Plan resources carefully

GlassFish provides extensive enterprise functionality, but it requires more memory than lightweight application servers. Size the environment according to the node count, high-availability mode, and expected use of the administration panel.

Expected Result

A GlassFish environment is created and accessible from the dashboard. Java WAR applications can be deployed to it, the administration console can be opened for management, and cluster-level changes can be applied through gfcluster.

Important Notes

  • GlassFish consumes more resources than lightweight servlet containers.
  • Apply cluster-level changes to gfcluster.
  • Port 4848 is the default administration-panel port.
  • Protect direct public access to the administration panel with firewall and authentication controls.
  • The internal Derby database is disabled by default.
  • Review memory consumption before enabling high availability or adding more nodes.

Common Issues and Solutions

IssueSolution
GlassFish is unavailable in the wizardCheck the Java application-server list and the provider’s current software-stack availability.
Administration panel does not openCheck the node status, port 4848, public-IP settings, listener configuration, and firewall rules.
Cluster changes do not applyConfirm that the change was applied to gfcluster.
Environment consumes more memory than expectedReview node count, HA mode, admin-panel usage, and Cloudlet limits.
WAR deployment failsCheck application compatibility, archive structure, deployment context, and GlassFish logs.