Chapter 1 Overview of GlassFish Server Administration (Oracle GlassFish Server 3.0.1 Administration Guide) (2024)

Oracle GlassFish Server 3.0.1 providesan environment for developing and deploying Java applicationsand web services.

As an GlassFish Server administrator, your main responsibilities are toestablish a secure GlassFish Server environment and to oversee the services,resources, and users that participate in that environment. Your key tasksinclude configuring resources and services, managing GlassFish Server at runtime,and fixing problems that are associated with the server. You might also beinvolved in installing software, integrating add-on components, and deployingapplications.

The following topics are addressed here:

  • Default Settings and Locations

  • Configuration Tasks

  • Administration Tools

  • Instructions for Administering GlassFish Server

After installation, you might need to perform some immediate configurationtasks to make your installation function as intended. If configuration defaultshave been accepted, some features are enabled and some not. For an overviewof initial configuration tasks for GlassFish Server services and resources, see Initial Configuration Tasks.

In addition, you might want to reset default passwords, change namesor locations of files, and so on. The following tables list the default administrationvalues.

Note –

For the zip bundle of GlassFish Server 3.0.1, the default administratorlogin is admin, with no password, which means that no loginis required.

Table1–1 Default Administration Values

Item

Default

Domain Name

domain1

Master Password

changeit

Administration Password

admin

Administration Server Port

4848

HTTP Port

8080

HTTPS Port

8181

Pure JMX Clients Port

8686

Message Queue Port

7676

IIOP Port

3700

IIOP/SSL Port

3820

IIOP/SSL Port With Mutual Authentication

3920

Table1–2 Default Locations

Item

Default

Command-line Utility (asadmin)

as-install/bin

Configuration Files

domain-dir/config

Log Files

domain-dir/logs

Upgrade Tool (asupgrade Command)

as-install/bin

Update Tool and pkg Command

as-install-parent/bin

For information about replaceable items and default paths and files,see Default Paths and File Names.

Some configuration tasks must be performed directly after installationfor your GlassFish Server environment to work as intended. For example, if youare using a database with GlassFish Server, you need to set up database connectivityright away.

Some configuration situations are ongoing and will require you to makechanges many times during the life of your installation. You can use eitherthe Administration Console or the asadmin utility to modify theconfiguration. Changes are automatically applied to the appropriate configurationfile.

The following topics are addressed here:

  • Initial Configuration Tasks

  • How Dotted Names Work for Configuration

  • Configuration Files

  • Impact of Configuration Changes

Initial Configuration Tasks

This section maps the common configuration tasks to the command–lineprocedures in this guide. In some situations, the resource or service is automaticallyenabled and your configuration tasks involve adjusting or changing the defaultsettings to suit your specific needs.

The following resources and services frequently require configurationimmediately after installation:

System Properties

See Administering System Properties.

Domains

The initial domain1 is created during installation.Additional configuration tasks might include such tasks as configuring additionaldomains or setting up automatic restart. See Chapter3, Administering Domains.

JVM

The initial tasks for configuring the JVM include creatingJVM options and profilers. See Chapter4, Administering the Virtual Machine for the Java Platform.

Logging

By default, logging is enabled, so basic logging works withoutadditional configuration. However, you might want to change log levels, propertyvalues, or the location of log files. See Chapter7, Administering the Logging Service.

Monitoring

By default, the monitoring service is enabled. However, monitoringfor the individual modules is not enabled, so your first monitoring task isto enable monitoring for the modules that you want to monitor. See Chapter8, Administering the Monitoring Service.

Life Cycle Modules

See Chapter9, Administering Life Cycle Modules.

Security
  • System Security. Initialconfiguration tasks might include setting up passwords, audit modules, andcertificates. See Chapter11, Administering System Security.

  • User Security. Initialconfiguration tasks might include creating authentication realms and fileusers. See Chapter12, Administering User Security.

  • Message Security. Initialconfiguration tasks might include configuring a Java Cryptography Extension(JCE) provider, enabling default and non-default security providers, and configuringmessage protection policies. See Chapter13, Administering Message Security.

Database Connectivity

The initial tasks involved in configuring GlassFish Server toconnect to the Java DB database include creating a Java Database Connectivity(JDBC) connection pool, creating a JDBC resource, and integrating a JDBC driver.See Chapter14, Administering Database Connectivity .

EIS Connectivity

The initial tasks involved in configuring GlassFish Server toconnect to an enterprise information system (EIS) include creating a connectorconnection pool, creating a connector resource, editing a resource adapterconfiguration, creating a connector security map, creating a connector worksecurity map, and creating an administered object (if needed). See Chapter15, Administering EIS Connectivity.

Internet Connectivity

The initial tasks involved in making deployed web applicationsaccessible by internet clients include creating HTTP network listeners andvirtual servers, and configuring the HTTP listeners for SSL (if needed). See Chapter16, Administering Internet Connectivity.

Object Request Broker (ORB)

An initial configuration task might involve creating an IIOPlistener. See Chapter17, Administering the Object Request Broker (ORB).

JavaMail Service

An initial configuration task might involve creating a JavaMailresource. See Chapter18, Administering the JavaMail Service.

Java Message Service (JMS)

Initial configuration tasks might include creating a physicaldestination, creating connection factories or destination resources, creatinga JMS host (if the default JMS host is not adequate), adjusting connectionpool settings (if needed), and configuring resource adapters for JMS. See Chapter19, Administering the Java Message Service (JMS).

JNDI Service

An initial configuration task might involve creating a JNDIresource. See Chapter20, Administering the Java Naming and Directory Interface (JNDI) Service.

Information and instructions for accomplishing the tasks by using the Administration Console arecontained in the Administration Console online help.

How Dotted Names Work for Configuration

After the initial configuration is working, you will continue to manageongoing configuration for the life of your GlassFish Server installation. Youmight need to adjust resources to improve productivity, or issues might arisethat require settings to be modified or defaults to be reset. In some situations,an asadmin subcommand is provided for updating, such asthe update-connector-work-security-map subcommand. However,most updating is done by using the list, get,and set subcommands with dotted names. For detailed informationabout dotted names, see the dotted-names(5ASC) help page.

Note –

Dotted names also apply to monitoring, but the method is different.For information on using dotted names for monitoring, see How the Monitoring Tree Structure Works.

The general process for working with configuration changes on the commandline is as follows:

  1. List the modules for the component of interest.

    Thefollowing single mode example uses the | (pipe) character and the grep commandto narrow the search:


    asadmin list "*" | grep http | grep listener

    Information similar to the following is returned:


    configs.config.server-config.network-config.network-listeners.network-listener.http-listener-1configs.config.server-config.network-config.network-listeners.network-listener.http-listener-2configs.config.server-config.network-config.protocols.protocol.admin-listener.httpconfigs.config.server-config.network-config.protocols.protocol.admin-listener.http.file-cacheconfigs.config.server-config.network-config.protocols.protocol.http-listener-1configs.config.server-config.network-config.protocols.protocol.http-listener-1.httpconfigs.config.server-config.network-config.protocols.protocol.http-listener-1.http.file-cacheconfigs.config.server-config.network-config.protocols.protocol.http-listener-2configs.config.server-config.network-config.protocols.protocol.http-listener-2.httpconfigs.config.server-config.network-config.protocols.protocol.http-listener-2.http.file-cacheconfigs.config.server-config.network-config.protocols.protocol.http-listener-2.ssl
  2. Get the attributes that apply to the module you are interestedin.

    The following multimode example gets the attributes and valuesfor http-listener-1:


    asadmin> get server-config.network-config.network-listeners.network-listener.http-listener-1.* 

    Information similar to the following is returned:


    server.http-service.http-listener.http-listener-1.acceptor-threads = 1server.http-service.http-listener.http-listener-1.address = 0.0.0.0server.http-service.http-listener.http-listener-1.blocking-enabled = falseserver.http-service.http-listener.http-listener-1.default-virtual-server = serverserver.http-service.http-listener.http-listener-1.enabled = trueserver.http-service.http-listener.http-listener-1.external-port =server.http-service.http-listener.http-listener-1.family = inetserver.http-service.http-listener.http-listener-1.id = http-listener-1server.http-service.http-listener.http-listener-1.port = 8080server.http-service.http-listener.http-listener-1.redirect-port =server.http-service.http-listener.http-listener-1.security-enabled = falseserver.http-service.http-listener.http-listener-1.server-name =server.http-service.http-listener.http-listener-1.xpowered-by = true
  3. Modify an attribute by using the set subcommand.

    This example sets the security-enabled attributeof http-listener-1 to true:


    asadmin> set server.http-service.http-listener.http-listener-1.security-enabled = true

Configuration Files

The bulk of the configuration information about GlassFish Server resources,applications, and server instances is stored in the domain.xml configurationfile. This file is the central repository for a given administrative domainand contains an XML representation of the GlassFish Server domain model. Defaultlocation for the domain.xml file is as-install/glassfish3/glassfish/domains/domain-name/config. For details on the domain.xml file,see Oracle GlassFish Server 3.0.1 Domain File Format Reference.

The logging.properties file is used to configurelogging levels for individual modules. The file is located in the same directoryas the domain.xml file. For further information on the logging.properties file, see Setting Log Levels.

The asenv.conf file is located in the as-install/glassfishv3/glassfish/config directory.It's purpose is to store the GlassFish Server environment variables, such asthe installation location of the database, Message Queue, and so on.

Note –

Changes are automatically applied to the appropriate configurationfile. Do not edit the configuration files directly. Manual editing is proneto error and can have unexpected results.

Impact of Configuration Changes

Configuration changes often require that you restart GlassFish Server forthe changes to take effect. In other cases, changes are applied dynamicallywithout requiring that GlassFish Server be restarted. The procedures in thisguide indicate when you need to restart the server.

  • Configuration Changes That Require Server Restart

  • Dynamic Configuration Changes

Configuration Changes That Require ServerRestart

When making any of the following configuration changes, you must restartthe server for the changes to take effect:

  • Changing JVM options

  • Changing port numbers

  • Changing log handler elements

  • Configuring certificates

  • Managing HTTP, JMS, IIOP, JNDI services

  • Creating or deleting resources (Exception: Some JDBC, JMS,or connector resources do not require restart.)

  • Modifying the following JDBC connection pool properties:

    • datasource-classname

    • associate-with-thread

    • lazy-connection-association

    • lazy-connection-enlistment

    • JDBC driver vendor-specific properties

  • Modifying the following connector connection pool properties:

Dynamic Configuration Changes

With dynamic configuration, changes take effectwhile the server is running. To make the following configuration changes,you do not need to restart the server:

  • Adding or deleting add-on components

  • Adding or removing JDBC, JMS, and connector resources andpools (Exception: Some connection pool properties require restart.)

  • Adding file realm users

  • Changing logging levels

  • Enabling and disabling monitoring

  • Changing monitoring levels for modules

  • Enabling and disabling resources and applications

  • Deploying, undeploying, and redeploying applications

For the most part, you can perform the same tasks by using either thegraphical Administration Console or the asadmin command-line utility,however, there are exceptions.

The following GlassFish Server administration tools are described here:

  • Administration Console

  • asadmin Utility

  • REST Interfaces

  • Update Tool

  • OSGi Module Management Subsystem

  • keytool Utility

  • Java Monitoring and Management Console (JConsole)

  • Application Server Management Extension (AMX)

Administration Console

The Administration Console is a browser-based utility that features an easy-to-navigategraphical interface that includes extensive online help for the administrativetasks.

To use the Administration Console, the domain administration server (DAS)must be running. Each domain has its own DAS, which has a unique port number.When GlassFish Server was installed, you chose a port number for the DAS, orused the default port of 4848. You also specified a user name and passwordif you did not accept the default login (admin with nopassword).

When specifying the URL for the Administration Console, use the port numberfor the domain to be administered. The format for starting the Administration Console ina web browser is http://hostname:port. For example:


http://kindness.sun.com:4848

If the Administration Console is running on the host where GlassFish Server wasinstalled, specify localhost for the host name. For example:


http://localhost:4848

For Microsoft Windows, an alternate way to start the GlassFish Server Administration Console isby using the Start menu.

You can display the help material for a page in the Administration Console byclicking the Help button on the page. The initial help page describes thefunctions and fields of the page itself. Associated task instructions canbe accessed on additional pages by clicking a link in the See Also list.

asadmin Utility

The asadmin utility is a command-line tool that runssubcommands for identifying the operation or task that you want to perform. You can run asadmin subcommands either from a commandprompt or from a script. Running asadmin subcommands froma script is helpful for automating repetitive tasks. Basic information abouthow the asadmin utility works can be found in the asadmin(1M) help page.For instructions on using the asadmin utility, see Using the asadmin Utility.

To issue an asadmin subcommand in the standard commandshell (single mode), go to the as-install/bin directoryand type the asadmin command followed by a subcommand.For example:


asadmin list-jdbc-resources

You can invoke multiple command mode (multimode) by typing asadmin at the command prompt, after which the asadmin> prompt is presented. The asadmin utilitycontinues to accept subcommands until you exit multimode and return to thestandard command shell. For example:


asadmin> list-jdbc-resources

You can display a help page for any asadmin subcommandby typing help before the subcommand name. For example:


asadmin> help restart-domain

or


asadmin help restart-domain

A collection of the asadmin help pages is availablein HTML and PDF format in the Oracle GlassFish Server 3.0.1 Reference Manual.

REST Interfaces

GlassFish Server provides representational state transfer (REST) interfacesto enable you to access monitoring and configuration data for GlassFish Server,including data that is provided by newly installed add-on components. Formore information, see Using REST Interfaces to Administer GlassFish Server.

Update Tool

GlassFish Server provides a set of image packaging system (IPS) tools forupdating software on a deployed GlassFish Server. Typical updates include newreleases of GlassFish Server, and new or revised releases of GlassFish Server add-oncomponents or modules.

  • The Update Tool graphical utility can either be run in the Administration Console,or invoked from the command line by using the updatetool command.You can use either tool to add components. However, to update or remove existingcomponents, you must use the standalone version. Instructions for using thegraphical versions of the Update Tool are contained in the Administration Console onlinehelp and the standalone Update Tool online help.

  • The pkg command is the command-line versionof Update Tool. Instructions for using the pkg commandwith add-on components are contained in Chapter10, Extending and Updating GlassFish Server.

Two distributions are supported for GlassFish Server: the Web Profile andthe Full Platform. After installation, you can view the modules on your systemby using the graphical Update Tool or the pkg command.

Note –

If you chose the Web Profile, you can change to the Full Platformby selecting the comparable Full Platform package in Update Tool. All dependentmodules are automatically added.

You can add and delete individual modules from a distribution, but suchconfigurations are not supported.

If you need information on upgrading your domain configuration datato work with a new version of GlassFish Server, see Oracle GlassFish Server 3.0.1 Upgrade Guide.

OSGi Module Management Subsystem

The OSGi module management subsystem that is provided with GlassFish Server isthe Apache Felix OSGi framework.To enable you to administer this framework, the ApacheFelix Remote Shell is enabled by default in GlassFish Server. This shelluses the Felix shell service to interact with the OSGi module managementsubsystem, and enables you to perform administrative tasks such as:

  • Browsing installed OSGi bundles

  • Viewing the headers of installed OSGi bundles

  • Installing OSGi bundles

  • Controlling the life cycle of installed bundles

The Apache Felix Remote Shell is accessible to telnet clients from anywherein the network. To connect to the Apache Felix Remote Shell through the telnetservice, use the telnet(1) commandas follows:


telnet host felix-remote-shell-port
host

The host where the DAS is running.

felix-remote-shell-port

The port for connecting to the Apache Felix Remote Shell throughthe telnet service. GlassFish Server is preconfigured to use port 6666 for thispurpose.

To see a list of the commands that are available in the Apache FelixRemote Shell, type help at the Apache Felix Remote Shellprompt.

To exit the Apache Felix Remote Shell, type exit atthe Apache Felix Remote Shell prompt.

Example1–1 Connecting to the Apache Felix Remote Shell

This example connects to the Apache Felix Remote Shell for a domainthat is running on the local host and that uses the preconfigured port forconnecting to this shell through the telnet service.


telnet localhost 6666

After the connection is established, the following information is displayed:


Connected to localhost.Escape character is '^]'.Felix Remote Shell Console:============================-> 
Example1–2 Listing All Installed OSGi Bundles

This example runs the Felix Remote Shell Command ps withoutany arguments to list all installed OSGi bundles. For better readability, some bundles that would be listed by this example are not shown.


-> psSTART LEVEL 1 ID State Level Name[ 0] [Active ] [ 0] System Bundle (2.0.2)[ 1] [Active ] [ 1] HK2 OSGi Main Bundle (1.0.0)[ 2] [Installed ] [ 1] AMX V3 Core (3.0.0.SNAPSHOT)[ 3] [Active ] [ 1] GlassFish Rest Interface (3.0.0.SNAPSHOT)...[ 217] [Installed ] [ 1] Admin Console JDBC Plugin (3.0.0.SNAPSHOT)[ 218] [Resolved ] [ 1] stats77 (3.0.0.SNAPSHOT)[ 219] [Active ] [ 1] Apache Felix Declarative Services (1.0.8)[ 220] [Active ] [ 1] GlassFish Web Container (rfc #66) for OSGi Enabled Web Applications (3.0.0.SNAPSHOT)->
Example1–3 Finding an OSGi Bundle With a Specified Name

This example runs the Felix Remote Shell Command find tofind all OSGi bundles whose names contain the text rfc.


-> find rfcSTART LEVEL 1 ID State Level Name[ 220] [Active ] [ 1] GlassFish Web Container (rfc #66) for OSGi Enabled Web Applications (3.0.0.SNAPSHOT)->
Example1–4 To Determine the Services That an OSGi Bundle Provides

This example runs the Felix Remote Shell Command inspect withthe service option and the capability option to determine the services that OSGi bundle 220 provides.


-> inspect service capability 220 GlassFish Web Container (rfc #66) for OSGi Enabled Web Applications (220) provides services:--------------------------------------------------------------------------------------------objectClass = org.glassfish.osgiweb.Extenderservice.id = 30----objectClass = org.osgi.service.url.URLStreamHandlerServiceservice.id = 31url.handler.protocol = webbundle-> 

keytool Utility

The keytool utility is used to set up and workwith Java Security Socket Extension (JSSE) digital certificates. See Administering JSSE Certificates for instructionson using keytool.

Java Monitoring and Management Console(JConsole)

Java SE provides tools to connect to an MBean server and viewthe MBeans that are registered with the server. JConsole is one such popularJMX Connector Client and is available as part of the standard Java SE distribution.For instructions on implementing JConsole in the GlassFish Server environment,see Configuring JConsole to View GlassFish Server Monitoring Data.

Application Server Management Extension(AMX)

The application server management eXtension (AMX) API exposes all ofthe GlassFish Server configuration and monitoring JMX managed beans as easy-to-useclient-side dynamic proxies implementing the AMX interfaces.

Information and instructions on performing most of the administrationtasks from the command line are provided in this document and in the asadmin utility help pages. For instructions on accessing asadmin onlinehelp, see To Display Help Information for the asadmin Utility or a Subcommand).

Information and instructions for accomplishing the tasks by using the Administration Console arecontained in the Administration Console online help.

Note –

Instructions written for the GlassFish Server tools use standardUNIX® forward slashes (/) for directory path separators in commands andfile names. If you are running GlassFish Server on a Microsoft Windows system,use backslashes (\) instead. For example:

  • UNIX: as-install/bin/asadmin

  • Windows: as-install\bin\asadmin

The following additional documents address specific administration areas:

  • Installing GlassFish Server software; updating add-on componentsusing the Update Tool

    Oracle GlassFish Server 3.0.1 Installation Guide

  • Verifying and deploying applications

    Oracle GlassFish Server 3.0.1 Application Deployment Guide

  • Diagnosing and resolving problems

    Oracle GlassFish Server 3.0.1 Troubleshooting Guide

Chapter 1 Overview of GlassFish Server Administration (Oracle GlassFish Server 3.0.1 Administration Guide) (2024)

FAQs

What is GlassFish server and its uses explain? ›

GlassFish is an open-source, fully Java EE-compliant application server (including support for Java Servlets, JSPs, EJBs, JPA, JMS and more). It provides a platform for developing, deploying, and managing Java-based enterprise applications.

What is the password for GlassFish admin console? ›

The default administration password is admin.

How do I access the GlassFish admin console? ›

Starting the Administration Console
  1. Click the Services tab.
  2. Expand Servers.
  3. Right-click the GlassFish Server instance and select View Domain Admin Console. Note: NetBeans IDE uses your default web browser to open the Administration Console.

What is the admin user of GlassFish? ›

For the zip bundle of GlassFish Server 5.0, the default administrator login is admin , with no password, which means that no login is required. For information about replaceable items and default paths and files, see Default Paths and File Names.

What port does GlassFish use? ›

The GlassFish Server port number: The default is 8080. The administration server's port number: The default is 4848. An administration user name and password: The default user name is admin , and by default no password is required.

How do I enable secure admin in GlassFish? ›

Example of Running enable-secure-admin
  1. asadmin> enable-secure-admin. Command enable-secure-admin executed successfully. ...
  2. asadmin> enable-secure-admin --adminalias adtest --instancealias intest. The following example shows how to disable secure admin:
  3. asadmin> disable-secure-admin. ...
  4. asadmin> get secure-admin.enabled.

How do I check my GlassFish log? ›

To view the log files:
  1. In the developer profile, go to Applications Server -> Logging -> View Log Files.
  2. In the cluster and enterprise profiles, go to Configurations -> Configuration -> Logger Settings -> General, and click View Log Files.

Where is GlassFish admin password stored? ›

GlassFish Server stores user credentials locally in a file named keyfile . The file realm is the initial default realm. The administration realm is also a file realm and stores administrator user credentials locally in a file named admin-keyfile .

What is the default location of GlassFish? ›

In a default installation, this is port 4848. <glassfish> is the path to the directory in which the application server is installed. In a default installation on Windows, this is C:\glassfish3\glassfish .

What is GlassFish server open source? ›

Oracle GlassFish Server is the world's first implementation of the Java Platform, Enterprise Edition (Java EE) 6 specification. Built using the GlassFish Server Open Source Edition, Oracle GlassFish Server delivers a flexible, lightweight, and production-ready Java EE 6 application server.

How do I start and stop GlassFish server? ›

Right-click the GlassFish Server instance and select Start.

To stop the GlassFish Server using NetBeans IDE, right-click the GlassFish Server instance and select Stop.

How to check GlassFish version? ›

4 Answers
  1. Go to the GlassFish installed directory using terminal. cd /opt/glassfish3.1.2.2/glassfish/bin.
  2. Type this command in terminal ./asadmin version.
Feb 19, 2014

What is the URL of the GlassFish server? ›

To access a web application deployed on GlassFish Server, use the URL http://localhost:8080/ (or https://localhost:8081/ for a secure application), along with the context root specified for the web application.

Why use GlassFish? ›

Glassfish Server stands out for its robust Java EE support, making it ideal for complex enterprise applications. Competitors like Apache Tomcat, WildFly, WebLogic, and IBM WebSphere each have their niches, catering to different use cases and deployment scenarios.

What is GlassFish description? ›

GlassFish is an open-source Jakarta EE platform application server project started by Sun Microsystems, then sponsored by Oracle Corporation, and now living at the Eclipse Foundation and supported by OmniFish, Fujitsu and Payara. The supported version under Oracle was called Oracle GlassFish Server.

What is the difference between Tomcat and GlassFish server? ›

As mentioned before, they are both open source and free but with different licenses. Tomcat has a single license whereas GlassFish has dual license. Finally, they are reference implementations for various Java standards. Tomcat being the reference implementation for the Servlet and JSP specification.

Is GlassFish a web server or application server? ›

GlassFish Server Open Source Edition is an open source application server built within the GlassFish community.

Top Articles
Latest Posts
Article information

Author: Wyatt Volkman LLD

Last Updated:

Views: 6354

Rating: 4.6 / 5 (66 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Wyatt Volkman LLD

Birthday: 1992-02-16

Address: Suite 851 78549 Lubowitz Well, Wardside, TX 98080-8615

Phone: +67618977178100

Job: Manufacturing Director

Hobby: Running, Mountaineering, Inline skating, Writing, Baton twirling, Computer programming, Stone skipping

Introduction: My name is Wyatt Volkman LLD, I am a handsome, rich, comfortable, lively, zealous, graceful, gifted person who loves writing and wants to share my knowledge and understanding with you.