Sun Glassfish Enterprise Server V3 Administration Guide
Sun Glassfish Enterprise Server V3 Administration Guide
v3 Administration Guide
Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product that is described in this document. In particular, and without
limitation, these intellectual property rights may include one or more U.S. patents or pending patent applications in the U.S. and in other countries.
U.S. Government Rights – Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions
of the FAR and its supplements.
This distribution may include materials developed by third parties.
Parts of the product may be derived from Berkeley BSD systems, licensed from the University of California. UNIX is a registered trademark in the U.S. and other
countries, exclusively licensed through X/Open Company, Ltd.
Sun, Sun Microsystems, the Sun logo, the Solaris logo, the Java Coffee Cup logo, docs.sun.com, Enterprise JavaBeans, EJB, GlassFish, J2EE, J2SE, Java Naming and
Directory Interface, JavaBeans, Javadoc, JDBC, JDK, JavaScript, JavaServer, JavaServer Pages, JMX, JRE, JSP, JVM, MySQL, NetBeans, OpenSolaris, SunSolve, Sun
GlassFish, ZFS, Java, and Solaris are trademarks or registered trademarks of Sun Microsystems, Inc. or its subsidiaries in the U.S. and other countries. All SPARC
trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the U.S. and other countries. Products bearing
SPARC trademarks are based upon an architecture developed by Sun Microsystems, Inc.
The OPEN LOOK and SunTM Graphical User Interface was developed by Sun Microsystems, Inc. for its users and licensees. Sun acknowledges the pioneering efforts
of Xerox in researching and developing the concept of visual or graphical user interfaces for the computer industry. Sun holds a non-exclusive license from Xerox to
the Xerox Graphical User Interface, which license also covers Sun's licensees who implement OPEN LOOK GUIs and otherwise comply with Sun's written license
agreements.
Products covered by and information contained in this publication are controlled by U.S. Export Control laws and may be subject to the export or import laws in
other countries. Nuclear, missile, chemical or biological weapons or nuclear maritime end uses or end users, whether direct or indirect, are strictly prohibited. Export
or reexport to countries subject to U.S. embargo or to entities identified on U.S. export exclusion lists, including, but not limited to, the denied persons and specially
designated nationals lists is strictly prohibited.
DOCUMENTATION IS PROVIDED “AS IS” AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY
IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO
THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.
Copyright 2010 Sun Microsystems, Inc. 4150 Network Circle, Santa Clara, CA 95054 U.S.A. Tous droits réservés.
Sun Microsystems, Inc. détient les droits de propriété intellectuelle relatifs à la technologie incorporée dans le produit qui est décrit dans ce document. En particulier,
et ce sans limitation, ces droits de propriété intellectuelle peuvent inclure un ou plusieurs brevets américains ou des applications de brevet en attente aux Etats-Unis
et dans d'autres pays.
Cette distribution peut comprendre des composants développés par des tierces personnes.
Certaines composants de ce produit peuvent être dérivées du logiciel Berkeley BSD, licenciés par l'Université de Californie. UNIX est une marque déposée aux
Etats-Unis et dans d'autres pays; elle est licenciée exclusivement par X/Open Company, Ltd.
Sun, Sun Microsystems, le logo Sun, le logo Solaris, le logo Java Coffee Cup, docs.sun.com, Enterprise JavaBeans, EJB, GlassFish, J2EE, J2SE, Java Naming and
Directory Interface, JavaBeans, Javadoc, JDBC, JDK, JavaScript, JavaServer, JavaServer Pages, JMX, JRE, JSP, JVM, MySQL, NetBeans, OpenSolaris, SunSolve, Sun
GlassFish, ZFS, Java et Solaris sont des marques de fabrique ou des marques déposées de Sun Microsystems, Inc., ou ses filiales, aux Etats-Unis et dans d'autres pays.
Toutes les marques SPARC sont utilisées sous licence et sont des marques de fabrique ou des marques déposées de SPARC International, Inc. aux Etats-Unis et dans
d'autres pays. Les produits portant les marques SPARC sont basés sur une architecture développée par Sun Microsystems, Inc.
L'interface d'utilisation graphique OPEN LOOK et Sun a été développée par Sun Microsystems, Inc. pour ses utilisateurs et licenciés. Sun reconnaît les efforts de
pionniers de Xerox pour la recherche et le développement du concept des interfaces d'utilisation visuelle ou graphique pour l'industrie de l'informatique. Sun détient
une licence non exclusive de Xerox sur l'interface d'utilisation graphique Xerox, cette licence couvrant également les licenciés de Sun qui mettent en place l'interface
d'utilisation graphique OPEN LOOK et qui, en outre, se conforment aux licences écrites de Sun.
Les produits qui font l'objet de cette publication et les informations qu'il contient sont régis par la legislation américaine en matière de contrôle des exportations et
peuvent être soumis au droit d'autres pays dans le domaine des exportations et importations. Les utilisations finales, ou utilisateurs finaux, pour des armes nucléaires,
des missiles, des armes chimiques ou biologiques ou pour le nucléaire maritime, directement ou indirectement, sont strictement interdites. Les exportations ou
réexportations vers des pays sous embargo des Etats-Unis, ou vers des entités figurant sur les listes d'exclusion d'exportation américaines, y compris, mais de manière
non exclusive, la liste de personnes qui font objet d'un ordre de ne pas participer, d'une façon directe ou indirecte, aux exportations des produits ou des services qui
sont régis par la legislation américaine en matière de contrôle des exportations et la liste de ressortissants spécifiquement designés, sont rigoureusement interdites.
LA DOCUMENTATION EST FOURNIE "EN L'ETAT" ET TOUTES AUTRES CONDITIONS, DECLARATIONS ET GARANTIES EXPRESSES OU TACITES
SONT FORMELLEMENT EXCLUES, DANS LA MESURE AUTORISEE PAR LA LOI APPLICABLE, Y COMPRIS NOTAMMENT TOUTE GARANTIE
IMPLICITE RELATIVE A LA QUALITE MARCHANDE, A L'APTITUDE A UNE UTILISATION PARTICULIERE OU A L'ABSENCE DE CONTREFACON.
100127@23031
Contents
Preface ...................................................................................................................................................25
3
Contents
5
Contents
▼ To Enable SSL Between the mod_jk Load Balancer and Enterprise Server ......................... 113
7
Contents
9
Contents
11
Contents
20 Administering the Java Naming and Directory Interface (JNDI) Service .................................313
About JNDI ........................................................................................................................................ 313
J2EE Naming Environment ...................................................................................................... 314
How the Naming Environment and the Container Work Together ................................... 314
Naming References and Binding Information ....................................................................... 315
Administering JNDI Resources ....................................................................................................... 315
Administering Custom JNDI Resources ................................................................................. 316
Administering External JNDI Resources ................................................................................ 318
13
14
Figures
FIGURE 2–1 Web Page for the REST Resource for Managing a Domain ................................. 64
FIGURE 11–1 Role Mapping ........................................................................................................... 184
15
16
Tables
17
Tables
19
Examples
21
Examples
EXAMPLE 15–13 Listing Principals of All Connector Security Maps for a Connector Connection
Pool ........................................................................................................................... 265
EXAMPLE 15–14 Updating a Connector Security Map .................................................................... 266
EXAMPLE 15–15 Deleting a Connector Security Map ...................................................................... 266
EXAMPLE 15–16 Creating Connector Work Security Maps ............................................................ 267
EXAMPLE 15–17 Listing the Connector Work Security Maps ......................................................... 268
EXAMPLE 15–18 Updating a Connector Work Security Map ......................................................... 269
EXAMPLE 15–19 Deleting a Connector Work Security Map ........................................................... 269
EXAMPLE 15–20 Creating an Administered Object .......................................................................... 270
EXAMPLE 15–21 Listing Administered Objects ................................................................................ 271
EXAMPLE 15–22 Deleting an Administered Object .......................................................................... 272
EXAMPLE 16–1 Creating an HTTP Protocol ................................................................................... 277
EXAMPLE 16–2 Listing the Protocols ................................................................................................ 277
EXAMPLE 16–3 Deleting a Protocol .................................................................................................. 278
EXAMPLE 16–4 Creating an HTTP Configuration ......................................................................... 279
EXAMPLE 16–5 Deleting an HTTP Configuration ......................................................................... 279
EXAMPLE 16–6 Creating a Transport ............................................................................................... 280
EXAMPLE 16–7 Listing HTTP Transports ....................................................................................... 280
EXAMPLE 16–8 Deleting a Transport ............................................................................................... 281
EXAMPLE 16–9 Creating an HTTP Listener .................................................................................... 282
EXAMPLE 16–10 Creating a Network Listener .................................................................................. 282
EXAMPLE 16–11 Listing HTTP Listeners ........................................................................................... 282
EXAMPLE 16–12 Updating an HTTP Network Listener .................................................................. 283
EXAMPLE 16–13 Deleting an HTTP Listener .................................................................................... 284
EXAMPLE 16–14 Configuring an HTTP Listener for SSL ................................................................ 284
EXAMPLE 16–15 Deleting SSL From an HTTP Listener .................................................................. 285
EXAMPLE 16–16 Creating a Virtual Server ........................................................................................ 287
EXAMPLE 16–17 Listing Virtual Servers ............................................................................................ 287
EXAMPLE 16–18 Deleting a Virtual Server ........................................................................................ 288
EXAMPLE 17–1 Creating an IIOP Listener ....................................................................................... 292
EXAMPLE 17–2 Listing IIOP Listeners ............................................................................................. 293
EXAMPLE 17–3 Updating an IIOP Listener ..................................................................................... 293
EXAMPLE 17–4 Deleting an IIOP Listener ....................................................................................... 294
EXAMPLE 18–1 Creating a JavaMail Resource ................................................................................ 297
EXAMPLE 18–2 Listing JavaMail Resources ..................................................................................... 297
EXAMPLE 18–3 Updating a JavaMail Resource ............................................................................... 298
23
Examples
The Sun GlassFish Enterprise Server v3 Administration Guide provides instructions for
configuring and administering the Sun GlassFish Enterprise Server.
This preface contains information about and conventions for the entire Sun GlassFishTM
Enterprise Server (Enterprise Server) documentation set.
25
Preface
Release Notes Provides late-breaking information about the software and the
documentation. Includes a comprehensive, table-based summary of the
supported hardware, operating system, JavaTM Development Kit (JDKTM),
and database drivers.
Quick Start Guide Explains how to get started with the Enterprise Server product.
Installation Guide Explains how to install the software and its components.
Upgrade Guide Explains how to upgrade to the latest version of Enterprise Server. This guide
also describes differences between adjacent product releases and
configuration options that can result in incompatibility with the product
specifications.
Administration Guide Explains how to configure, monitor, and manage Enterprise Server
subsystems and components from the command line by using the
asadmin(1M) utility. Instructions for performing these tasks from the
Administration Console are provided in the Administration Console online
help.
Application Deployment Guide Explains how to assemble and deploy applications to the Enterprise Server
and provides information about deployment descriptors.
Your First Cup: An Introduction Provides a short tutorial for beginning Java EE programmers that explains
to the Java EE Platform 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 JavaBeansTM specification, a JAX-RS web service, and a
JavaServerTM Faces component for the web front end.
Application Development Guide Explains how to create and implement Java Platform, Enterprise Edition
(Java EE platform) applications that are intended to run on the Enterprise
Server. These applications follow the open Java standards model for Java EE
components and APIs. This guide provides information about developer
tools, security, and debugging.
Add-On Component Explains how to use published interfaces of Enterprise Server to develop
Development Guide add-on components for Enterprise Server. This document explains how to
perform only those tasks that ensure that the add-on component is suitable
for Enterprise Server.
Embedded Server Guide Explains how to run applications in embedded Enterprise Server and to
develop applications in which Enterprise Server is embedded.
Scripting Framework Guide Explains how to develop scripting applications in languages such as Ruby on
Rails and Groovy on Grails for deployment to Enterprise Server.
Troubleshooting Guide Describes common problems that you might encounter when using
Enterprise Server and how to solve them.
Error Message Reference Describes error messages that you might encounter when using Enterprise
Server.
Reference Manual Provides reference information in man page format for Enterprise Server
administration commands, utility commands, and related concepts.
Domain File Format Reference Describes the format of the Enterprise Server configuration file, domain.xml.
Java EE 6 Tutorial, Volume I Explains how to use Java EE 6 platform technologies and APIs to develop
Java EE applications.
Message Queue Release Notes Describes new features, compatibility issues, and existing bugs for Sun
GlassFish Message Queue.
Message Queue Administration Explains how to set up and manage a Sun GlassFish Message Queue
Guide messaging system.
Message Queue Developer's Describes the application programming interface in Sun GlassFish Message
Guide for JMX Clients Queue for programmatically configuring and monitoring Message Queue
resources in conformance with the Java Management Extensions (JMX).
System Virtualization Support Summarizes Sun support for Sun Java System products when used in
in Sun Java System Products conjunction with system virtualization products and features.
Related Documentation
The Java EE 6 Tutorial, Volume II (https://www.sun.com/offers/details/
java_ee6_tutorial.xml) contains all the topics in Java EE 6 Tutorial, Volume I and adds
advanced topics, additional technologies, and case studies. The document is available to
registered users of Enterprise Server.
JavadocTM tool reference documentation for packages that are provided with Enterprise Server is
available as follows:
■ The API specification for version 6 of Java EE is located at http://java.sun.com/javaee/
6/docs/api/.
■ The API specification for Enterprise Server v3, including Java EE 6 platform packages and
nonplatform packages that are specific to the Enterprise Server product, is located at:
https://glassfish.dev.java.net/nonav/docs/v3/api/.
27
Preface
For information about the Java DB for use with the Enterprise Server, see
http://developers.sun.com/javadb/.
The sample applications demonstrate a broad range of Java EE technologies. The samples are
bundled with the Java EE Software Development Kit (SDK).
Typographic Conventions
The following table describes the typographic changes that are used in this book.
AaBbCc123 The names of commands, files, and Edit your .login file.
directories, and onscreen computer
Use ls -a to list all files.
output
machine_name% you have mail.
AaBbCc123 A placeholder to be replaced with a real The command to remove a file is rm filename.
name or value
AaBbCc123 Book titles, new terms, and terms to be Read Chapter 6 in the User's Guide.
emphasized (note that some emphasized
A cache is a copy that is stored locally.
items appear bold online)
Do not save the file.
Symbol Conventions
The following table explains symbols that might be used in this book.
{|} Contains a set of choices for a -d {y|n} The -d option requires that you use
required command option. either the y argument or the n
argument.
- Joins simultaneous multiple Control-A Press the Control key while you press
keystrokes. the A key.
+ Joins consecutive multiple Ctrl+A+N Press the Control key, release it, and
keystrokes. then press the subsequent keys.
→ Indicates menu item File → New → Templates From the File menu, choose New.
selection in a graphical user From the New submenu, choose
interface. Templates.
as-install Represents the base installation directory for Installations on the SolarisTM operating system, Linux operating
Enterprise Server. system, and Mac operating system:
In configuration files, as-install is represented user’s-home-directory/glassfishv3/glassfish
as follows:
Windows, all installations:
${com.sun.aas.installRoot}
SystemDrive:\glassfishv3\glassfish
as-install-parent Represents the parent of the base installation Installations on the Solaris operating system, Linux operating
directory for Enterprise Server. system, and Mac operating system:
user’s-home-directory/glassfishv3
Windows, all installations:
SystemDrive:\glassfishv3
29
Preface
search-term site:docs.sun.com
broker site:docs.sun.com
To include other Sun web sites in your search (for example, java.sun.com, www.sun.com, and
developers.sun.com), use sun.com in place of docs.sun.com in the search field.
Note – Sun is not responsible for the availability of third-party web sites mentioned in this
document. Sun does not endorse and is not responsible or liable for any content, advertising,
products, or other materials that are available on or through such sites or resources. Sun will not
be responsible or liable for any actual or alleged damage or loss caused or alleged to be caused by
or in connection with use of or reliance on any such content, goods, or services that are available
on or through such sites or resources.
Sun GlassFishTM Enterprise Server v3 provides an environment for developing and deploying
JavaTM applications and web services.
In addition, you might want to reset default passwords, change names or locations of files, and
so on. The following tables list the default administration values.
Note – For the zip bundle of Enterprise Server v3, the default administrator login is admin, with
no password, which means that no login is required.
31
Configuration Tasks
Item Default
Item Default
For information on replaceables and default paths and files, see “Default Paths and File Names”
on page 29.
Configuration Tasks
Some configuration tasks must be performed directly after installation for your Enterprise
Server environment to work as intended. For example, if you are using a database with
Enterprise Server, you need to set up database connectivity right away.
Some configuration situations are ongoing and will require you to make changes many times
during the life of your installation. You can use either the Administration Console or the
asadmin utility to modify the configuration. Changes are automatically applied to the
appropriate configuration file.
The following resources and services frequently require configuration immediately after
installation:
System Properties
See “Administering System Properties” on page 54.
Domains
The initial domain1 is created during installation. Additional configuration tasks might
include such tasks as configuring additional domains or setting up automatic restart. See
Chapter 3, “Administering Domains.”
JVM
The initial tasks for configuring the JVM include creating JVM options and profilers. See
Chapter 4, “Administering the Virtual Machine for the Java Platform.”
Logging
By default, logging is enabled, so basic logging works without additional configuration.
However, you might want to change log levels, property values, or the location of log files.
See Chapter 7, “Administering the Logging Service.”
Monitoring
By default, the monitoring service is enabled. However, monitoring for the individual
modules is not enabled, so your first monitoring task is to enable monitoring for the modules
that you want to monitor. See Chapter 8, “Administering the Monitoring Service.”
Life Cycle Modules
See Chapter 9, “Administering Life Cycle Modules.”
Security
■ System Security. Initial configuration tasks might include setting up passwords, audit
modules, and certificates. See Chapter 11, “Administering System Security.”
■ User Security. Initial configuration tasks might include creating authentication realms
and file users. See Chapter 12, “Administering User Security.”
■ Message Security. Initial configuration tasks might include configuring a Java
Cryptography Extension (JCE) provider, enabling default and non-default security
providers, and configuring message protection policies. See Chapter 13, “Administering
Message Security.”
Database Connectivity
The initial tasks involved in configuring Enterprise Server to connect to the Java DB database
include creating a Java Database Connectivity (JDBC) connection pool, creating a JDBC
resource, and integrating a JDBC driver. See Chapter 14, “Administering Database
Connectivity .”
EIS Connectivity
The initial tasks involved in configuring Enterprise Server to connect to an enterprise
information system (EIS) include creating a connector connection pool, creating a
connector resource, editing a resource adapter configuration, creating a connector security
map, creating a connector work security map, and creating an administered object (if
needed). See Chapter 15, “Administering EIS Connectivity.”
Internet Connectivity
The initial tasks involved in making deployed web applications accessible by internet clients
include creating HTTP network listeners and virtual servers, and configuring the HTTP
listeners for SSL (if needed). See Chapter 16, “Administering Internet Connectivity.”
Object Request Broker (ORB)
An initial configuration task might involve creating an IIOP listener. See Chapter 17,
“Administering the Object Request Broker (ORB).”
JavaMail Service
An initial configuration task might involve creating a JavaMail resource. See Chapter 18,
“Administering the JavaMail Service.”
Java Message Service (JMS)
Initial configuration tasks might include creating a physical destination, creating connection
factories or destination resources, creating a JMS host (if the default JMS host is not
adequate), adjusting connection pool settings (if needed), and configuring resource adapters
for JMS. See Chapter 19, “Administering the Java Message Service (JMS) .”
JNDI Service
An initial configuration task might involve creating a JNDI resource. See Chapter 20,
“Administering the Java Naming and Directory Interface (JNDI) Service.”
Information and instructions for accomplishing the tasks by using the Administration Console
are contained in the Administration Console online help.
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” on
page 124.
The general process for working with configuration changes on the command line is as follows:
1. List the modules for the component of interest.
The following single mode example uses the | (pipe) character and the grep command to
narrow the search:
asadmin list "*" | grep http | grep listener
server.http-service.http-listener.http-listener-1.acceptor-threads = 1
server.http-service.http-listener.http-listener-1.address = 0.0.0.0
server.http-service.http-listener.http-listener-1.blocking-enabled = false
server.http-service.http-listener.http-listener-1.default-virtual-server = server
server.http-service.http-listener.http-listener-1.enabled = true
server.http-service.http-listener.http-listener-1.external-port =
server.http-service.http-listener.http-listener-1.family = inet
server.http-service.http-listener.http-listener-1.id = http-listener-1
server.http-service.http-listener.http-listener-1.port = 8080
server.http-service.http-listener.http-listener-1.redirect-port =
server.http-service.http-listener.http-listener-1.security-enabled = false
server.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 attribute of 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 Enterprise Server resources, applications, and
server instances is stored in the domain.xml configuration file. This file is the central repository
for a given administrative domain and contains an XML representation of the Enterprise Server
domain model. Default location for the domain.xml file is
as-install/glassfish3/glassfish/domains/domain-name/config. For details on the
domain.xml file, see Sun GlassFish Enterprise Server v3 Domain File Format Reference.
The logging.properties file is used to configure logging levels for individual modules. The file
is located in the same directory as the domain.xml file. For further information on the
logging.properties file, see “Setting Log Levels” on page 118.
Note – Changes are automatically applied to the appropriate configuration file. Do not edit the
configuration files directly. Manual editing is prone to error and can have unexpected results.
Administration Tools
For the most part, you can perform the same tasks by using either the graphical Administration
Console or the asadmin command-line utility, however, there are exceptions.
Administration Console
The Administration Console is a browser-based utility that features an easy-to-navigate
graphical interface that includes extensive online help for the administrative tasks.
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 Enterprise Server was
installed, you chose a port number for the DAS, or used the default port of 4848. You also
specified a user name and password if you did not accept the default login (admin with no
password).
When specifying the URL for the Administration Console, use the port number for the domain
to be administered. The format for starting the Administration Console in a web browser is
http://hostname:port. For example:
http://kindness.sun.com:4848
If the Administration Console is running on the host where Enterprise Server was installed,
specify localhost for the host name. For example:
http://localhost:4848
For Microsoft Windows, an alternate way to start the Enterprise Server Administration Console
is by using the Start menu.
You can display the help material for a page in the Administration Console by clicking the Help
button on the page. The initial help page describes the functions and fields of the page itself.
Associated task instructions can be accessed on additional pages by clicking a link in the See
Also list.
asadmin Utility
The asadmin utility is a command-line tool that runs subcommands for identifying the
operation or task that you want to perform. You can run asadmin subcommands either from a
command prompt or from a script. Running asadmin subcommands from a script is helpful for
automating repetitive tasks. Basic information about how 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” on page 47.
To issue an asadmin subcommand in the standard command shell (single mode), go to the
as-install/bin directory and 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 utility continues to accept
subcommands until you exit multimode and return to the standard command shell. For
example:
asadmin> list-jdbc-resources
You can display a help page for any asadmin subcommand by typing help before the
subcommand name. For example:
or
A collection of the asadmin help pages is available in HTML and PDF format in the Sun
GlassFish Enterprise Server v3 Reference Manual.
REST Interfaces
Enterprise Server provides representational state transfer (REST) interfaces to enable you to
access monitoring and configuration data for Enterprise Server, including data that is provided
by newly installed add-on components. For more information, see “Using REST Interfaces to
Administer Enterprise Server” on page 62.
Update Tool
Enterprise Server provides a set of image packaging system (IPS) tools for updating software on
a deployed Enterprise Server. Typical updates include new releases of Enterprise Server, and
new or revised releases of Enterprise Server add-on components 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 existing components, you must use
the standalone version. Instructions for using the graphical versions of the Update Tool are
contained in the Administration Console online help and the standalone Update Tool
online help.
■ The pkg command is the command-line version of Update Tool. Instructions for using the
pkg command with add-on components are contained in Chapter 10, “Extending Enterprise
Server.”
Two distributions are supported for GlassFish Enterprise Server v3: the Web Profile and the
Full Platform Profile. After installation, you can view the modules on your system by using the
graphical Update Tool or the pkg command.
Note – If you chose the Web Profile, you can change to the Full Platform Profile by selecting the
comparable Full Platform Profile package in Update Tool. All dependent modules are
automatically added.
You can add and delete individual modules from a distribution, but such configurations are not
supported.
If you need information on upgrading your domain configuration data to work with a new
version of Enterprise Server, see Sun GlassFish Enterprise Server v3 Upgrade Guide.
The Apache Felix Remote Shell is accessible to telnet clients from anywhere in the network. To
connect to the Apache Felix Remote Shell through the telnet service, use the telnet(1)
command as follows:
To see a list of the commands that are available in the Apache Felix Remote Shell, type help at
the Apache Felix Remote Shell prompt.
To exit the Apache Felix Remote Shell, type exit at the Apache Felix Remote Shell prompt.
This example connects to the Apache Felix Remote Shell for a domain that is running on the
local host and that uses the preconfigured port for connecting to this shell through the telnet
service.
Connected to localhost.
Escape character is ’^]’.
->
This example runs the Felix Remote Shell Command ps without any arguments to list all
installed OSGi bundles. For better readability, some bundles that would be listed by this
example are not shown.
-> ps
START LEVEL 1
ID State Level Name
[ 0] [Active ] [ 0] System Bundle (2.0.2)
[ 1] [Active ] [ 1] HK2 OSGi Main Bundle (1.0.0)
This example runs the Felix Remote Shell Command find to find all OSGi bundles whose
names contain the text rfc.
This example runs the Felix Remote Shell Command inspect with the service option and the
capability option to determine the services that OSGi bundle 220 provides.
keytool Utility
The keytool utility is used to set up and work with Java Security Socket Extension (JSSE) digital
certificates. See “Administering JSSE Certificates ” on page 199 for instructions on using
keytool.
Information and instructions for accomplishing the tasks by using the Administration Console
are contained in the Administration Console online help.
Note – Instructions written for the Enterprise Server tools use standard UNIX® forward slashes
(/) for directory path separators in commands and file names. If you are running Enterprise
Server on a Microsoft Windows system, use backslashes (\) instead. For example:
■ UNIX: as-install/bin/asadmin
■ Windows: as-install\bin\asadmin
Runtime Administration
45
46
2
C H A P T E R 2
General Administration
This chapter provides instructions for performing general administration tasks in the Sun
GlassFishTM Enterprise Server v3 environment by using the asadmin command-line utility.
Instructions for accomplishing the tasks in this chapter by using the Administration Console
are contained in the Administration Console online help.
47
Using the asadmin Utility
The replaceable items in this syntax are described in the subsections that follow. For full details
of this syntax, see the asadmin(1M) help page.
For a list of the subcommands for this release of Enterprise Server, see Section 1 of Sun
GlassFish Enterprise Server v3 Reference Manual.
Note – Not all subcommand options are supported for this release of Enterprise Server. If you
specify an unsupported option, a syntax error does not occur. Instead, the command runs
successfully and the unsupported option is silently ignored.
A subcommand option may have the same name as an asadmin utility option, but the effects of
the two options are different.
For example, the short form and the long form of the option for specifying terse output are as
follows:
■ Short form: -t
■ Long form: --terse
Most options require argument values, except Boolean options, which toggle to enable or
disable a feature.
● In the operating system's command shell, run the asadmin utility, specifying the subcommand.
If necessary, also specify any required asadmin utility options, subcommand options, and
operands.
asadmin list-applications
hello <web>
Command list-applications executed successfully.
Example 2–2 Specifying an asadmin Utility Option With a Subcommand in Single Mode
This example specifies the --host asadmin utility option with the list-applications
subcommand in single mode. In this example, the DAS is running on the host
srvr1.example.com.
The example shows that the applications basic-ezcomp, scrumtoys, ejb31-war, and
automatic-timer-ejb are deployed on the host srvr1.example.com.
Example 2–3 Specifying an asadmin Utility Option and a Subcommand Option in Single Mode
This example specifies the --host asadmin utility option and the --type subcommand option
with the list-applications subcommand in single mode. In this example, the DAS is running
on the host srvr1.example.com and applications of type web are to be listed.
1 If you are displaying help information for a remote subcommand, ensure that the server is
running.
Remote subcommands require a running server.
asadmin help
See Also To display the available subcommands, use the list-commands(1) subcommand. Local
subcommands are displayed before remote subcommands. If the server is not running, only
local subcommands are displayed.
In a multimode session, the asadmin> prompt is displayed on the command line. You can now
type asadmin subcommands at this prompt to administer Enterprise Server.
asadmin multimode
asadmin
Enter commands one per "line", ^D to quit
asadmin> list-domains
Name: domain1 Status: Running
Command list-domains executed successfully.
asadmin>
More Information Starting a Multimode Session From Within an Existing Multimode Session
You can start a multimode session from within an existing session by running the multimode
subcommand from within the existing session. After you end the second multimode session,
you return to your original multimode session.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
multimode at the command line.
1 Create a plain text file that contains the sequence of subcommands that you want to run.
2 Run the multimode(1) subcommand, specifying the file that you created.
If necessary, also specify any asadmin utility options that are required to enable subcommands
in the file to run.
The commands_file.txt file contains the asadmin utility subcommands to perform the
following sequence of operations:
1. Creating the domain customdomain
2. Starting the domain customdomain
3. Listing all available subcommands
4. Stopping the domain customdomain
5. Deleting the domain customdomain
list-commands
stop-domain customdomain
delete-domain customdomain
This example runs the sequence of subcommands in the commands_file.txt file. Because the
--portbase option is specified for the create-domain subcommand in the file, the --port
asadmin utility option must also be set.
See Also For more information about the subcommands in the preceding example, see the following
help pages:
■ create-domain(1)
■ delete-domain(1)
■ list-commands(1)
■ multimode(1)
■ start-domain(1)
■ stop-domain(1)
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
create-system-properties at the command line.
asadmin> list-system-properties
http-listener-port=1088
Command list-system-properties executed successfully.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
list-system-properties at the command line.
4 If necessary, notify users that the system property has been deleted.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
delete-system-property at the command line.
Administering Resources
This section contains instructions for integrating resources into the Enterprise Server
environment. Information about administering specific resources, such as JDBC, is contained
in other chapters.
The following topics are addressed here:
■ “To Add Resources From an XML File” on page 56
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
add-resources at the command line.
asadmin> version
Version = GlassFish v3
Command version executed successfully.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
version at the command line.
▼ To List Applications
Use the list-applications subcommand in remote mode to list the deployed JavaTM
applications. If the --type option is not specified, all applications are listed.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
list-applications at the command line.
▼ To List Containers
Use the list-containers subcommand in remote mode to list application containers.
asadmin> list-containers
List all known application containers
Container : grizzly
Container : ejb
Container : webservices
Container : ear
Container : appclient
Container : connector
Container : jpa
Container : web
Container : jruby
Container : security
Container : webbeans
Command list-containers executed successfully.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
list-containers at the command line.
▼ To List Modules
Use the list-modules subcommand in remote mode to list the modules that are accessible to
the Enterprise Server module subsystem. The status of each module is included. Possible
statuses include NEW and READY.
asadmin> list-modules
List Of Modules
Module : org.glassfish.web.jstl-connector:10.0.0.b28
properties=(visibility=public,State=READY,Sticky=true)
Module Characteristics : List of Jars implementing the module
Jar : file:/C:/Preview/v3_Preview_release/distributions/web/target/glass
fish/modules/web/jstl-connector.jar
Module Characteristics : List of imported modules
Module Characteristics : Provides to following services
Module : org.glassfish.admingui.console-common:10.0.0.b28
properties=(visibility=public,State=NEW,Sticky=true)
Module : org.glassfish.admin.launcher:10.0.0.b28
properties=(visibility=public,State=NEW,Sticky=true)
Module : org.glassfish.external.commons-codec-repackaged:10.0.0.b28
properties=(visibility=public,State=NEW,Sticky=true)
Module : com.sun.enterprise.tiger-types-osgi:0.3.32.Preview-b28
properties=(visibility=public,State=READY,Sticky=true)
Module Characteristics : List of imported modules
Module Characteristics : Provides to following services
Module Characteristics : List of Jars implementing the module
Jar : file:/C:/Preview/v3_Preview_release/distributions/web/target/glass
fish/modules/tiger-types-osgi.jar.
...
Command list-modules executed successfully.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
list-modules at the command line.
▼ To List Subcommands
Use the list-commands subcommand in remote mode to list the deployed asadmin
subcommands. You can specify that only remote subcommands or only local subcommands are
listed. By default, this subcommand displays a list of local subcommands followed by a list of
remote subcommands.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
list-commands at the command line.
▼ To List Timers
The timer service is a persistent and transactional notification service that is provided by the
enterprise bean container and is used to schedule notifications or events used by enterprise
beans. All enterprise beans except stateful session beans can receive notifications from the timer
service. Persistent timers set by the service are not destroyed when the server is shut down or
restarted.
Use the list-timers subcommand in remote mode to list the persistent timers owned by a
specific server instance. You can use this information to decide whether to do a timer
migration, or to verify that a migration has been completed successfully.
■ Configuration: http://host:port/management/domain/path
■ Monitoring: http://host:port/monitoring/domain/path
If the URL to a REST resource for Enterprise Server monitoring or configuration data is opened
in a web browser, the browser displays a web page that contains the following information
about the resource:
■ A list of the attributes of the resource and their values. If the resource represents a node in
the configuration tree, these attributes are presented in an HTML form that you can use to
update the resource. Attributes of a resource for a node in the monitoring tree are read only.
■ A list of hypertext links to the children of the resource. This list of links enables you to
traverse the tree that contains the resource and to discover the all resources in the tree.
The following figure shows the web page for the REST resource for managing a domain.
FIGURE 2–1 Web Page for the REST Resource for Managing a Domain
TABLE 2–1 REST Resource Methods for Administering Monitoring and Configuration Data
Determine the methods and method parameters that a node in the tree supports OPTIONS or GET
Note – The GET method can be used instead of the OPTIONS method to determine the methods
and method parameters that a node in the tree supports. The GET method also provides
additional information about the node. For details, see “To Retrieve Data for a Node in the
Tree” on page 67.
2 Use the appropriate method on the REST resource that represents the node.
■ If the node is in the monitoring object tree, use the GET method.
■ If the node is in the configuration object tree, use the OPTIONS method or the GET method.
The GET method and the OPTIONS method return the list of methods that the resource supports.
For each method, the list of acceptable message parameters or the list of acceptable query
parameters are returned.
Example 2–21 Determining the Methods and Method Parameters That a Node in the Tree
Supports
This example uses the cURL utility to determine the methods and method parameters that the
resource for the domain supports. The example uses the following options of the cURL utility:
■ -X to specify that the OPTIONS method is used
■ -H to specify that the resource is represented in JavaScript Object Notation (JSON)
In this example, the DAS is running on the local host and the HTTP port for administration is
4848. In addition to the OPTIONS method, the resource supports the POST method and the GET
method.
You can specify the format in which this information is presented. For more information, see
“Formats for Resource Representation” on page 76.
2 Use the GET method on the REST resource that represents the node.
In this example, the DAS is running on the local host and the HTTP port for administration is
4848.
"Domain":{"log-root":"${com.sun.aas.instanceRoot}/logs",
"application-root":"${com.sun.aas.instanceRoot}/applications",
"locale":"", "version":"74.1"},
"Methods":{
"Method":{
"Name":"POST",
"Message Parameters":{
"log-root":{"Key":"false", "Type":"string", "Optional":"true"},
"application-root":{"Key":"false", "Type":"string", "Optional":"true"},
"locale":{"Key":"false", "Type":"string", "Optional":"true"},
"version":{"Key":"false", "Type":"string", "Optional":"true"}
}
},
"Method":{
"Name":"GET"
}
},
"Child Resources":[
"http://localhost:4848/management/domain/configs",
"http://localhost:4848/management/domain/resources",
"http://localhost:4848/management/domain/servers",
"http://localhost:4848/management/domain/property",
"http://localhost:4848/management/domain/applications",
"http://localhost:4848/management/domain/system-applications",
"http://localhost:4848/management/domain/stop",
"http://localhost:4848/management/domain/restart",
"http://localhost:4848/management/domain/uptime",
"http://localhost:4848/management/domain/version",
"http://localhost:4848/management/domain/rotate-log",
"http://localhost:4848/management/domain/host-port"
]
2 Determine the acceptable message parameters for the POST method of the resource that
represents the parent of the node.
For information about how to perform this step, see “To Determine the Methods and Method
Parameters That a Node in the Tree Supports” on page 65.
3 Use the POST method on the REST resource that represents the parent of the node that you are
adding.
In this example, the DAS is running on the local host and the HTTP port for administration is
4848.
"JdbcMyjdbcresource":{"enabled":"true", "pool-name":"DerbyPool",
"description":"", "jndi-name":"jdbc/myjdbcresource", "object-type":"user"},
"Methods":{
"Method":{
"Name":"POST",
"Message Parameters":{
"enabled":{"Key":"false", "Default Value":"true",
"Type":"boolean", "Optional":"true"},
"pool-name":{"Key":"false", "Type":"string", "Optional":"true"},
"description":{"Key":"false", "Type":"string", "Optional":"true"},
"jndi-name":{"Key":"true", "Type":"string", "Optional":"true"},
"object-type":{"Key":"false", "Default Value":"user",
"Type":"string", "Optional":"true"}
}
},
"Method":{
"Name":"GET"
},
"Method":{
"Name":"DELETE",
"Message Parameters":{
"target":{"Acceptable Values":"", "Default Value":"",
"Type":"string", "Optional":"true"}
}
}
}
2 Determine the acceptable message parameters for the POST method of the resource that
represents the node.
For information about how to perform this step, see “To Determine the Methods and Method
Parameters That a Node in the Tree Supports” on page 65.
3 Use the POST method on the REST resource that represents the node that you are updating.
In this example, the DAS is running on the local host and the HTTP port for administration is
4848.
"http://localhost:4848/management/domain/resources/jdbc-resource/
jdbc-myjdbcresource" updated successfully.
3. This step confirms that the node has been updated by retrieving data for the REST resource
that represents the node.
curl -X GET -H "Accept: application/json"
http://localhost:4848/management/domain/resources/
jdbc-resource/jdbc-myjdbcresource
{
"JdbcMyjdbcresource":{"enabled":"false", "pool-name":"DerbyPool",
"description":"", "jndi-name":"jdbc/myjdbcresource", "object-type":"user"},
"Methods":{
"Method":{
"Name":"POST",
"Message Parameters":{
"enabled":{"Key":"false", "Default Value":"true",
"Type":"boolean", "Optional":"true"},
"pool-name":{"Key":"false", "Type":"string", "Optional":"true"},
"description":{"Key":"false", "Type":"string", "Optional":"true"},
"jndi-name":{"Key":"true", "Type":"string", "Optional":"true"},
"object-type":{"Key":"false", "Default Value":"user",
"Type":"string", "Optional":"true"}
}
},
"Method":{
"Name":"GET"
},
"Method":{
"Name":"DELETE",
"Message Parameters":{
"target":{"Acceptable Values":"", "Default Value":"",
"Type":"string", "Optional":"true"}
}
}
}
In this example, the DAS is running on the local host and the HTTP port for administration is
4848.
}
}
}
}
2. This step deletes the jdbc-myjdbcresource resource.
curl -X DELETE http://localhost:4848/management/domain/resources/
jdbc-resource/jdbc-myjdbcresource
3. This step confirms that the node has been deleted by retrieving data for the REST resource
that represents the parent of the node.
curl -X GET -H "Accept: application/json"
http://localhost:4848/management/domain/resources/jdbc-resource/
{
"JdbcResource":{},
"Methods":{
"Method":{
"Name":"POST",
"Message Parameters":{
"id":{"Acceptable Values":"", "Default Value":"", "Type":"string",
"Optional":"false"},
"enabled":{"Acceptable Values":"", "Default Value":"true",
"Type":"boolean", "Optional":"true"},
"description":{"Acceptable Values":"", "Default Value":"",
"Type":"string", "Optional":"true"},
"target":{"Acceptable Values":"", "Default Value":"", "Type":"string",
"Optional":"true"},
"property":{"Acceptable Values":"", "Default Value":"", "Type":"string",
"Optional":"true"},
"connectionpoolid":{"Acceptable Values":"", "Default Value":"",
"Type":"string", "Optional":"false"}
}
},
"Method":{
"Name":"GET"
}
},
"Child Resources":[
"http://localhost:4848/management/domain/resources/jdbc-resource/
jdbc-__TimerPool",
"http://localhost:4848/management/domain/resources/jdbc-resource/
jdbc-__default"
]
These operations are supported through child resources of the resource on which the operation
is performed. The child resources do not represent nodes in the configuration object tree.
For example, the resource for managing a domain provides child resources for non-CRUD
operations as shown in the following table.
Resource Action
host-port Displays the host on which the DAS is running and the port on which the DAS
listens for HTTP requests.
rotate-log Rotates the server log file by renaming the file with a timestamp name in the format
server.log_date-and-time, and creating an empty log file.
uptime Displays the length of time that the DAS has been running since it was last restarted.
Securing Enterprise Server REST Interfaces involves the following sequence of tasks:
1. Adding an admin-realm user to the asadmin user group
2. Enabling Secure Sockets Layer (SSL)
For information about how to perform these tasks from the command line, see the following
documentation:
■ “To Create an Authentication Realm” on page 206
■ “To Create a File User” on page 211
For information about how to perform these tasks by using the Administration Console, see the
following topics in the Administration Console online help:
■ To Add a User to the Admin Realm
■ To Edit SSL Settings for a Protocol
How to specify the resource representation depends on how you are accessing the Enterprise
Server REST interfaces. For example, if you are using the cURL utility, specify the resource
representation through the -H option as follows:
■ For JSON, specify -H "Accept: application/json".
■ For XML, specify -H "Accept: application/xml".
■ For HTML, omit the -H option.
{
"resource":{attributes},
"Methods": {
method-list
}
"Child Resources":[urls]
}
method-list
One or more metadata sets separated by a comma (,) that represent the methods that the
resource supports. For the format of each metadata set, see “JSON Representation of a
Method in a Method List” on page 77.
urls
Zero or more URLs to child resources separated by a comma (,).
Method":{
"Name":"method-name",
"Message Parameters":{
message-parameter-list
}
"Query Parameters":{
queryparameter- list
}
}
"parameter-name":{attribute-list}
attribute-list
A comma-separated list of name-value pairs of attributes for the parameter. Each pair is in
the following format:
"name":"value"
"Domain":{"log-root":"${com.sun.aas.instanceRoot}/logs",
"application-root":"${com.sun.aas.instanceRoot}/applications",
"locale":"", "version":"73"},
"Methods":{
"Method":{
"Name":"POST",
"Message Parameters":{
"log-root":{"Key":"false", "Type":"string", "Optional":"true"},
"application-root":{"Key":"false", "Type":"string", "Optional":"true"},
"locale":{"Key":"false", "Type":"string", "Optional":"true"},
"Child Resources":[
"http://localhost:4848/management/domain/configs",
"http://localhost:4848/management/domain/resources",
"http://localhost:4848/management/domain/servers",
"http://localhost:4848/management/domain/property",
"http://localhost:4848/management/domain/applications",
"http://localhost:4848/management/domain/system-applications",
"http://localhost:4848/management/domain/stop",
"http://localhost:4848/management/domain/restart",
"http://localhost:4848/management/domain/uptime",
"http://localhost:4848/management/domain/version",
"http://localhost:4848/management/domain/rotate-log",
"http://localhost:4848/management/domain/host-port"
]
<resource attributes>
<Methods>
method-list
</Methods>
children
</type>
children
Zero or more XML elements that specify the URLs of child resources. Each element is
specified as <child-resource>url</child-resource>, where child-resource is the name of the
child resource and url is the URL to the child resource.
<Method name="method-name">
<Message-Parameters>
message-parameter-list
</Message-Parameters>
<Query-Parameters>
query-parameter-list
</Query-Parameters>
</Method>
<parameter-name attribute-list/>
<Domain log-root="${com.sun.aas.instanceRoot}/logs"
application-root="${com.sun.aas.instanceRoot}/applications" locale="" version="73">
<Methods>
<Method name="POST">
<Message-Parameters>
<log-root Key="false" Type="string" Optional="true"/>
<application-root Key="false" Type="string" Optional="true"/>
<locale Key="false" Type="string" Optional="true"/>
<version Key="false" Type="string" Optional="true"/>
</Message-Parameters>
</Method>
<Method name="GET">
</Method>
</Methods>
<Child-Resources>
<Child-Resource>http://localhost:4848/management/domain/configs</Child-Resource>
<Child-Resource>http://localhost:4848/management/domain/resources</Child-Resource>
<Child-Resource>http://localhost:4848/management/domain/servers</Child-Resource>
<Child-Resource>http://localhost:4848/management/domain/property</Child-Resource>
<Child-Resource>http://localhost:4848/management/domain/applications</Child-Resource>
<Child-Resource>http://localhost:4848/management/domain/system-applications</Child-Resource>
<Child-Resource>http://localhost:4848/management/domain/stop</Child-Resource>
<Child-Resource>http://localhost:4848/management/domain/restart</Child-Resource>
<Child-Resource>http://localhost:4848/management/domain/uptime</Child-Resource>
<Child-Resource>http://localhost:4848/management/domain/version</Child-Resource>
<Child-Resource>http://localhost:4848/management/domain/rotate-log</Child-Resource>
<Child-Resource>http://localhost:4848/management/domain/host-port</Child-Resource>
</Child-Resources>
</Domain>
For a sample web page, see Figure 2–1. In this example, the DAS is running on the local host and
the HTTP port for administration is 4848. The URL to the resource in this example is
http://localhost:4848/management/domain.
Administering Domains
This chapter provides procedures for administering domains in the Sun GlassFishTM Enterprise
Server v3 environment by using the asadmin command-line utility.
Instructions for accomplishing the tasks in this chapter by using the Administration Console
are contained in the Administration Console online help.
The Enterprise Server installer creates a default administrative domain named domain1, as well
as an associated domain administration server (DAS) named server. The DAS is a
specially-designated instance that authenticates the administrator, accepts requests from
administration tools, and communicates with server instances in the domain to carry out
requests. The DAS is sometimes referred to as the default server because it is the only server
instance created during Enterprise Server installation that can be used for deployment.
83
Creating, Logging In To, and Deleting a Domain
The default administration port is 4848, but a different port can be specified during installation.
When a domain is created, you are prompted for the administration user name and password,
but you can accept the default in which case user name is admin and there is no password. To
reset the administration password, see “To Change the Administration Password” on page 192.
The graphical Administration Console communicates with a specific DAS to administer the
domain associated with the DAS. Each Administration Console session enables you to
configure and manage the specific domain. If you create multiple domains, you must start a
separate Administration Console session to manage each domain.
▼ To Create a Domain
After installing Enterprise Server and creating the default domain (domain1), you can create
additional domains by using the local create-domain subcommand. This subcommand creates
the configuration of a domain. Any user who has access to the asadmin utility on a given system
can create a domain and store the domain configuration in a folder of choice. By default, the
domain configuration is created in the default directory for domains. You can override this
location to store the configuration elsewhere.
You are required to specify an administrative user when you create a domain, or you can accept
the default login identity which is username admin with no password.
Before You Begin Determine which profile will apply to the domain.
To start the Administration Console in a browser, enter the URL in the following format:
http://hostname:5000
For this example, the domain’s log files, configuration files, and deployed applications now
reside in the following directory:
domain-root-dir/mydomain
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
create-domain at the command line.
▼ To List Domains
Use the list-domains subcommand to display a list of domains and their statuses. If the
domain directory is not specified, the contents of the default as-install/domains directory is
listed. If there is more than one domain, the domain name must be specified.
To list domains that were created in other directories, specify the --domaindir option.
asadmin> list-domains
Name: domain1 Status: Running
Name: domain4 Status: Not Running
Name: domain6 Status: Not Running
Command list-domains executed successfully.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
list-domain at the command line.
▼ To Log In to a Domain
All remote subcommands require that credentials be specified in terms of an administration
user name and its password. By default, the domain is created with an identity that allows an
asadmin user to perform administrative operations when no identity is explicitly or implicitly
specified. The default identity is in the form of a user whose name is admin and has no password.
If you specify no user name on the command line or on prompt, and specify no password in the
--passwordfile option or on prompt, and you have never logged in to a domain using either
the login subcommand or the create-domain subcommand with the ----savelogin option,
then the asadmin utility will attempt to perform a given administrative operation without
specifying any identity. A server (domain) allows administrative operations to be run using this
default identity if the following conditions are true:
1. The server (domain) uses file realm for authentication of admin users.
2. The file realm has one and only one user (what the user name is does not matter).
By default, all of these conditions are true, unless you have created the domain with a specific
user name and password. Thus, by default, the only administration user is admin with no
password. If #3 is not true, you will need to specify the password. If #2 is not true, you will also
need to specify the user name. If #1 is not true, you will need to specify the user name and
password.
Use the login subcommand in local mode to authenticate yourself (log in to) a specific domain.
After such login, you do not need to specify the administration user or password for subsequent
operations on the domain. The login subcommand can only be used to specify the
administration password. For other passwords that remote subcommands require, use the
--passwordfile option, or specify the password at the command prompt. You are always
prompted for the administration user name and password.
There is no logout subcommand. If you want to log in to another domain, invoke asadmin
login with new values for --host and --port.
1 Determine the name of the domain that you are logging in to.
To list the existing domains:
asadmin list-domains
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
login at the command line. For additional information about passwords, see “Administering
Passwords” on page 190.
▼ To Delete a Domain
Use the delete-domain subcommand to delete an existing domain from a server. Only the root
user or the operating system user who is authorized to administer the domain can run this
subcommand.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
delete-domain at the command line.
▼ To Start a Domain
When you start a domain or server, the domain administration server (DAS) is started. After
startup, the DAS runs constantly, listening for and accepting requests.
If the domain directory is not specified, the domain in the default as-install/domains directory
is started. If there are two or more domains, the domain_name operand must be specified. Each
domain must be started separately.
If you want the domain you are starting to be able to use the restart-domain subcommand, the
--watchdog option must be set to true (true is the default). If you have set the --watchdog
option to false, the domain will not be able to use the restart-domain subcommand.
Note – For Microsoft Windows, you can use an alternate method to start a domain. From the
Windows Start menu, select Programs → Sun Microsystems →Enterprise Server → Start
Admin Server.
If there is only one domain, you can omit the domain name. If you do not include the password,
you might be prompted to supply it.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
start-domain at the command line.
▼ To Stop a Domain
Stopping a domain or server shuts down its domain administration server (DAS). When
stopping a domain, the DAS stops accepting new connections and then waits for all outstanding
connections to complete. This shutdown process takes a few seconds. While the domain is
stopped, the Administration Console and most of the asadmin subcommands cannot be used.
This subcommand is particularly useful in stopping a runaway server. For more controlled
situations, you can use the restart-domain(1) subcommand.
Note – For Microsoft Windows, you can use an alternate method to stop a domain. From the
Start menu, select Programs → Sun Microsystems → Enterprise Server → Stop Admin Server.
1 If necessary, notify users that you are going to stop the domain.
asadmin> stop-domain
Waiting for the domain to stop ...........
Command stop-domain executed successfully.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
stop-domain at the command line.
▼ To Restart a Domain
Use the restart-domain subcommand in remote mode to restart the Domain Administration
Server (DAS) of the specified host. When restarting a domain, the DAS stops accepting new
connections and then waits for all outstanding connections to complete. This shutdown process
takes a few seconds. Until the domain has restarted, the Administration Console and most of
the asadmin subcommands cannot be used.
This subcommand is particularly useful for environments where the server machine is secured
and difficult to get to. With the right credentials, you can restart the server from a remote
location as well as from the same machine.
If the server will not restart, use the stop-domain(1) subcommand followed by the
start-domain(1) subcommand.
Before You Begin For the restart-domain subcommand to work, the --watchdog option of the start-domain
subcommand must have been set to true (the default) when the domain was started. If this
option was set to false and you attempt to restart the domain, the domain is stopped and a
warning message is logged. If the --watchdog option is set to false, you can only restart the
domain by using the stop-domain and start-domain subcommands.
http://yourhost:4848/__asadmin/restart-domain
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
restart-domain at the command line.
Before You Begin To run the asadmin create-service subcommand, you must have solaris.smf.*
authorization. See the useradd and usermod man pages to find out how to set the
authorizations. You must also have write permission in the directory tree:
/var/svc/manifest/application/SUNWappserver. Usually, the superuser has both of these
permissions. Additionally, the Solaris 10 administration commands such as svccfg, svcs, and
auths must be available in the PATH.
If a particular Enterprise Server domain should not have default user privileges, modify the
manifest of the service and reimport the service.
2 After the service is created, enable the service by using the svacdm enable subcommand.
For example:
svacdm enable /appserver/domains/domain1
asadmin> create-service
The Service was created successfully. Here are the details:
Name of the service:application/GlassFish/domain1
Type of the service:Domain
Configuration location of the service:/home/gfuser/glassfish-installations
/glassfishv3/glassfish/domains
Manifest file location on the system:/var/svc/manifest/application
/GlassFish/domain1_home_gfuser_glassfish-installations_glassfishv3
_glassfish_domains/Domain-service-smf.xml.
You have created the service but you need to start it yourself.
Here are the most typical Solaris commands of interest:
* /usr/bin/svcs -a | grep domain1 // status
* /usr/sbin/svcadm enable domain1 // start
* /usr/sbin/svcadm disable domain1 // stop
* /usr/sbin/svccfg delete domain1 // uninstall
Command create-service executed successfully
See Also As you administer your service, the following Solaris commands are useful: auths,
smf_security, svcadm, svccfg, rbac, useradd, and usermod.
The text must be on a single line. The first three letters are a unique designator for the process
and can be altered.
2 If the Enterprise Server service is running, restart the service for your changes to take affect.
asadmin> uptime
Uptime: 1 Weeks, 4 days, 0 hours, 17 minutes, 14 seconds, Total milliseconds: 951434595
Command uptime executed successfully.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
uptime at the command line.
Note – Do not downgrade to an earlier Java version after a domain has been created with a newer
JVM machine. If you must downgrade your JVM machine, downgrade it only for individual
domains.
1 If you have not already done so, download the desired Java SDK (not the JRE) and install it on
your system.
The Java SDK can be downloaded from http://java.sun.com/j2se.
2 Start the domain for which you are changing the JDK.
Use the following format:
as-install/bin/asadmin start-domain domain-name
For a valid JVM installation, locations are checked in the following order:
This chapter provides procedures for administering the Virtual Machine for the JavaTM platform
(Java Virtual Machine) or JVMTM machine) in the Sun GlassFishTM Enterprise Server v3
environment by using the asadmin command-line utility.
Instructions for accomplishing these tasks by using the Administration Console are contained
in the Administration Console online help.
95
Administering JVM Options
3 To apply your changes, restart Enterprise Server. See “To Restart a Domain”on page 90.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
create-jvm-options at the command line.
asadmin> list-jvm-options
-Djava.security.auth.login.config=${com.sun.aas.instanceRoot}/config/login.conf
-XX: LogVMOutput
-XX: UnlockDiagnosticVMOptions
-Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.
config.serverbeans.AppserverConfigEnvironmentFactory
-Djavax.net.ssl.keyStore=${com.sun.aas.instanceRoot}/config/keystore.jks
-XX:NewRatio=2
-Djava.security.policy=${com.sun.aas.instanceRoot}/config/server.policy
-Djdbc.drivers=org.apache.derby.jdbc.ClientDriver
-Djavax.net.ssl.trustStore=${com.sun.aas.instanceRoot}/config/cacerts.jks
-client
-Djava.ext.dirs=${com.sun.aas.javaRoot}/lib/ext${path.separator}${com.sun.aas.ja
vaRoot}/jre/lib/ext${path.separator}${com.sun.aas.instanceRoot}/lib/ext${path.se
parator}${com.sun.aas.derbyRoot}/lib
-Xmx512m
-XX:LogFile=${com.sun.aas.instanceRoot}/logs/jvm.log
-Djava.endorsed.dirs=${com.sun.aas.installRoot}/lib/endorsed
Command list-jvm-options executed successfully.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
list-jvm-options at the command line.
5 To apply your changes, restart Enterprise Server. See “To Restart a Domain”on page 90.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
delete-jvm-options at the command line.
user.timezone = America/New_York
user.variant =
variable = \$HOME
web.home = C:\Preview\v3_Preview_release\distributions\web\target\
glassfish\modules\web
Command generate-jvm-report executed successfully.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
generate-jvm-report at the command line.
▼ To Create a Profiler
A server instance is tied to a particular profiler by the profiler element in the Java configuration.
If JVM options are created for a profiler, the options are used to record the settings needed to
activate a particular profiler. Use the create-profiler subcommand in remote mode to create
the profiler element in the Java configuration.
Only one profiler can exist. If a profiler already exists, you receive an error message that directs
you to delete the existing profiler before creating a new one.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
create-profiler at the command line.
▼ To Delete a Profiler
Use the delete-profiler subcommand in remote mode to delete the profiler element from the
Java configuration. You can then create a new profiler.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
delete-profiler at the command line.
This chapter provides procedures for administering thread pools in the Sun GlassFishTM
Enterprise Server v3 environment by using the asadmin command-line utility.
Instructions for accomplishing these tasks by using the Administration Console are contained
in the Administration Console online help.
One thread pool can serve multiple connector modules and enterprise beans. Request threads
handle user requests for application components. When Enterprise Server receives a request, it
assigns the request to a free thread from the thread pool. The thread executes the client's
requests and returns results. For example, if the request needs to use a system resource that is
currently busy, the thread waits until that resource is free before allowing the request to use that
resource.
101
Configuring Thread Pools
The minimum thread pool size that is specified signals the server to allocate at least that many
threads in reserve for application requests. That number is increased up to the maximum thread
pool size that is specified. Increasing the number of threads available to a process allows the
process to respond to more application requests simultaneously.
If one resource adapter or application occupies all the Enterprise Server threads, thread
starvation might occur. You can avoid this by dividing the Enterprise Server threads into
different thread pools.
Note – Restart is not necessary for thread pools used by the web container.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
create-threadpool at the command line.
asadmin> list-threadpools
threadpool-1
Command list-threadpools executed successfully
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
list-threadpools at the command line.
2 Modify the values for a thread pool by using the set(1) subcommand.
The thread pool is identified by its dotted name.
Note – Restart is not necessary for thread pools used by the web container.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help set
at the command line.
Note – Restart is not necessary for thread pools used by the web container.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
delete-threadpool at the command line.
This chapter explains how to administer web applications in the Sun GlassFishTM Enterprise
Server v3 environment.
Instructions for accomplishing some of these tasks by using the Administration Console are
contained in the Administration Console online help.
http://server:port/context-root/servlet-mapping?name=value
server:port The IP address (or host name) and optional port number.
To access the default web module for a virtual server, specify only this URL section.
You do not need to specify the context-root or servlet-name unless you also wish to
specify name-value parameters.
105
Changing Log Output for a Servlet
context-root For an application, the context root is defined in the context-root element of the
application.xml, sun-application.xml, or sun-web.xml file. For an individually
deployed web module, the context root is specified during deployment.
For both applications and individually deployed web modules, the default context root
is the name of the WAR file minus the .war suffix.
In this example, localhost is the host name, MortPages is the context root, and calcMortgage
is the servlet mapping.
http://localhost:8080/MortPages/calcMortgage?rate=8.0&per=360&bal=180000
To invoke a servlet from within a JSP file, you can use a relative path. For example:
You can change these defaults using the Administration Console Write to System Log box. If
this box is checked, System.out output is sent to the server log. If it is unchecked, System.out
output is sent to the system default location only.
For example, directory listings are disabled by default for added security. To enable directory
listings in your domain's default-web.xml file, search for the definition of the servlet whose
servlet-name is equal to default, and set the value of the init-param named listings to
true. Then restart the server.
<init-param>
<param-name>listings</param-name>
<param-value>true</param-value>
</init-param>
If listings is set to true, you can also determine how directory listings are sorted. Set the value
of the init-param named sortedBy to NAME, SIZE, or LAST_MODIFIED. Then restart the server.
<init-param>
<param-name>sortedBy</param-name>
<param-value>LAST_MODIFIED</param-value>
</init-param>
The mime-mapping elements in default-web.xml are global and inherited by all web
applications. You can override these mappings or define your own using mime-mapping
elements in your web application's web.xml file. For more information about mime-mapping
elements, see the Servlet specification.
You can use the Administration Console to edit the default-web.xml file, or edit the file
directly using the following steps.
Redirecting a URL
You can specify that a request for an old URL be treated as a request for a new URL. This is
called redirecting a URL.
To specify a redirected URL for a virtual server, use the redirect_n property, where n is a
positive integer that allows specification of more than one. Each of these redirect_n properties
is inherited by all web applications deployed on the virtual server.
The value of each redirect_n property has two components which can be specified in any
order:
■ The first component, from, specifies the prefix of the requested URI to match.
■ The second component, url-prefix, specifies the new URL prefix to return to the client.
The from prefix is replaced by this URL prefix.
Administering mod_jk
The Apache Tomcat Connector mod_jk can be used to connect the web container with web
servers such as Apache HTTP Server. By using mod_jk, which comes with Enterprise Server,
you can front Enterprise Server with Apache HTTP Server.
You can also use mod_jk directly at the JSP/servlet engine for load balancing.
Supported versions of the software referred to in this section include Apache HTTP Server
2.2.11 (UNIX), mod_ssl 2.2.11, OpenSSL 0.9.8a, and mod_jk 1.2.27.
▼ To Enable mod_jk
You can front Enterprise Server with Apache HTTP Server by enabling the mod_jk protocol for
one of Enterprise Server's network listeners, as described in this procedure. A typical use for
mod_jk would be to have Apache HTTP Server handle requests for static resources, while
having requests for dynamic resources, such as servlets and JavaServerTM Pages (JSPs),
forwarded to, and handled by the Enterprise Server back-end instance.
When you use the jk-enabled attribute of the network listener, you do not need to copy any
additional JAR files into the /lib directory. You can also create JK connectors under different
virtual servers by using the network listener attribute jk-enabled.
where listener-name is the ID of the network listener for which mod_jk is being enabled.
7 If you are using the glassfish-jk.properties file and not referencing it in the httpd.conf
file, point to the properties file by using the create-jvm-options(1) subcommand.
Use the following format:
asadmin> create-jvm-options -Dcom.sun.enterprise.web.connector.enableJK.propertyFile=
domain-dir/config/glassfish-jk.properties
In order to support stickiness, the Apache mod_jk load balancer relies on a jvmRoute system
property that is included in any JSESSIONID received by the load balancer. This means that
every Enterprise Server instance that is front-ended by the Apache load balancer must be
configured with a unique jvmRoute system property.
1 On each of the instances, perform the steps in “To Enable mod_jk”on page 108.
If your instances run on the same machine, you must choose different JK ports. The ports must
match worker.worker*.port in your workers.properties file. See the properties file in
Example 6–5.
2 On each of the instances, create the jvmRoute system property of Enterprise Server by using the
create-jvm-options(1) subcommand.
Use the following format:
asadmin> create-jvm-options "-DjvmRoute=/instance-worker-name"/
where instance-worker-name is the name of the worker that you defined to represent the
instance in the workers.properties file.
3 To apply your changes, restart Apache HTTP Server and Enterprise Server.
worker.list=worker1,worker2,loadbalancer
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009
worker.worker1.lbfactor=1
worker.worker1.socket_keepalive=1
worker.worker1.socket_timeout=300
worker.worker2.type=ajp13
worker.worker2.host=localhost
worker.worker2.port=8010
worker.worker2.lbfactor=1
worker.worker2.socket_keepalive=1
worker.worker2.socket_timeout=300
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=worker1,worker2
Listen 443
<VirtualHost _default_:443>
SSLEngine on
SSLCipherSuite ALL:!ADH:!EXP56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile "/etc/apache2/2.2/server.crt"
SSLCertificateKeyFile "/etc/apache2/2.2/server.pem"
JkMount /* worker1
</VirtualHost>
2 Start another Enterprise Server with at least one web application deployed.
In order for the mod_jk–enabled network listener to start listening for requests, the web
container must be started. Normally, this is achieved by deploying a web application.
3 Follow instructions from “To Configure an HTTP Listener for SSL”on page 284 on the mod_jk
connector.
Use the following format:
asadmin> create-ssl --type http-listener --certname sampleCert new-listener
4 Add the following directives in the httpd.conf file under the /etc/apache2/conf.d directory:
# Should mod_jk send SSL information (default is On)
JkExtractSSL On
# What is the indicator for SSL (default is HTTPS)
JkHTTPSIndicator HTTPS
# What is the indicator for SSL session (default is SSL_SESSION_ID)
JkSESSIONIndicator SSL_SESSION_ID
# What is the indicator for client SSL cipher suit (default is SSL_CIPHER)
JkCIPHERIndicator SSL_CIPHER
# What is the indicator for the client SSL certificated? (default is SSL_CLIENT_CERT)
JkCERTSIndicator SSL_CLIENT_CERT
5 (Optional) To support both SSL and non-SSL connection, create two mod_jk–enabled network
listeners and workers.
Example workers.properties file:
#This example shows a worker.properties
worker.list=ajp13unsecure, ajp13secure
worker.ajp13secure.type=ajp13
worker.ajp13secure.host=localhost
worker.ajp13secure.port=8009
worker.ajp13unsecure.type=ajp13
worker.ajp13unsecure.host=localhost
worker.ajp13unsecure.port=8010
Secure and unsecure HTTP listeners with ports 8009 and 8010 are created and enabled for
mod_jk. For instructions, see “To Enable mod_jk” on page 108.
6 To apply your changes, restart Apache HTTP Server and Enterprise Server.
This chapter provides instructions on how to configure logging and how to view log
information in the Sun GlassFishTM Enterprise Server v3 environment.
Instructions for accomplishing these tasks and also for editing properties by using the
Administration Console are contained in the Administration Console online help.
About Logging
Logging is the process by which Enterprise Server captures information about events that occur
during server operation, such as configuration errors, security failures, or server malfunction.
This data is recorded in a log file, and is usually the first source of information when problems
occur. Analyzing the log files can help you to determine the health of the server.
Although application components can use the Apache Commons Logging Library to record
messages, the platform standard JSR 047 API is recommended for better log configuration.
115
About Logging
Log File
Enterprise Server log records are captured in the server log. The server log is named
server.log by default and is typically located in domain-dir/logs. You can change the default
name or location of the server log by using the Administration Console.
In addition to the server log, the domain-dir/logs directory contains the following additional
logs:
■ HTTP service access logs, located in the /access subdirectory
■ Transaction service logs, located in the /tx subdirectory
When the server log reaches the specified size in bytes, the log is rotated and renamed with a
timestamp name to server.log_date, where date is the date and time that the file was rotated.
You can also rotate this log manually by following instructions in “Rotating the Server Log” on
page 121.
[#|2006-10-21T13:25:53.852-0400|INFO|GlassFish10.0|javax.enterprise.
system.core|_ThreadID=13;|CORE5004: Resource Deployed:
[cr:jms/DurableConnectionFactory].|#]
Logger Namespaces
You can use the list-logger-levels(1) subcommand to list the existing loggers for the
modules. Example loggers:
javax.enterprise.system.container.cmp: INFO
javax.enterprise.system.tools.admin: INFO
javax.enterprise.system.container.web: INFO
javax.enterprise.system.util: INFO
javax.enterprise.resource.webcontainer.jsf.timing: INFO
javax: INFO
javax.enterprise.resource.corba: INFO
javax.enterprise.system.core.naming: INFO
javax.enterprise.system.core.selfmanagement: INFO
javax.enterprise.system.container.ejb: INFO
javax.enterprise.resource.webcontainer.jsf.config: INFO
javax.enterprise.resource.javamail: INFO
org.apache.catalina: INFO
javax.enterprise.system.core.config: INFO
javax.enterprise.system.webservices.rpc: INFO
javax.enterprise.system.webservices.registry: INFO
javax.enterprise.system.tools.deployment: INFO
javax.enterprise.resource.jms: INFO
javax.enterprise.system: INFO
javax.enterprise.system.webservices.saaj: INFO
org.apache.jasper: INFO
javax.enterprise.resource.webcontainer.jsf.lifecycle: INFO
javax.enterprise.resource.jta: INFO
javax.enterprise.resource.jdo: INFO
javax.enterprise.resource.resourceadapter: INFO
javax.enterprise.system.core.transaction: INFO
javax.enterprise.resource.webcontainer.jsf.resource: INFO
javax.enterprise.system.core.security: INFO
javax.enterprise.resource.webcontainer.jsf.application: INFO
javax.enterprise.system.core.classloading: INFO
org.apache.coyote: INFO
javax.enterprise.resource.webcontainer.jsf.managedbean: INFO
javax.enterprise.system.container.ejb.mdb: INFO
javax.enterprise.resource.webcontainer.jsf.context: INFO
javax.enterprise.resource.webcontainer.jsf.renderkit: INFO
javax.enterprise.resource.webcontainer.jsf.facelets: INFO
javax.enterprise.resource.webcontainer.jsf.taglib: INFO
There are two levels of log settings available: global and logger-specific. If you have chosen a
logger-specific setting that is different from the global setting, the logger-specific setting takes
precedence.
Setting the global log level is done by editing the logging.properties file. Logging levels for
the individual modules are set by using the asadmin subcommands as explained in this section
asadmin> list-logger-levels
javax.enterprise.system.container.cmp: INFO
javax.enterprise.system.tools.admin: INFO
java.util.logging.ConsoleHandler: FINEST
javax.enterprise.system.container.web: INFO
javax.enterprise.system.util: INFO
javax.enterprise.resource.webcontainer.jsf.timing: INFO
javax: INFO
javax.enterprise.resource.corba: INFO
...
Command list-logger-levels executed successfully.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
list-logger-levels at the command line.
java -Djava.util.logging.config.file=myfile
The ConsoleHandler has a separate log level setting that limits the messages that are displayed.
For example:
java.util.logging.ConsoleHandler.level = INFO
java.util.logging.ConsoleHandler.formatter =
com.sun.enterprise.server.logging.UniformLogFormatter
1 In a text editor, find the ConsoleHandler log level line and make your changes.
Example 7–2 Changing the Global Log Level for All Loggers
If you set the log level at the root level, you are setting the level of all loggers. This example sets
the log level for all loggers to INFO:
.level= INFO
By default, the module log level is set to FINE. The lines for the loggers might look like this (the
modules are indicated in bold):
#javax.enterprise.system.tools.level=FINE
#javax.enterprise.system.container.ejb.level=FINE
#javax.enterprise.system.core.security.level=FINE
#javax.enterprise.system.tools.admin.level=FINE
#javax.enterprise.level=FINE
#javax.enterprise.system.container.web.level=FINE
Because setting log levels is a dynamic operation, you do not need to restart Enterprise Server
for changes to take effect.
3 Set the log level for a module by using the set-log-level(1) subcommand.
Your choices are SEVERE, WARNING, INFO, CONFIG, FINE, FINER, and FINEST.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
set-log-level at the command line.
Because log rotation is a dynamic operation, you do not need to restart Enterprise Server for
changes to take effect.
asadmin> rotate-log
Command rotate-log executed successfuly.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
rotate-log at the command line.
To view information that has been collected for a module, you can open the server.log file in a
text editor and search for the module that you are interested in.
This chapter explains how to monitor the Sun GlassFishTM Enterprise Server v3 components
and services by using the asadmin command-line utility. Instructions for configuring JConsole
to monitor Enterprise Server resources are also provided.
Instructions for monitoring by using the Administration Console are contained in the
Administration Console online help.
For information on using REST interfaces for monitoring, see “Using REST Interfaces to
Administer Enterprise Server” on page 62.
About Monitoring
Monitoring is the process of reviewing the statistics of a system to improve performance or solve
problems. The monitoring service can track and display operational statistics, such as the
number of requests per second, the average response time, and the throughput. By monitoring
the state of various components and services deployed in Enterprise Server, you can identify
performance bottlenecks, predict failures, perform root cause analysis, and ensure that
everything is functioning as expected. Data gathered by monitoring can also be useful in
performance tuning and capacity planning.
For this release of Enterprise Server, monitoring is exposed in a modular way so that many
client modules can access and display the monitoring statistics. These clients include the
Administration Console, the asadmin utility, AMX, and REST interfaces.
123
About Monitoring
In the tree, a monitorable object can have child objects (nodes) that represent exactly what can
be monitored for that object. All child objects are addressed using the dot (.) character as a
separator. These constructed names are referred to as dotted names. Detailed information on
dotted names is available in the dotted-names(5ASC) help page.
The following command lists the monitorable child objects of the instance server:
server.applications
server.connector-service
server.http-service
server.jms-service
server.containers.jruby
server.jvm
server.network
server.orb
server.resources
server.security
server.thread-pool
server.transaction-service
server.web
Each object is represented by a dotted name. Dotted names can also address specific attributes
in monitorable objects. For example, the jvm object has a memory attribute with a statistic called
maxheapsize. The following dotted name addresses the attribute:
server.jvm.memory.maxheapsize
server.applications
|--- application1
| |--- ejb-module-1
| | |--- ejb1 *
| | |--- bean-cache (for entity/sfsb) *
| | |--- bean-pool (for slsb/mdb/entity) *
| | |--- bean-methods
| | |---method1 *
| | |---method2 *
| | |--- timers (for s1sb/entity/mdb) *
| |--- web-module-1
| | |--- virtual-server-1 *
| | |---servlet1 *
| | |---servlet2 *
|--- standalone-web-module-1
| | |----- virtual-server-2 *
| | |---servlet3 *
| | |---servlet4 *
| | |----- virtual-server-3 *
| | |---servlet3 *(same servlet on different vs)
| | |---servlet5 *
|--- standalone-ejb-module-1
| | |--- ejb2 *
| | |--- bean-cache (for entity/sfsb) *
| | |--- bean-pool (for slsb/mdb/entity) *
| | |--- bean-methods
| | |--- method1 *
| | |--- method2 *
| | |--- timers (for s1sb/entity/mdb) *
|--- jersey-application-1
| |--- jersey
| | |--- resources
resource-0
hitcount
*statistic
|--- application2
For available statistics, see “EJB Statistics” on page 140, “Jersey Statistics” on page 145, and “Web
Statistics” on page 162.
server.connector-service
resource-adapter-1
connection-pools
pool-1
work-management
server.http-service
virtual-server
request
*statistic
_asadmin
request
*statistic
server.jms-service
connection-factories
connection-factory-1
work-management
server.containers.jruby.applications
jruby-application
*statistic
http
*statistic
runtime-pool
*statistic
server.jvm
class-loading-system
compilation-system
garbage-collectors
memory
operating-system
runtime
server.network
type-of-listener
keep-alive
*statistic
file-cache
*statistic
thread-pool
*statistic
connection-queue
*statistic
server.orb
transport
connectioncache
inbound
*statistic
outbound
*statistic
server.resources
connection-pool
request
*statistic
server.security
ejb
*statistic
web
*statistic
realm
*statistic
server.thread-pool
orb
threadpool
thread-pool-1
*statistic
server.transaction-service
statistic
server.web
jsp
*statistic
servlet
*statistic
session
*statistic
request
*statistic
■ The get subcommand is used to display comprehensive data, such as the attributes and
values for a dotted name. The get subcommand used with a wildcard parameter displays all
available attributes for any monitorable object. For additional information, see “Guidelines
for Using the list and get Subcommands for Monitoring” on page 136.
Configuring Monitoring
By default, the monitoring service is enabled for Enterprise Server, but monitoring for the
individual modules is not. To enable monitoring for a module, you change the monitoring level
for that module to LOW or HIGH, You can choose to leave monitoring OFF for objects that do
not need to be monitored.
■ LOW. Simple statistics, such as create count, byte count, and so on
■ HIGH. Simple statistics plus method statistics, such as method count, duration, and so on
■ OFF. No monitoring, no impact on performance
▼ To Enable Monitoring
Use the enable-monitoring subcommand to enable the monitoring service itself, or to enable
monitoring for individual modules. Monitoring is immediately activated, without restarting
Enterprise Server.
You can also use the set(1) subcommand to enable monitoring for a module. Using the set
command is not a dynamic procedure, so you need to restart Enterprise Server for your changes
to take effect.
1 Determine which services and components are currently enabled for monitoring.
asadmin> get server.monitoring-service.module-monitoring-levels.*
This example output shows that the HTTP service is not enabled (OFF for monitoring), but
other objects are enabled:
configs.config.server-config.monitoring-service.module-monitoring-levels.web-container=HIGH
configs.config.server-config.monitoring-service.module-monitoring-levels.http-service=OFF
configs.config.server-config.monitoring-service.module-monitoring-levels.jvm=HIGH
asadmin> enable-monitoring
Command enable-monitoring executed successfully
Example 8–3 Enabling Monitoring for Modules by Using the set Subcommand
This example enables monitoring for the HTTP service by setting the monitoring level to HIGH
(you must restart the server for changes to take effect).
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
enable-monitoring at the command line.
▼ To Disable Monitoring
Use the disable-monitoring subcommand to disable the monitoring service itself, or to
disable monitoring for individual modules. Monitoring is immediately stopped, without
restarting Enterprise Server.
You can also use the set(1) subcommand to disable monitoring for a module. Using the set
command is not a dynamic procedure, so you need to restart Enterprise Server for your changes
to take effect.
1 Determine which services and components currently are enabled for monitoring.
asadmin get server.monitoring-service.module-monitoring-levels.*
This example output shows that monitoring is enabled for web-container, http-service, and
jvm:
configs.config.server-config.monitoring-service.module-monitoring-levels.web-container=HIGH
configs.config.server-config.monitoring-service.module-monitoring-levels.http-service=HIGH
configs.config.server-config.monitoring-service.module-monitoring-levels.jvm=HIGH
asadmin> disable-monitoring
Command disable-monitoring executed successfully
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
disable-monitoring at the command line.
Before You Begin A monitorable object must be configured for monitoring before you can display data on the
object. See “To Enable Monitoring ” on page 131.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
monitor at the command line.
Statistic Description
mt Maximum time. Longest response time for a request; not a cumulative value, but the largest
response time from among the response times
pt Processing time. Cumulative value of the times taken to process each request, with
processing time being the average of request processing times over request
Statistic Description
count Amount of memory (in bytes) that is guaranteed to be available for use by the JVM
machine
max The maximum amount of memory that can be used for memory management.
min Initial amount of memory (in bytes) that the JVM machine requests from the operating
system for memory management during startup
UpTime Number of milliseconds that the JVM machine has been running since it was last started
Statistic Description
ajlc Number of active JavaServer PagesTM (JSPTM) technology pages that are loaded
st Total sessions
For example, the following table explains the output of the list and get subcommands used
with the dotted name for the resources node.
For detailed information on dotted names, see the dotted-names(5ASC) help page.
Before You Begin A monitorable object must be configured for monitoring before you can display information
about the object. See “To Enable Monitoring ” on page 131 if needed.
1 List the objects that are enabled for monitoring by using the list(1) subcommand.
For example, the following subcommand lists all components and services that have
monitoring enabled for instance server.
asadmin> list --monitor "*"
server.web
server.connector-service
server.orb
server.jms-serviceserver.jvm
server.applications
server.http-service
server.thread-pools
2 Get data for a monitored component or service by using the get(1) subcommand.
server.jvm.class-loading-system.unloadedclasscount = 16
server.jvm.compilation-system.name-current = HotSpot Client Compiler
server.jvm.compilation-system.totalcompilationtime = 769
server.jvm.garbage-collectors.Copy.collectioncount = 285
server.jvm.garbage-collectors.Copy.collectiontime = 980
server.jvm.garbage-collectors.MarkSweepCompact.collectioncount = 2
server.jvm.garbage-collectors.MarkSweepCompact.collectiontime = 383
server.jvm.memory.committedheapsize = 23498752
server.jvm.memory.committednonheapsize = 13598720
server.jvm.memory.initheapsize = 0
server.jvm.memory.initnonheapsize = 8585216
server.jvm.memory.maxheapsize = 66650112
server.jvm.memory.maxnonheapsize = 100663296
server.jvm.memory.objectpendingfinalizationcount = 0
server.jvm.memory.usedheapsize = 19741184
server.jvm.memory.usednonheapsize = 13398352
server.jvm.operating-system.arch-current = x86
server.jvm.operating-system.availableprocessors = 2
server.jvm.operating-system.name-current = Windows XP
server.jvm.operating-system.version-current = 5.1
server.jvm.runtime.classpath-current = glassfish.jar
server.jvm.runtime.inputarguments-current = []
server.jvm.runtime.managementspecversion-current = 1.0
server.jvm.runtime.name-current = 4372@ABBAGANI_WORK
server.jvm.runtime.specname-current = Java Virtual Machine Specification
server.jvm.runtime.specvendor-current = Sun Microsystems Inc.
server.jvm.runtime.specversion-current = 1.0
server.jvm.runtime.uptime = 84813
server.jvm.runtime.vmname-current = Java HotSpot(TM) Client VM
server.jvm.runtime.vmvendor-current = Sun Microsystems Inc.
server.jvm.runtime.vmversion-current = 1.5.0_11-b03
server.http-service.virtual-server1.request.requestcount
The tables in the following sections list the statistics that are available for each monitorable
object:
■ “EJB Statistics” on page 140
■ “HTTP Service Statistics” on page 143
■ “Jersey Statistics” on page 145
■ “JMS/Connector Service Statistics” on page 145
■ “JRuby Statistics” on page 147
■ “JVM Statistics” on page 149
■ “Network Statistics” on page 153
EJB Statistics
EJBs fit into the tree of objects as shown in “Applications Tree Hierarchy” on page 125. Use the
following dotted name pattern to get applications statistics:
server.applications.appname.ejbmodulename.ejbname.bean-cache.statistic
server.applications.appname.ejbmodulename.bean-cache.ejbname.statistic
The statistics available for EJB caches are listed in the following table.
server.applications.appname.ejbmodulename.container.ejbname
The statistics available for EJB containers are listed in the following table.
server.applications.appname.ejbmodulename.bean-methods.ejbname.statistic
The statistics available for EJB method invocations are listed in the following table.
server.applications.appname.ejbmodulename.bean-pool.ejbname.statistic
The statistics available for EJB pools are listed in the following table.
Timer Statistics
Use the following dotted name pattern for timer statistics:
server.applications.appname.ejbmodulename.timers.ejbname.statistic
The statistics available for timers are listed in the following table.
server.http-service.virtual-server.request.statistic
The HTTP service statistics for virtual servers are shown in the following table.
Jersey Statistics
Jersey fits into the tree of objects as shown in “Applications Tree Hierarchy” on page 125.
server.applications.jersey-application.jersey.resources.resource-0.hitcount.statistic
The statistics available for Jersey are shown in the following table.
server.connector-service.resource-adapter-1.connection-pool.statistic
JMS/Connector Service statistics available for the connector connection pools are shown in the
following table.
server.connector-service.resource-adapter-1.work-management.statistic
JMS/Connector Service statistics available for connector work management are listed in the
following table.
JRuby Statistics
JRuby fits into the tree of objects as show in “JRuby Tree Hierarchy” on page 127.
The statistics that are available for JRuby are shown in the following sections:
■ “JRuby Container Statistics” on page 147
■ “JRuby Runtime Statistics” on page 148
■ “JRuby HTTP Service Statistics” on page 148
server.containers.jruby.applications.jruby-application.statistic
The statistics that are available for the JRuby container are shown in the following table.
server.containers.jruby.applications.jruby-application.runtime.statistic
The statistics that are available for the JRuby runtime are shown in the following table.
server.containers.jruby.applications.jruby-application.http.statistic
The statistics that are available for the JRuby HTTP service are shown in the following table.
JVM Statistics
The JVM fits into the tree of objects as show in “JVM Tree Hierarchy” on page 127.
The statistics that are available for the Virtual Machine for Java platform (JavaTM Virtual
Machine) or JVM machine are shown in the following sections:
■ “JVM Class Loading System Statistics” on page 150
■ “JVM Compilation System Statistics” on page 151
■ “JVM Garbage Collectors Statistics” on page 151
■ “JVM Memory Statistics” on page 152
■ “JVM Operating System Statistics” on page 152
■ “JVM Runtime Statistics” on page 153
server.jvm.class-loading-system.statistic
With Java SE, additional monitoring information can be obtained from the JVM. Set the
monitoring level to LOW to enable the display of this additional information. Set the
monitoring level to HIGH to also view information pertaining to each live thread in the system.
More information about the additional monitoring features for Java SE is available in
Monitoring and Management for the Java Platform, which is available from
http://java.sun.com/javase/6/docs/technotes/guides/management/.
The statistics that are available for class loading in the JVM for Java SE are shown in the
following table.
The statistics available for threads in the JVM in Java SE are shown in the following table.
peakthreadcount CountStatistic Peak live thread count since the JVM started or
the peak was reset.
server.jvm.compilation-system.statistic
The statistics that are available for compilation in the JVM for Java SE are shown in the
following table.
server.jvm.garbage-collectors.statistic
The statistics that are available for garbage collection in the JVM for Java SE are shown in the
following table.
server.jvm.memory.statistic
The statistics that are available for memory in the JVM for Java SE are shown in the following
table.
server.jvm.operating-system.statistic
The statistics that are available for the operating system for the JVM machine in Java SE are
shown in the following table.
server.jvm.runtime.statistic
The statistics that are available for the runtime in the JVM runtime for Java SE are shown in the
following table.
Network Statistics
Network fits into the tree of objects as shown in “Network Tree Hierarchy” on page 128.
Network statistics are described in the following sections:
■ “Network Keep Alive Statistics” on page 154
server.network.type-of-listener.keep-alive.statistic
Statistics available for network keep alive are shown in the following table.
server.network.type-of-listener.connection-queue.statistic
Statistics available for network connection queue are shown in the following table.
countoverflows CountStatistic Number of times the queue has been too full to
accommodate a connection
server.network.type-of-listener.file-cache.statistic
Statistics available for network file cache are shown in the following table.
server.network.type-of-listener.thread-pool.statistic
Statistics available for network thread pool are shown in the following table.
server.orb.transport.connectioncache.inbound.statistic
server.orb.transport.connectioncache.outbound.statistic
The statistics available for the connection manager in an ORB are listed in the following table.
The connection pool resources fit into the tree of objects as shown in “Resources Tree
Hierarchy” on page 128.
Use the following dotted name pattern for connection pool statistics:
server.resources.connection-pool.statistic
Security Statistics
Security fits into the tree of objects as shown in “Security Tree Hierarchy” on page 129.
server.security.ejb.statistic
The statistics available for EJB security are listed in the following table.
server.security.web.statistic
The statistics available for web security are listed in the following table.
server.security.realm.statistic
The statistics available for realm security are listed in the following table.
The statistics available for thread pools are shown in the following sections:
■ “Thread Pool Monitoring Statistics” on page 160
■ “JVM Statistics for Java SE-Thread Information” on page 160
server.thread-pool.thread-pool.statistic
The statistics available for the thread pool are shown in the following table.
TABLE 8–34 JVM Monitoring Statistics for Java SE - Thread Info (Continued)
Statistic Data Type Description
lockownername StringStatistic Name of the thread that holds the monitor lock
of the object this thread is blocking on.
Use the following dotted name pattern for transaction service statistics:
server.transaction-service.statistic
The statistics available for the transaction service are shown in the following table.
Web Statistics
The web module fits into the tree of objects as shown in “Web Tree Hierarchy” on page 130.
server.applications.web-module.virtual-server.servlet.statistic
server.applications.application.web-module.virtual-server.servlet.statistic
The available web module servlet statistics are shown in the following table.
server.applications.web-module.virtual-server.statistic
server.applications.application.web-module.virtual-server.statistic
The available web JSP statistics are shown in the following table.
server.applications.web-module.virtual-server.statistic
server.applications.application.web-module.virtual-server.statistic
The available web request statistics are shown in the following table.
server.applications.web-module.virtual-server.statistic
server.applications.application.web-module.virtual-server.statistic
The available web servlet statistics are shown in the following table.
server.applications.web-module.virtual-server.statistic
server.applications.application.web-module.virtual-server.statistic
The available web session statistics are shown in the following table.
To view all MBeans, Enterprise Server provides a configuration of the standard JMX connector
server called System JMX Connector Server. As part of Enterprise Server startup, an instance of
this JMX Connector Server is started. Any compliant JMX connector client can connect to the
server using the JMX Connector Server.
By default, Enterprise Server is configured with a non-secure System JMX Connector Server. If
this is an issue, the JMX connector can be removed. However, access can be restricted to a
specific IP address (for example, the loopback address) by setting address to locahost.
3 Click the Remote tab and type the host name and port.
Always connect remotely with JConsole, otherwise MBeans will not load automatically.
4 Click Connect.
5 In the Remote Process text box, specify the JMX Service URL.
For example:
service:jmx:rmi:///jndi/rmi://localhost:8686/jmxrmi
The JMX Service URL is emitted by the server at startup, looking something like this:
[#|2009-12-03T10:25:17.737-0800|INFO|glassfishv3.0|
javax.enterprise.system.tools.admin.org.glassfish.server|_ThreadID=20;
_ThreadName=Thread-26;|JMXStartupService: Started JMXConnector, JMXService
URL = service:jmx:rmi://localhost:8686/jndi/rmi://localhost:8686/jmxrmi|#]
However, in most cases, simply entering host:port is fine, such as, 192.168.1.150:8686. The
long Service URL is not needed.
Note – Another host name can be substituted for localhost. The default port number (8686)
could change if the jmx-connector configuration has been modified.
6 Click Connect.
In the JConsole window you will see all your MBeans, JVM information, and so on, in various
tabs. Most of the useful MBeans are to be found in the amx and java.lang domains.
This chapter provides procedures for administering life cycle modules in the Sun
GlassFishTMEnterprise Server v3 environment.
Instructions for accomplishing the tasks in this chapter by using the Administration Console
are contained in the Administration Console online help.
A life cycle module listens for and performs its tasks in response to the following Enterprise
Server sequence of events:
1. Initialization. The server reads the configuration, initializes built-in subsystems (such as
security and logging services), and creates the containers.
2. Startup. The server loads and initializes deployed applications.
3. Ready. The server begins servicing requests.
4. Shutdown. The server shuts down the applications and stops.
167
Configuring Life Cycle Modules
5. Termination. The server closes the containers, the built-in subsystems, and the server
runtime environment.
These events are defined in the LifecycleEvent class. For information on creating life cycle
modules, see Chapter 13, “Developing Lifecycle Listeners,” in Sun GlassFish Enterprise Server v3
Application Development Guide.
Note – If the is-failure-fatal setting is set to true (the default is false), life cycle module
failure prevents server initialization or startup, but not shutdown or termination.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
create-lifecycle-module at the command line.
asadmin> list-lifecycle-modules
WSTCPConnectorLCModule
Command list-lifecycle-modules executed successfully
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
list-lifecycle-modules at the command line.
1 List the properties that can be updated for a life cycle module by using the get(1) subcommand.
For example (single mode):
asadmin get "*" | grep sampleLCM
applications.application.sampleLCMmodule.availability-enabled=false
applications.application.sampleLCMmodule.directory-deployed=false
applications.application.sampleLCMmodule.enabled=true
applications.application.sampleLCMmodule.name=sampleLCMmodule
applications.application.sampleLCMmodule.object-type=user
applications.application.sampleLCMmodule.property.class-name=example.lc.SampleModule
applications.application.sampleLCMmodule.property.classpath=/build/lcm.jar
applications.application.sampleLCMmodule.property.is-failure-fatal=false
applications.application.sampleLCMmodule.property.isLifecycle=true
See Also You can also view the full syntax and options of the subcommand by typing asadmin help set
at the command line.
2 List the current life cycle modules by using the list-lifecycle-modules(1) subcommand.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
delete-lifecycle-module at the command line.
This chapter provides procedures for performing tasks associated with extending and updating
the deployed Sun GlassFishTMEnterprise Server v3 by using Update Tool. Procedures for using
the pkg command are contained in this chapter. A set of reference pages that contain details on
using the pkg command is included with Enterprise Server.
Instructions for accomplishing the tasks in this chapter by using the Administration Console
are contained in the Administration Console online help for Update Tool. The standalone
Update Tool also contains online help. For additional information about Update Tool, see
http://wikis.sun.com/display/IpsBestPractices/Screenshots
Over time, new add-on components will be developed and existing components will be
modified. Enterprise Server provides a set of image packaging system (IPS) tools for updating
software on a deployed server. You can install new or updated add-on components by using the
Update Tool in the following ways:
■ As a selection in the graphical Enterprise Server Administration Console
171
Adding Components
■ As a standalone graphical tool which can be started from the command line using the
following format: as-install-parent/bin/updatetool
■ As a command-line utility (the pkg command) which can perform most of the tasks offered
by the graphical Update Tool. The main reasons for using the pkg command are:
■ As a basis for creating update scripts
■ As a method for working with systems that do not have a monitor, graphic card, or
keyboard (headless systems)
Adding Components
This section provides instructions for using the pkg command to install Enterprise Server
add-on components on your deployed Enterprise Server.
Note – If the pkg component, the updatetool component, or any other valid component that
you try to invoke from the command line is not yet installed on your deployed Enterprise
Server, you will receive a query asking if you want to install the component. Answer Y to install
the component.
Before You Begin Enterprise Server v3 must be fully deployed before you can install additional components. If
you need installation instructions, see Sun GlassFish Enterprise Server v3 Installation Guide.
PHASE ACTIONS
Install Phase 222/222
See Also Full syntax and options for using the pkg command are described in the pages in the
as-install/pkg/man/ directory. These reference pages are not displayed by using the man
command. Instead, use a command such as more or cat.
1 Obtain a list of only the installed packages that have available updates:
pkg list -u
Information similar to the following is displayed:
PHASE ACTIONS
Removal Phase 2/2
Update Phase 7/7
Install Phase 2/2
See Also Full syntax and options for using the pkg command are described in the pages in the as-install
/pkg/man/ directory. These reference pages are not displayed by using the man command.
Instead, use a command such as more or cat.
PHASE ACTIONS
See Also Full syntax and options for using the pkg command are described in the pages in the as-install
/pkg/man/ directory. These reference pages are not displayed by using the man command.
Instead, use a command such as more or cat.
2 Uninstall the component that you want removed from your system.
Use the following syntax: pkg uninstall package-name. For example:
pkg uninstall jruby
See Also Full syntax and options for using the pkg command are described in the pages in the as-install
/pkg/man/ directory. These reference pages are not displayed by using the man command.
Instead, use a command such as more or cat.
Before You Begin Be sure to verify that the older version of the component is in the repository before you
uninstall your current version.
See Also Full syntax and options for using the pkg command are contained in the pages in the as-install
/pkg/man/ directory. These reference pages are not displayed by using the man command.
Instead, use a command such as more or cat.
Security Administration
179
180
11
C H A P T E R 1 1
Instructions for accomplishing many of these tasks by using the Administration Console are
contained in the Administration Console online help.
181
About System Security in Enterprise Server
Authentication
Authentication is the way in which an entity (a user, an application, or a component)
determines that another entity is who it claims to be. An entity uses security credentials to
authenticate itself. The credentials might be a user name and password, a digital certificate, or
something else. Usually, servers or applications require clients to authenticate themselves.
Additionally, clients might require servers to authenticate themselves. When authentication is
bidirectional, it is called mutual authentication.
When an entity tries to access a protected resource, Enterprise Server uses the authentication
mechanism configured for that resource to determine whether to grant access. For example, a
user can enter a user name and password in a web browser, and if the application verifies those
credentials, the user is authenticated. The user is associated with this authenticated security
identity for the remainder of the session.
Authentication Types
Within its deployment descriptors, an application specifies the type of authentication that it
uses. Enterprise Server supports the following types of authentication:
BASIC Uses the server's built-in login dialog box. The communication protocol is
HTTP (SSL optional). There is no user-credentialed encryption unless
using SSL.
FORM The application provides its own custom login and error pages. The
communication protocol is HTTP (SSL optional). There is no
user-credentialed encryption unless using SSL.
CLIENT-CERT The server authenticates the client using a public key certificate. The
communication protocol is HTTPS (HTTP over SSL). User-credentialed
encryption is SSL.
DIGEST The server authenticates a user based on a user name and a password. The
authentication is performed by transmitting the password in an encrypted
form which is much more secure than the simple Base64 encoding used by
BASIC authentication. The communication protocol is HTTPS.
Passwords
Passwords are your first line of defense against unauthorized access to the components and data
of Enterprise Server. For Information about how to use passwords for Enterprise Server, see
“Administering Passwords” on page 190.
The master password is the password for the secure keystore. When a new application server
domain is created, a new self-signed certificate is generated and stored in the relevant keystore,
which is locked using the master password (default password changeit). If the master password
is not the default (that is, you have changed it), you are prompted for the master password. After
the correct master password is entered, the domain starts.
Administration Password
The administration password, also known as the admin password, is used to invoke the
Administration Console and the asadmin utility. This password is usually set during
installation, but it can be changed. For instructions, see “To Change the Administration
Password” on page 192.
Encoded Passwords
Files that contain encoded passwords need to be protected using file system permissions. These
files include the following:
■ domain-dir/master-password
This file contains the encoded master password and should be protected with file system
permissions 600.
■ Any password file created to pass as an argument by using the --passwordfile argument to
the asadmin utility should be protected with file system permissions 600.
For instructions, see “To Set a Password From a File” on page 193.
Password Aliases
To avoid storing passwords in the domain configuration file in clear text, you can create an alias
for a password. This process is also known as encrypting a password. For more information, see
“Administering Password Aliases” on page 193.
Single Sign-on
With single sign-on, a user who logs in to one application becomes implicitly logged in to other
applications that require the same authentication information. Single sign-on is based on
groups. All web applications whose deployment descriptor defines the same group and uses the
same authentication method (BASIC, FORM, or CLIENT-CERT) share single sign-on.
On Enterprise Server, single sign-on is enabled by default for virtual servers, allowing multiple
applications in one virtual server to share the user authentication state.
Authorization
Authorization, also known as access control, is the means by which users are granted
permission to access data or perform operations. After a user is authenticated, the user's level of
authorization determines what operations the owner can perform. A user's authorization is
based on the user's role.
Roles
A role defines which applications and what parts of each application users can access and what
those users or groups can do with the applications. For example, in a personnel application, all
employees might be able to see phone numbers and email addresses, but only managers have
access to salary information. This application would define at least two roles: employee and
manager. Only users in the manager role are allowed to view salary information.
A role is different from a group in that a role defines a function in an application, while a group
is a set of users who are related in some way. For example, the personnel application specify
groups such as full-time, part-time, and on-leave. Users in these groups are all employees
(the employee role). In addition, each user has its own designation that defines an additional
level of employment.
Roles are defined in the deployment descriptor for the application. The application developer or
deployer maps roles to one or more groups in the deployment descriptor for each application.
When the application is being packaged and deployed, the application specifies mappings
between users, groups, and roles, as illustrated in the following figure.
JACC providers use the Java Authentication and Authorization Service (JAAS) APIs. JAAS
enables services to authenticate and enforce access controls upon users. JAAS implements a
Java technology version of the standard Pluggable Authentication Module (PAM) framework.
JSR 196 allows you to develop plugins at different layers. You can define plugins that change the
way new authentication mechanism are configured, such as, AuthConfigProvider and
AuthConfigFactory. You can also define new authentication mechanisms, such as
ServerAuthModule and ClientAuthModule.
Auditing
Auditing is the means used to capture security-related events for the purpose of evaluating the
effectiveness of security measures. Enterprise Server uses audit modules to capture audit trails
of all authentication and authorization decisions. Enterprise Server provides a default audit
module, as well as the ability to customize the audit modules.
Firewalls
A firewall controls the flow of data between two or more networks, and manages the links
between the networks. A firewall can consist of both hardware and software elements. The
following guidelines pertain primarily to Enterprise Server:
■ In general, firewalls should be configured so that clients can access the necessary TCP/IP
ports.
For example, if the HTTP listener is operating on port 8080, configure the firewall to allow
HTTP requests on port 8080 only. Likewise, if HTTPS requests are set up for port 8081, you
must configure the firewalls to allow HTTPS requests on port 8081.
■ If direct Remote Method Invocations over Internet Inter-ORB Protocol (RMI-IIOP) access
from the Internet to EJB modules is required, open the RMI-IIOP listener port as well.
Note – Opening the RMI-IIOP listener port is strongly discouraged because it creates
security risks.
■ In double firewall architecture, you must configure the outer firewall to allow for HTTP and
HTTPS transactions. You must configure the inner firewall to allow the HTTP server
plug-in to communicate with Enterprise Server behind the firewall.
Certificates
Certificates, also called digital certificates, are electronic files that uniquely identify people and
resources on the Internet. Certificates also enable secure, confidential communication between
two entities. There are different kinds of certificates:
■ Personal certificates are used by individuals.
■ Server certificates are used to establish secure sessions between the server and clients
through secure sockets layer (SSL) technology.
Certificates are based on public key cryptography, which uses pairs of digital keys (very long
numbers) to encrypt, or encode, information so the information can be read only by its
intended recipient. The recipient then decrypts (decodes) the information to read it. A key pair
contains a public key and a private key. The owner distributes the public key and makes it
available to anyone. But the owner never distributes the private key, which is always kept secret.
Because the keys are mathematically related, data encrypted with one key can only be decrypted
with the other key in the pair.
Certificates are issued by a trusted third party called a Certification Authority (CA). The CA is
analogous to a passport office: it validates the certificate holder's identity and signs the
certificate so that it cannot be forged or tampered with. After a CA has signed a certificate, the
holder can present it as proof of identity and to establish encrypted, confidential
communications. Most importantly, a certificate binds the owner's public key to the owner's
identity.
In addition to the public key, a certificate typically includes information such as the following:
■ The name of the holder and other identification, such as the URL of the web server using the
certificate, or an individual's email address
■ The name of the CA that issued the certificate
■ An expiration date
Certificates are governed by the technical specifications of the X.509 format. To verify the
identity of a user in the certificate realm, the authentication service verifies an X.509
certificate, using the common name field of the X.509 certificate as the principal name.
Certificate Chains
A certificate chain is a series of certificates issued by successive CA certificates, eventually
ending in a root CA certificate.
Web browsers are preconfigured with a set of root CA certificates that the browser
automatically trusts. Any certificates from elsewhere must come with a certificate chain to
verify their validity.
In other cases, the CA can return a chain of certificates. In this situation, the bottom certificate
in the chain is the same (a certificate signed by the CA, authenticating the public key of the key
entry), but the second certificate in the chain is a certificate signed by a different CA,
authenticating the public key of the CA to which you sent the CSR. Then, the next certificate in
the chain is a certificate authenticating the second CA's key, and so on, until a self-signed root
certificate is reached. Each certificate in the chain (after the first) thus authenticates the public
key of the signer of the previous certificate in the chain.
Certificate Files
During Enterprise Server installation, a certificate is generated in Java Secure Socket Extension
(JSSE) format suitable for internal testing. By default, Enterprise Server stores its certificate
information in certificate databases in the domain-dir/config directory:
Keystore file The key3.db file contains Enterprise Server certificate, including its private
key. The keystore file is protected with a password.
Each keystore entry has a unique alias. After installation, the Enterprise
Server keystore has a single entry with an alias of s1as.
Truststore file The cert8.db file contains the Enterprise Server trusted certificates,
including public keys for other entities. For a trusted certificate, the server
has confirmed that the public key in the certificate belongs to the certificate's
owner. Trusted certificates generally include those of CAs.
By default, Enterprise Server is configured with a keystore and truststore that will work with the
example applications and for development purposes.
When a Web browser (client) wants to connect to a secure site, an SSL handshake happens, like
this:
1. The browser sends a message over the network requesting a secure session (typically, by
requesting a URL that begins with https instead of http).
2. The server responds by sending its certificate (including its public key).
3. The browser verifies that the server's certificate is valid and is signed by a CA whose
certificate is in the browser's database (and who is trusted). It also verifies that the CA
certificate has not expired.
4. If the certificate is valid, the browser generates a one time, unique session key and encrypts it
with the server's public key. The browser then sends the encrypted session key to the server
so that they both have a copy.
5. The server decrypts the message using its private key and recovers the session key.
After the handshake, the client has verified the identity of the Web site, and only the client and
the Web server have a copy of the session key. From this point forward, the client and the server
use the session key to encrypt all their communications with each other. Thus, their
communications are ensured to be secure.
The newest version of the SSL standard is called Transport Layer Security (TLS). The Enterprise
Server supports the SSL 3.0 and the TLS 1.0 encryption protocols.
To use SSL, Enterprise Server must have a certificate for each external interface or IP address
that accepts secure connections. The HTTPS service of most web servers will not run unless a
certificate has been installed. For instructions on applying SSL to HTTP listeners, see “To
Configure an HTTP Listener for SSL” on page 284.
Ciphers
A cipher is a cryptographic algorithm used for encryption or decryption. SSL and TLS protocols
support a variety of ciphers used to authenticate the server and client to each other, transmit
certificates, and establish session keys.
Some ciphers are stronger and more secure than others. Clients and servers can support
different cipher suites. During a secure connection, the client and the server agree to use the
strongest cipher that they both have enabled for communication, so it is usually sufficient to
enable all ciphers.
If all virtual hosts on a single IP address need to authenticate against the same certificate, the
addition of multiple virtual hosts probably will not interfere with normal SSL operations on the
server. Be aware, however, that most browsers will compare the server's domain name against
the domain name listed in the certificate, if any (applicable primarily to official, CA-signed
certificates). If the domain names do not match, these browsers display a warning. In general,
only address-based virtual hosts are commonly used with SSL in a production environment.
The keytool utility The keytool Java 2 Platform, Standard Edition (J2SE)
command-line utility is used for managing digital certificates and
key pairs. For more information, see “Administering JSSE
Certificates ” on page 199.
The policytool utility The policytool J2SE graphical utility is used for managing
system-wide Java security policies. As an administrator, you rarely
use policytool.
For more information about using keytool, policytool, and other Java security tools, see Java
2 SDK Tools and Utilities at http://java.sun.com/j2se/1.4.2/docs/tooldocs/
tools.html#security.
Administering Passwords
There are multiple ways to administer passwords. You can rely on administrators to keep
passwords secret and change the passwords regularly. You can set up files for storing passwords
so that asadmin subcommands can access these files rather than having users type the
commands. You can encrypt passwords by setting up aliases so that sensitive passwords are not
visible in the domain.xml file.
You can choose to type the password manually when required, or to obscure the password in a
password file. If there is no password file, you are prompted for the master password. If there is a
password file, but you want to change access to require prompting, remove the file. The default
master password is changeit.
Use the change-master-password subcommand in local mode to modify the master password.
When the master password is changed, it is re-saved in the master-password keystore, which is
a Java JCEKS type keystore.
Before You Begin This subcommand will not work unless the domain is stopped.
2 Change the master password for the domain by using the change-master-password(1)
subcommand.
You are prompted for the old and new passwords. All dependent items are re-encrypted.
If you have already logged into the domain using the login login(1) subcommand, you are
prompted for the new master password:
If you are not logged into the domain, you are prompted for both the old and the new master
passwords:
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
change-master-password at the command line.
Note – If you accepted the default admin user with no password during zip installation, you can
add a password to this user. If there is a single user called admin that does not have a password,
you are not prompted for login information. Any other situation requires login.
Before You Begin If you want to change the admin password before creating an alias for the password
(encrypting), you can use the set subcommand with syntax similar to the following:
You are prompted to enter the old and the new admin passwords:
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
change-admin-password at the command line.
AS_ADMIN_MASTERPASSWORD
AS_ADMIN_USERPASSWORD
AS_ADMIN_ALIASPASSWORD
Troubleshooting If AS_ADMIN_PASSWORD has been exported to the global environment, specifying the
--passwordfile option will produce a warning about using the --passwordfile option. To
prevent this warning situation from happening, unset AS_ADMIN_PASSWORD.
You can also use the set(1) subcommand to remove and replace the password in the
configuration file. For example:
7 Start the domain specifying the file that contains the alias.
Use the following syntax:
start-domain --user admin --passwordfile /path-to/passwords.txt domain1
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
create-password-alias at the command line.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
list-password-aliases at the command line.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
delete-password-alias at the command line.
You are prompted to type the new password for the alias:
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
update-password-alias at the command line.
asadmin> create-audit-module
--classname com.sun.appserv.auditmodule --property defaultuser=
admin:Password=admin sampleAuditModule
Command create-audit-module executed successfully.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
create-audit-module at the command line.
asadmin> list-audit-modules
audit-module : default
audit-module : sampleAuditModule
Command list-audit-modules executed successfully.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
list-audit-modules at the command line.
The J2SE SDK ships with the keytool utility, which enables you to set up and work with Java
Secure Socket Extension (JSSE) digital certificates. You can administer public/private key pairs
and associated certificates, and cache the public keys (in the form of certificates) of their
communicating peers.
Before You Begin To run the keytool utility, your shell environment must be configured so that the J2SE /bin
directory is in the path, otherwise the full path to the utility must be present on the command
line.
1 Change to the directory that contains the keystore and truststore files.
Always generate the certificate in the directory containing the keystore and truststore files. The
default is domain-dir/config.
2 Generate the certificate in the keystore file, keystore.jks, using the following command
format:
keytool -genkey -alias keyAlias-keyalg RSA
-keypass changeit
-storepass changeit
keystore keystore.jks
Use any unique name as your keyAlias. If you have changed the keystore or private key
password from the default (changeit), substitute the new password for changeit. The default
key password alias is s1as.
A prompt appears that asks for your name, organization, and other information.
3 Export the generated certificate to the server.cer file (or client.cer if you prefer), using the
following command format:
keytool -export -alias keyAlias-storepass changeit
-file server.cer
-keystore keystore.jks
4 If a certificate signed by a certificate authority is required, see “To Sign a Certificate by Using
keytool”on page 201.
5 Create the cacerts.jks truststore file and add the certificate to the truststore, using the
following command format:
keytool -import -v -trustcacerts
-alias keyAlias
-file server.cer
-keystore cacerts.jks
-keypass changeit
If you have changed the keystore or private key password from the default (changeit),
substitute the new password.
Information about the certificate is displayed and a prompt appears asking if you want to trust
the certificate.
7 To apply your changes, restart Enterprise Server. See “To Restart a Domain”on page 90.
Example 11–10 Creating a Self-Signed Certificate in a JKS Keystore by Using an RSA Key Algorithm
RSA is public-key encryption technology developed by RSA Data Security, Inc.
Example 11–11 Creating a Self-Signed Certificate in a JKS Keystore by Using a Default Key Algorithm
keytool -genkey -noprompt -trustcacerts -alias ${cert.alias} -dname
${dn.name} -keypass ${key.pass} -keystore ${keystore.file} -storepass
${keystore.pass}
See Also For more information about keytool, see the keytool documentation at
http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/keytool.html.
Note – If authentication is not a concern, for example if private secure communications are all
that is required, you can save the time and expense involved in obtaining a CA certificate by
using a self-signed certificate.
1 Follow the instructions on the CA's web site for generating certificate key pairs.
4 Import the certificate into the local keystore and, if necessary, the local truststore using the
following command format:
keytool -import -v -trustcacerts
-alias keyAlias
-file server.cer
-keystore cacerts.jks
-keypass changeit
-storepass changeit
If the keystore or private key password is not the default password, then substitute the new
password for the default (changeit).
5 To apply your changes, restart Enterprise Server. See “To Restart a Domain”on page 90.
See Also For more information about keytool, see the keytool documentation at
http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/keytool.html
See Also For more information about keytool, see the keytool documentation at
http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/keytool.html.
This chapter provides instructions for administering user security in the Sun GlassFishTM
Enterprise Server environment by using the asadmin command-line utility. Enterprise Server
enforces its authentication and authorization policies upon realms, users, and groups. This
chapter assumes that you are familiar with security features such as authentication,
authorization, and certificates. If you are not, see Chapter 11, “Administering System Security.”
Instructions for accomplishing these tasks by using the Administration Console are contained
in the Administration Console online help.
205
Administering Authentication Realms
LDAP realm Enterprise Server gets user credentials from a Lightweight Directory
Access Protocol (LDAP) server such as the Directory Server. LDAP is
a protocol for enabling anyone to locate organizations, individuals,
and other resources such as files and devices in a network, whether
on the public Internet or on a corporate intranet. Consult your
LDAP server documentation for information about managing users
and groups in the LDAP realm.
JDBC realm Enterprise Server gets user credentials from a database. The server
uses the database information and the enabled JDBC realm option in
the configuration file.
Digest realm Digest Authentication authenticates a user based on a user name and
a password. However, the authentication is performed by
transmitting the password in an encrypted form.
Solaris realm Enterprise Server gets user credentials from the Solaris operating
system. This realm is supported on the Solaris 9 and Solaris 10
operating systems. Consult your Solaris documentation for
information about managing users and groups in the Solaris realm.
Custom realm You can create other repositories for user credentials, such as a
relational database or third-party components. For more
information about custom realms, see the Administration Console
online help. For instructions on creating a custom realm, see
“Creating a Custom Realm” in Sun GlassFish Enterprise Server v3
Application Development Guide.
The Enterprise Server authentication service can govern users in multiple realms.
The following tasks and information are used to administer authentication realms:
■ “To Create an Authentication Realm” on page 206
■ “To List Authentication Realms” on page 207
■ “To Update an Authentication Realm” on page 208
■ “To Delete an Authentication Realm” on page 208
■ “To Configure a JDBC or Digest Authentication Realm” on page 209
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
create-auth-realm at the command line.
For information on creating a custom realm, see “Creating a Custom Realm” in Sun GlassFish
Enterprise Server v3 Application Development Guide.
asadmin> list-auth-realms
db
certificate
file
admin-realm
Command list-auth-realms executed successfully.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
list-auth-realms at the command line.
2 Modify the values for the specified thread pool by using the set(1) subcommand.
The thread pool is identified by its dotted name.
5 To apply your changes, restart Enterprise Server. See “To Restart a Domain”on page 90.
asadmin> delete-auth-realm db
Command delete-auth-realm executed successfully.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
delete-auth-realm at the command line.
Note – By default, storage of passwords as clear text is not supported in the JDBC realm. Under
normal circumstances, passwords should not be stored as clear text.
1 Create the database tables in which to store user credentials for the realm.
How you create the database tables depends on the database that you are using.
5 Create a realm.
For instructions, see “To Create an Authentication Realm” on page 206.
Note – The JAAS context should be jdbcDigestRealm for digest authentication or jdbcRealm
for other authentication types.
■ For a web application in a Web Application Archive (WAR) file, modify the web.xml file.
■ For an enterprise bean in an EJB JAR file, modify the sun-ejb-jar.xml file.
For more information about how to specify a realm, see “How to Configure a Realm” in Sun
GlassFish Enterprise Server v3 Application Development Guide.
<security-role-mapping>
<role-name>Employee</role-name>
<principal-name>Calvin</principal-name>
</security-role-mapping>
As the administrator, you are responsible for integrating users into the Enterprise Server
environment so that their credentials are securely established and they are provided with access
to the applications and services that they are entitled to use.
Creating a new file realm user is a dynamic event and does not require server restart.
2 If the user will belong to a particular group, see the current groups by using the
list-file-groups(1) subcommand.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
create-file-user at the command line.
asadmin> list-file-users
Jennifer
Command list-file-users executed successfully.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
list-file-users at the command line.
A group is different from a role in that a role defines a function in an application, while a group
is a set of users who are related in some way. For example, in the personnel application there
might be groups such as full-time, part-time, and on-leave. Users in these groups are all
employees (the employee role). In addition, each user has its own designation that defines an
additional level of employment.
Use the list-file-groups subcommand in remote mode to list groups for a file user, or all file
groups if the --name option is not specified.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
update-file-user at the command line.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
delete-file-user at the command line.
This chapter provides information and procedures on configuring the message layer security
for web services in the Sun GlassFishTM Enterprise Server environment.
Note – Message security (JSR 196) is supported only in the Full Platform Profile of Enterprise
Server, not in the Web Profile.
215
About Message Security in Enterprise Server
Web services deployed on Enterprise Server are secured by binding SOAP layer message
security providers and message protection policies to the containers in which the applications
are deployed, or to web service endpoints served by the applications. SOAP layer message
security functionality is configured in the client-side containers of Enterprise Server by binding
SOAP layer message security providers and message protection policies to the client containers
or to the portable service references declared by client applications.
Message-level security can be configured for the entire Enterprise Server or for specific
applications or methods. Configuring message security at the application level is discussed in
the Sun GlassFish Enterprise Server v3 Application Development Guide.
■ Encryption. The purpose of encryption is to modify the data so that it can only be
understood by its intended audience. This is accomplished by substituting an encrypted
element for the original content. When based on public key cryptography, encryption can
be used to establish the identity of the parties who are authorized to read a message.
When using encryption, a Java Cryptography Extension (JCE) provider that supports
encryption must be installed.
Authentication Providers
The authentication layer is the message layer on which authentication processing must be
performed. Enterprise Server enforces web services message security at the SOAP layer. The
types of authentication that are supported include the following:
■ Sender authentication, including username-password authentication
■ Content authentication, including XML digital signatures
Enterprise Server invokes authentication providers to process SOAP message layer security. The
message security providers provide information such as the type of authentication that is
required for the request and response messages. The following message security providers are
included with Enterprise Server:
■ Client-side Provider. A client-side provider establishes (by signature or
username/password) the source identity of request messages and/or protects (by
encryption) request messages such that they can only be viewed by their intended recipients.
A client-side provider also establishes its container as an authorized recipient of a received
response (by successfully decrypting it) and validates passwords or signatures in the
response to authenticate the source identity associated with the response. Client-side
providers configured in Enterprise Server can be used to protect the request messages sent
and the response messages received by server-side components (servlets and EJB
components) acting as clients of other services.
The default client provider is used to identify the client—side provider to be invoked for any
application for which a specific client provider has not been bound.
■ Server-side Provider. A server-side provider establishes its container as an authorized
recipient of a received request (by successfully decrypting it), and validates passwords or
signatures in the request to authenticate the source identity associated with the request. A
server-side provider also establishes (by signature or username/password) the source
identity of response messages and/or protects (by encryption) response messages such that
they can only be viewed by their intended recipients. Server-side providers are only invoked
by server-side containers.
The default server provider is used to identify the server—side provider to be invoked for any
application for which a specific server provider has not been bound.
Message protection policies are defined for request message processing and response message
processing. The policies are expressed in terms of requirements for source and/or recipient
authentication. The providers apply specific message security mechanisms to cause the message
protection policies to be realized in the context of SOAP web services messages.
■ Source Authentication Policy. A source authentication policy represents a requirement
that the identity of the entity that sent a message or that defined the content of a message be
established in the message such that it can be authenticated by the message receiver.
■ Recipient Authentication Policy. A recipient authentication policy represents a
requirement that the message be sent such that the identity of the entities that can receive
the message can be established by the message sender.
Request and response message protection policies are defined when a security provider is
configured into a container. Application-specific message protection policies (at the granularity
of the web service port or operation) can also be configured within the Sun-specific deployment
descriptors of the application or application client. In any situation where message protection
policies are defined, the request and response message protection policies of the client must be
equivalent t) the request and response message protection policies of the server. For more
information about defining application-specific message protection policies, see Chapter 5,
“Securing Applications,” in Sun GlassFish Enterprise Server v3 Application Development Guide
For information about defining application-specific message protection policies, see Chapter 5,
“Securing Applications,” in Sun GlassFish Enterprise Server v3 Application Development Guide.
Analogous administrative operations can be performed on the SOAP message layer security
configuration of the application client container. If you want web services security to protect all
web services applications deployed on Enterprise Server. See “Enabling Message Security for
Application Clients” on page 228.
By default, message layer security is disabled on Enterprise Server. To configure message layer
security for the Enterprise Server see “Enabling Default Message Security Providers for Web
Services” on page 221.
In most cases, you must restart Enterprise Server after performing administrative tasks. This is
especially true if you want the effects of the administrative change to be applied to applications
that were already deployed on Enterprise Server at the time the operation was performed.
System Administrator
The system administrator is responsible for the following message security tasks:
■ Administering server security settings and certificate databases
■ Administering keystore and truststore files
■ Configuring message security providers on Enterprise Server
■ Turning on message security
■ (If needed) Installing the samples server
Application Deployer
The application deployer is responsible for the following message security tasks:
■ Specifying (at application reassembly) any required application-specific message protection
policies if such policies have not already been specified by the developer/assembler.
■ Modifying Sun-specific deployment descriptors to specify application-specific message
protection policies information (message-security-binding elements) to web service
endpoint and service references.
Application Developer/Assembler
The application developer/assembler is responsible for the following message security tasks:
■ Determining if an application-specific message protection policy is required by the
application
If so, the developer ensures that the required policy is specified at application assembly time.
■ Specifying how web services should be set up for message security
Message security can be set up by the administrator so that all web services are secured, or by
the application deployer when the security provider or protection policy bound to the
application must be different from that bound to the container.
■ Turning on message security if authorized to do so by the administrator
interface defines a single operation, sayHello, which takes a string argument, and returns a
String composed by pre-pending Hello to the invocation argument.
The xms sample application is provided to demonstrate the use of Enterprise Server
WS-Security functionality to secure an existing web services application. The instructions
which accompany the sample describe how to enable the WS-Security functionality of
Enterprise Server such that it is used to secure the xms application. The sample also
demonstrates the binding of WS-Security functionality directly to the application as described
in “Application-Specific Web Services Security” on page 218 application.
For information about compiling, packaging, and running the xms sample application, Chapter
5, “Securing Applications,” in Sun GlassFish Enterprise Server v3 Application Development
Guide.
2 To apply your changes to applications that are already running, restart Enterprise Server.
See “To Restart a Domain” on page 90.
2 To apply your changes to applications that are already running, restart Enterprise Server.
See “To Restart a Domain” on page 90.
TABLE 13–1 Message Protection Policy Mapping to WS-Security SOAP Operations (Continued)
Message Protection Policy Resulting WS-Security SOAP message protection operations
Use the set(1) subcommand to set the response policy, then replace the word request in the
following commands with the word response.
1 Add a request policy to the client and set the authentication source by using the set(1)
subcommand.
For example:
asadmin> set server-config.security-service.message-security-config.SOAP.
provider-config.ClientProvider.request-policy.auth_source=[sender | content]
2 Add a request policy to the server and set the authentication source by using the set
subcommand.
For example:
asadmin> set server-config.security-service.message-security-config.SOAP.
provider-config.ServerProvider.request-policy.auth_source=[sender | content]
3 Add a request policy to the client and set the authentication recipient by using the set
subcommand:
For example:
asadmin> set server-config.security-service.message-security-config.SOAP.
provider-config.ClientProvider.request-policy.auth_recipient=[before-content | after-content]
4 Add a request policy to the server and set the authentication recipient by using the set
subcommand:
For example:
asadmin> set server-config.security-service.message-security-config.SOAP.
provider-config.ServerProvider.request-policy.auth_recipient=[before-content | after-content]
expressed in message sender order such that a requirement that encryption occur after content
would mean that the message receiver would expect to decrypt the message before validating
the signature.
To achieve message security, the request and response policies must be enabled on both the
server and client. When configuring the policies on the client and server, make sure that the
client policy matches the server policy for request/response protection at application-level
message binding.
To set the request policy for the application client configuration, modify the Enterprise
Server–specific configuration for the application client container as described in “Enabling
Message Security for Application Clients” on page 228.
<client-container>
<target-server name="your-host" address="your-host"
port="your-port"/>
<log-service file="" level="WARNING"/>
<message-security-config auth-layer="SOAP"
default-client-provider="ClientProvider">
<provider-config
class-name="com.sun.enterprise.security.jauth.ClientAuthModule"
provider-id="ClientProvider" provider-type="client">
<request-policy auth-source="sender | content"
auth-recipient="after-content | before-content"/>
<response-policy auth-source="sender | content"
auth-recipient="after-content | before-content"/>
<property name="security.config"
value="as-install/lib/appclient/wss-client-config.xml"/>
</provider-config>
</message-security-config>
</client-container>
Valid values for auth-source include sender and content. Valid values for auth-recipient
include before-content and after-content. A table describing the results of various
combinations of these values can be found in “Configuring Message Protection Policies” on
page 222.
To not specify a request or response policy, leave the element blank, for example:
<response-policy/>
asadmin> create-message-security-provider
--classname com.sun.enterprise.security.jauth.ClientAuthModule
--providertype client mySecurityProvider
Command create-message-security-provider executed successfully.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
create–message–security–provider at the command line.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
list–message–security–providers at the command line.
3 Modify the values for the specified message security provider by using the set(1) subcommand.
The message security provider is identified by its dotted name.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
delete–message–security–provider at the command line.
To enable message security for client applications, modify the Enterprise Server specific
configuration for the application client container. The process is analogous to the process in
“Configuring Message Protection Policies” on page 222.
229
230
14
C H A P T E R 1 4
This chapter provides procedures for performing database connectivity tasks in the Sun
GlassFishTM Enterprise Server v3 environment by using the asadmin command-line utility.
Instructions for accomplishing these tasks by using the Administration Console are contained
in the Administration Console online help.
231
Setting Up the Database
■ JDBC Resource. A JDBC resource (data source) provides applications with a means of
connecting to a database. To create a JDBC resource, specify the connection pool with
which it is associated. Multiple JDBC resources can specify a single connection pool. A
JDBC resource is identified by its Java Naming and Directory Interface (JNDI) name. For
administration procedures, see “Administering JDBC Resources” on page 240.
■ JDBC Driver. A database driver is a software component that enables a Java application to
interact with a database connectivity API . Each database requires its own driver. For
administration procedures, see “Integrating the JDBC Driver” on page 242.
3 Make the JDBC driver JAR file accessible to the domain administration server (DAS).
See “Integrating the JDBC Driver” on page 242.
Next Steps You are now ready to create a connection pool for the database, and a JDBC resource that
points to the connection pool. See “To Create a JDBC Connection Pool” on page 236 and “To
Create a JDBC Resource” on page 240. The final step is to integrate the JDBC driver into an
administrative domain as described in “Integrating the JDBC Driver” on page 242.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
start-database at the command line.
Troubleshooting For a laptop that roams between networks, you might have trouble shutting down the database.
If you start Java DB and then change your IP address, you will not be able to stop Java DB unless
you add a specific --dbhost argument. For example, if you run asadmin start-database
--dbhost = 0.0.0.0, and then disconnect Ethernet and switch to wifi, you should run a
command similar to the following to stop the database:
asadmin stop-database --dbhost localhost
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
stop-database at the command line.
startNetworkServer,startNetworkServer.bat
Script to start the network server
stopNetworkServer,stopNetworkServer.bat
Script to stop the network server
ij,ij.bat
Interactive JDBC scripting tool
dblook,dblook.bat
Script to view all or part of the DDL for a database
sysinfo, sysinfo.bat
Script to display versioning information about the Java DB environment
NetworkServerControl,NetworkServerControl.bat
Script to execute commands on the NetworkServerControl API
1 Ensure that the JAVA_HOME environment variable specifies the directory where the JDK is
installed.
See Also For more information about these utilities, see the following documentation:
■ Derby Tools and Utilities Guide (http://db.apache.org/derby/docs/10.1/tools/)
■ Derby Server and Administration Guide (http://db.apache.org/derby/docs/10.1/
adminguide/)
Before You Begin Before creating the connection pool, you must first install and integrate the database and its
associated JDBC driver. For instructions, see “Setting Up the Database” on page 232.
asadmin> create-jdbc-connection-pool
--datasourceclassname org.apache.derby.jdbc.ClientDataSource
--restype javax.sql.XADataSource
--property portNumber=1527:password=APP:user=APP:serverName=
localhost:databaseName=sun-appserv-samples:connectionAttribut
es=\;create\\=true sample_derby_pool
Command create-jdbc-connection-pool executed successfully.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
create-jdbc-connection-pool at the command line.
asadmin> list-jdbc-connection-pools
sample_derby_pool2
poolA
__TimerPool
DerbyPool
sample_derby_pool
Command list-jdbc-connection-pools executed successfully.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
list-jdbc-connection-pools at the command line.
Before You Begin Before you can contact a connection pool, the connection pool must be created with
authentication, and the server or database must be running.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
ping-connection-pool at the command line.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
flush-connection-pool at the command line.
2 View the attributes of the JDBC connection pool by using the get subcommand.
For example:
asadmin get resources.jdbc-connection-pool.DerbyPool.property
3 Set the attribute of the JDBC connection pool by using the set subcommand.
For example:
asadmin set resources.jdbc-connection-pool.DerbyPool.steady-pool-size=9
Before You Begin Before deleting a JDBC connection pool, all associations to the resource must be removed.
3 If necessary, notify users that the JDBC connection pool is being deleted.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
delete-jdbc-connection-pool at the command line.
Before You Begin Before creating a JDBC resource, you must first create a JDBC connection pool. For
instructions, see “To Create a JDBC Connection Pool” on page 236.
3 If necessary, notify users that the new resource has been created.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
create-jdbc-resource at the command line.
asadmin> list-jdbc-resources
jdbc/__TimerPool
jdbc/DerbyPool
jdbc/__default
jdbc1
Command list-jdbc-resources executed successfully.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
list-jdbc-resources at the command line.
2 Modify the values for the specified JDBC resource by using the set(1) subcommand.
For example:
asadmin>set resources.jdbc-resource.res1.enabled=false
Before You Begin Before deleting a JDBC resource, all associations with this resource must be removed.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
delete-jdbc-resource at the command line.
To see the most current list of supported JDBC drivers, refer to the Sun GlassFish Enterprise
Server v3 Release Notes.
LD_LIBRARY_PATH=/usr/db2user/sqllib/lib:${Java EE.home}/lib
DB2DIR=/opt/IBM/db2/V8.2
DB2INSTANCE=db2user
INSTHOME=/usr/db2user
VWSPATH=/usr/db2user/sqllib
THREADS_FLAG=native
■ portNumber – Specify the port number of the database server if it is different from the
default.
■ databaseName – Specify the name of the database.
■ user - Specify the database user.
This is only necessary if Java DB is configured to use authentication. Java DB does not
use authentication by default. When the user is provided, it is the name of the schema
where the tables reside.
■ password – Specify the database password.
This is only necessary if Java DB is configured to use authentication.
■ Properties:
■ serverName – Specify the host name or IP address and the port of the database server.
■ portNumber – Specify the port number of the database server.
■ user – Set as appropriate.
■ password – Set as appropriate.
■ selectMethod – Set to cursor.
Note – To make the Oracle driver behave in a Java EE-compliant manner, you must set this
system property as true: oracle.jdbc.J2EE13Compliant=true.
■ Properties:
■ serverName – Specify the host name or IP address of the database server.
■ portNumber – Specify the port number of the database server.
■ user – Set as appropriate.
■ password – Set as appropriate.
Note – When using this driver, keep in mind that you cannot insert more than 2000 bytes of data
into a column. To circumvent this problem, use the OCI driver (JDBC type 2).
Note – To make the Oracle driver behave in a Java EE-compliant manner, you must set this
system property as true: oracle.jdbc.J2EE13Compliant=true.
Note – For the Oracle thin driver, the XAResource.recover method repeatedly returns the
same set of in-doubt Xids regardless of the input flag. According to the XA specifications,
the Transaction Manager initially calls this method with TMSTARTSCAN and then with
TMNOFLAGS repeatedly until no Xids are returned. The XAResource.commit method also has
some issues.
Note – An Oracle database user running the capture-schema command needs ANALYZE ANY
TABLE privileges if that user does not own the schema. These privileges are granted to the user
by the database administrator. For information about capture-schema, see Sun GlassFish
Enterprise Server v3 Reference Manual.
com.informix.jdbcx.IfxDataSource
com.informix.jdbcx.IfxXADataSource
For example:
jdbc:inetora:localhost:1521:payrolldb
In this example,localhost is the name of the host running the Oracle server, 1521 is the
Oracle server’s port number, and payrolldb is the SID of the database. For more
information about the syntax of the database URL, see the Oracle documentation.
■ streamstolob - If the size of BLOB or CLOB data types exceeds 4 KB and this driver is
used for CMP, this property must be set to true.
■ xa-driver-does-not-support-non-tx-operations - Set to the value true. Only
needed if both non-XA and XA connections are retrieved from the same connection
pool. Might degrade performance.
As an alternative to setting this property, you can create two connection pools, one for
non-XA connections and one for XA connections.
This chapter provides information and procedures for administering connections to enterprise
information system (EIS) data in the Sun GlassFishTM Enterprise Server v3 environment by
using the asadmin command-line utility.
Note – If you installed the Web Profile, connector modules that use only outbound
communication features and work-management that does not involve inbound
communication features are supported. Other connector features are supported only in the Full
Platform Profile.
Instructions for accomplishing the tasks in this chapter by using the Administration Console
are contained in the Administration Console online help.
For information about database connectivity, see Chapter 14, “Administering Database
Connectivity .”
253
About EIS Connectivity
Using the JNDI name of the connector resource, the naming and directory service locates
the resource. Each EIS resource specifies a connector connection pool.
2. Using the connector resource, the application gets an EIS connection.
Enterprise Server retrieves a physical connection from the connection pool that
corresponds to the EIS resource. The pool defines connection attributes such as the EIS
name, user name, and password.
3. After the EIS connection is established, the application can read, modify, and add data to the
EIS.
The application accesses the EIS information by making calls to the JMS API.
4. When the application is finished accessing the EIS, the application closes the connection
and returns the connection to the connection pool.
Before You Begin Before creating the connector connection pool, the connector must be installed.
4 (Optional) You can verify that a connection pool is usable by using the ping-connection-pool
subcommand.
For instructions, see “To Contact (Ping) a Connection Pool” on page 238.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
create-connector-connection-pool at the command line.
asadmin> list-connector-connection-pools
jms/qConnPool
Command list-connector-connection-pools executed successfully
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
list-connector-connection-pools at the command line.
2 View the properties of the connector connection pool by using the get(1) subcommand.
For example:
asadmin> get domain.resources.connector-connection-pool.conectionpoolname.*
3 Set the property of the connector connection pool by using the set(1) subcommand.
For example:
asadmin> set domain.resources.connector-connection-pool
.conectionpoolname.validate-atmost-once-period-in-seconds=3
3 If necessary, notify users that the connector connection pool is being deleted.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
delete-connector-connection-pool at the command line.
Creating a connector resource is a dynamic event and does not require server restart. However,
there are some parameters that do require server restart. See “Configuration Changes That
Require Server Restart” on page 37.
Before You Begin Before creating a connector resource, you must first create a connector connection pool. For
instructions, see “To Create a Connector Connection Pool” on page 255.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
create-connector-resource at the command line.
asadmin> list-connector-resources
jms/qConnFactory
Command list-connector-resources executed successfully
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
list-connector-resources at the command line.
2 View the properties of the connector resource by using the get(1) subcommand.
For example
asadmin> get domain.resources.connector-resource.jms/qConnFactory
3 Set the property of the connector resource by using the set(1) subcommand.
For example:
asadmin> set domain.resources.connector-resource.jms/qConnFactory.enabled=true
Before You Begin Before deleting a resource, all associations with the resource must be removed.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
delete-connector-resource at the command line.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
create-resource-adapter-config at the command line.
asadmin> list-resource-adapter-configs
ra1
ra2
Command list-resource-adapter-configs executed successfully
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
list-resource-adapter-configs at the command line.
2 View the properties of the connector resource by using the get(1) subcommand.
For example:
asadmin> get domain.resources.resource-adapter-config.ra1.*
3 Set the property of the connector resource by using the set(1) subcommand.
For example:
asadmin> set domain.resources.resource-adapter-config.ra1.raSpecificProperty=value
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
delete-resource-adapter-config at the command line.
A security map applies to a particular connector connection pool. One or more named security
maps can be associated with a connector connection pool.
You can also use this subcommand to map the caller identity of the application (principal or
user group) to a suitable EIS principal in container-managed transaction-based scenarios.
Before You Begin For this subcommand to succeed, you must have first created a connector connection pool. For
instructions, see “To Create a Connector Connection Pool” on page 255.
3 List the security maps for a specific connector connection pool by using the
list-connector-security-maps(1) subcommand.
Example 15–11 Listing All Connector Security Maps for a Connector Connection Pool
This example lists the connector security maps associated with connector-Pool1.
Example 15–12 Listing Principals for a Specific Security Map for a Connector Connection Pool
This example lists the principals associated with securityMap1.
Example 15–13 Listing Principals of All Connector Security Maps for a Connector Connection Pool
This example lists the connector security maps associated with connector-Pool1.
3 Modify a security map for a specific connector connection pool by using the
update-connector-security-map(1) subcommand.
3 Delete a security map for a specific connector connection pool by using the
delete-connector-security-map(1) subcommand.
Information about options for this subcommand is included in this help page.
Before You Begin Before creating a connector work security map, you must first create a connector connection
pool. For instructions, see “To Create a Connector Connection Pool” on page 255.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
create-connector-work-security-map at the command line.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
list-connector-work-security-maps at the command line.
3 If necessary, notify users that the connector work security map is being modified.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
update-connector-work-security-map at the command line.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
delete-connector-work-security-map at the command line.
Before You Begin The resource adapter must be deployed before running this subcommand (jmsrar.rar).
asadmin> create-admin-object --restype javax.jms.Queue --raname jmsra --description "sample administered object"
--property Name=sample_jmsqueue jms/samplequeueCommand create-admin-object executed successfully
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
create-admin-object at the command line.
asadmin> list-admin-objects
jms/samplequeue
Command list-admin-objects executed successfully
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
list-admin-object at the command line.
2 View the properties of the administered object by using the get(1) subcommand.
For example:
asadmin> get domain.resources.admin-object-resource.jms/samplequeue.*
3 Set the property of the administered object by using the set(1) subcommand.
For example:
asadmin> set domain.resources.admin-object-resource.jms/samplequeue.enabled=false
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
delete-admin-object at the command line.
This chapter provides procedures for performing internet connectivity tasks in the Sun
GlassFishTM Enterprise Server v3 environment by using the asadmin command-line utility.
Instructions for accomplishing the tasks in this chapter by using the Administration Console
are contained in the Administration Console online help.
273
About Internet Connectivity
HTTP listener can listen for a host on all configured IP addresses on a given port by specifying
the IP address 0.0.0.0. Alternatively, the listener can specify a unique IP address for each listener
while using the same port.
Because an HTTP listener is a combination of IP address and port number, you can have
multiple HTTP listeners with the same IP address and different port numbers, or with different
IP addresses and the same port number (if your host was configured to respond to these
addresses). However, if an HTTP listener uses the 0.0.0.0 IP address, which listens on all IP
addresses on a port, you cannot create HTTP listeners for additional IP addresses that listen on
the same port for a specific IP address. For example, if an HTTP listener uses 0.0.0.0:8080 (all IP
addresses on port 8080), another HTTP listener cannot use 1.2.3.4:8080. The host running the
Enterprise Server typically has access to only one IP address. HTTP listeners typically use the
0.0.0.0 IP address and different port numbers, with each port number serving a different
purpose. However, if the host does have access to more than one IP address, each address can
serve a different purpose.
Note – Do not confuse an Internet domain with the administrative domain of Enterprise Server.
For example, assume that you want to host the following domains on your physical server:
www.aaa.com, www.bbb.com, and www.ccc.com. Assume that these domains are respectively
associated with web modules web1, web2, and web3. This means that the following URLs are
handled by your physical server:
http://www.aaa.com:8080/web1
http://www.bbb.com:8080/web2
http://www.ccc.com:8080/web3
The first URL is mapped to virtual server www.aaa.com, the second URL is mapped to virtual
server www.bbb.com, and the third is mapped to virtual server www.ccc.com. For this mapping
to work, www.aaa.com, www.bbb.com, and www.ccc.com must all resolve to your physical server’s
IP address and each virtual server must be registered with the DNS server for your network. In
addition, on a UNIX system, add these domains to your /etc/hosts file (if the setting for hosts
in your /etc/nsswitch.conf file includes files).
The following table describes the Enterprise Server default ports for the listeners that use ports.
HTTP 8080 The web server listens for HTTP requests on a port. To access deployed web
applications and services, clients connect to this port.
2 Create an HTTP or HTTPS protocol by using the create-protocol(1) subcommand with the
--securityenabled option.
To use the built-in http-listener-1 HTTP protocol, or http-listener-2 HTTPS protocol,
skip this step.
See Also You can also view the full syntax and options of the subcommand by typing a command such as
asadmin help create-http-listener at the command line.
▼ To Create a Protocol
Use the create-protocol subcommand in remote mode to create a protocol.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
create-protocol at the command line.
▼ To List Protocols
Use the list-protocols subcommand in remote mode to list the existing HTTP protocols.
asadmin> list-protocols
admin-listener
http-1
http-listener-1
http-listener-2
Command list-protocols executed successfully.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
list-protocols at the command line.
▼ To Delete a Protocol
Use the delete-protocol subcommand in remote mode to remove a protocol.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
delete-protocol at the command line.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
create-http at the command line.
2 Delete the HTTP parameters from a protocol by using the delete-http(1) subcommand.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
delete-http at the command line.
▼ To Create a Transport
Use the create-transport subcommand in remote mode to create a transport for a network
listener,
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
create-transport at the command line.
▼ To List Transports
Use the list-transports subcommand in remote mode to list the existing HTTP transports.
asadmin> list-transports
http1-trans
tcp
Command list-transports executed successfully.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
list-transports at the command line.
▼ To Delete a Transport
Use the delete-transport subcommand in remote mode to remove a transport.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
delete-transport at the command line.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
create-http-listener or asadmin help create-network-listener at the command line.
asadmin> list-http-listeners
admin-listener
http-listener-2
http-listener-1
Command list-http-listeners executed successfully.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
list-http-listeners or asadmin help list-network-listeners at the command line.
2 Modify the values for the specified listener by using the set(1) subcommand.
The listener is identified by its dotted name.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
delete-http-listener or asadmin help delete-network-listener at the command line.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
create-ssl at the command line.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
delete-ssl at the command line.
1 In the Administration Console, open the HTTP Service component under the relevant
configuration.
2 Open the HTTP Listeners component under the HTTP Service component.
See Also For details, click the Help button in the Administration Console from the HTTP Listeners page.
You can define virtual server properties using the asadmin set command. For example:
Some virtual server properties can be set for a specific web application. For details, see
“sun-web-app” in Sun GlassFish Enterprise Server v3 Application Deployment Guide.
In a production environment, additional virtual servers provide hosting facilities for users and
customers so that each appears to have its own web server, even though there is only one
physical server.
Use the create-virtual-server subcommand in remote mode to create the named virtual
server.
Before You Begin A virtual server must specify an existing HTTP listener. Because the virtual server cannot
specify an HTTP listener that is already being used by another virtual server, create at least one
HTTP listener before creating a new virtual server.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
create-virutal-server at the command line.
asadmin> list-virtual-servers
sampleListener
admin-listener
http-listener-2
http-listener-1
Command list-http-listeners executed successfully.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
list-virutal-servers at the command line.
2 Modify the values for the specified virtual server by using the set(1) subcommand.
The virtual server is identified by its dotted name.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
delete-virutal-server at the command line.
http://myvserver:3184/
A virtual server with no default web module assigned serves HTML or JavaServer PagesTM
(JSPTM) content from its document root, which is usually domain-dir/docroot. To access this
HTML or JSP content, point your browser to the URL for the virtual server, do not supply a
context root, but specify the target file.
For example:
http://myvserver:3184/hellothere.jsp
Before You Begin The application or module must already be deployed. For more information, see Sun GlassFish
Enterprise Server v3 Application Deployment Guide.
1 In the Administration Console, open the HTTP Service component under the relevant
configuration.
2 Open the Virtual Servers component under the HTTP Service component.
3 Select the virtual server to which you want to assign a default web module.
4 Select the application or web module from the Default Web Module drop-down list.
For more information, see “To Assign a Default Web Module to a Virtual Server” on page 288.
The Sun GlassFishTM Enterprise Server supports a standard set of protocols and formats that
ensure interoperability. Among these protocols are those defined by CORBA. The Object
Request Broker (ORB) is the central component of CORBA. The ORB provides the required
infrastructure to identify and locate objects, handle connection management, deliver data, and
request communication. This chapter describes how to configure the ORB and the IIOP
listeners.
Instructions for accomplishing the tasks in this chapter by using the Administration Console
are contained in the Administration Console online help.
291
Configuring the ORB
IIOP can be used as a Remote Method Invocation (RMI) protocol by applications or objects
using RMI-IIOP. Remote clients of enterprise beans (EJB modules) communicate with
Enterprise Server by using RMI-IIOP.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
create-iiop-listener at the command line.
asadmin> list-iiop-listeners
orb-listener-1
SSL
SSL_MUTUALAUTH
sample_iiop_listener
Command list-iiop-listeners executed successfully.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
list-iiop-listeners at the command line.
2 Modify the values for the specified IIOP listener by using the set(1) subcommand.
The listener is identified by its dotted name.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
delete-iiop-listener at the command line.
The Sun JavaTM Enterprise Server includes the JavaMail API along with JavaMail service
providers that allow an application component to send email notifications over the Internet and
to read email from IMAP and POP3 mail servers.
Instructions for accomplishing the tasks in this chapter by using the Administration Console
are contained in the Administration Console online help.
About JavaMail
The JavaMail API is a set of abstract APIs that model a mail system. The JavaMail API provides
a platform-independent and protocol-independent framework to build mail and messaging
applications and provide facilities for reading and sending electronic messages. Service
providers implement particular protocols. Using the API you can add email capabilities to your
applications. JavaMail provides access from Java applications to Internet Message Access
Protocol (IMAP) and Simple Mail Transfer Protocol (SMTP) capable mail servers on your
network or the Internet. The API does not provide mail server functionality; you must have
access to a mail server to use JavaMail.
The JavaMail API is implemented as an optional package in the Java platform and is also
available as part of the Java EE platform.
To learn more about the JavaMail API, consult the JavaMail web site at http://java.sun.com/
products/javamail/.
295
Administering JavaMail Resources
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
create-javamail-resource at the command line.
asadmin> list-javamail-resources
mail/MyMailSession
Command list-javamail-resources executed successfuly.
See Also You can also view the full syntax and options of the subcommands by typing asadmin help
list-javamail-resources at the command line.
2 Modify the values for the specified JavaMail source by using the set(1) subcommand.
The resource is identified by its dotted name.
Before You Begin References to the specified resource must be removed before running the
delete-javamail-resource subcommands.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
delete-javamail-resource at the command line.
Sun implements the JavaTM Message Service (JMS) API by integrating the Sun GlassFishTM
Message Queue software into Sun GlassFish Enterprise Server. This chapter provides
procedures for administering JMS resources in the Enterprise Server environment by using the
asadmin command-line utility.
Note – JMS resources are supported only in the Full Platform Profile of Enterprise Server, not in
the Web Profile.
299
About the JMS
support is known within Enterprise Server as the JMS Service. JMS requires only minimal
administration. When a JMS client accesses a JMS administered object for the first time, the
client JVM retrieves the JMS configuration from Enterprise Server.
A JMS resource is a type of connector. Message Queue is integrated with Enterprise Server by
means of a connector module, also known as a resource adapter, which is defined by the Java EE
Connector Architecture Specification 1.6. Any Java EE components that are deployed to
Enterprise Server exchange JMS messages by using the JMS provider that is integrated by the
connector module. When a JMS resource is created in Enterprise Server, a connector resource is
created in the background. Each JMS operation invokes the connector runtime and uses the
Message Queue connector module in the background. Enterprise Server pools JMS connections
automatically.
You can configure properties to be used by all JMS connections. If you update these properties
at runtime, only those connection factories that are created after the properties are updated will
apply the updated values. The existing connection factories will continue to have the original
property values. For most values to take effect, Enterprise Server must be restarted. For
instructions, see “To Restart a Domain” on page 90. The only property that can be updated
without restarting Enterprise Server is the default JMS host.
In EMBEDDED mode, the JMS operations bypass the networking stack, which leads to
performance optimization.
For information about administering Message Queue, see Sun GlassFish Message Queue 4.4
Administration Guide.
If a message-driven bean is deployed and the physical destination it listens to does not exist,
Enterprise Server automatically creates the physical destination and sets the value of the
maxNumActiveConsumers property to -1. However, it is good practice to create the physical
destination beforehand. The first time that an application accesses a destination resource,
Message Queue automatically creates the physical destination specified by the Name property
of the destination resource. The physical destination is temporary and expires after a period
specified by a Message Queue configuration property.
Because a physical destination is actually a Message Queue object rather than a server object,
you use Message Queue broker commands to update properties. For information on Message
Queue properties, see Sun GlassFish Message Queue 4.4 Administration Guide.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
create-jmsdest at the command line.
2 List the existing JMS physical destinations by using the list-jmsdest(1) subcommand.
asadmin> list-jmsdest
PhysicalQueue queue {}
PhysicalTopic topic {}
Command list-jmsdest executed successfully.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
list-jmsdest at the command line.
2 Purge messages from the a JMS physical destination by using the flush-jmsdest(1)
subcommand.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
flush-jmsdest at the command line.
2 List the existing JMS physical destinations by using the list-jmsdest(1) subcommand.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
delete-jmsdest at the command line.
JMS applications use the Java Naming and Directory Interface (JNDI) API to access the
connection factory and destination resources. A JMS application normally uses at least one
connection factory and at least one destination. By studying the application or consulting with
the application developer, you can determine what resources must be created. The order in
which the resources are created does not matter.
The subcommands in this section can be used to administer both the connection factory
resources and the destination resources. For instructions on administering physical
destinations, see “Administering JMS Physical Destinations” on page 301.
Use the create-jms-resource command in remote mode to create a JMS connection factory
resource or a destination resource.
To update a JMS connection factory, use the set subcommand for the underlying connector
connection pool, See “To Update a Connector Connection Pool” on page 257.
To update a destination, use the set subcommand for the admin object resource. See “To
Update an Administered Object” on page 271.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
create-jms-resource at the command line.
asadmin> list-jms-resources
jms/Queue
jms/ConnectionFactory
jms/DurableConnectionFactory
jms/Topic
Command list-jms-resources executed successfully
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
list-jms-resources at the command line.
Before You Begin Ensure that you remove all references to the specified JMS resource before running this
subcommand.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
delete-jms-resource at the command line.
One of the hosts in the JMS hosts list is designated the default JMS host. Enterprise Server starts
the default JMS host when the Message Queue broker mode is configured as type LOCAL.
Creating a new JMS host is not often necessary and is a task for advanced users. Use the
create-jms-host subcommand in remote mode to create an additional JMS host.
Because a JMS is actually a Message Queue object rather than a server object, you use Message
Queue broker commands to update properties. For information on Message Queue properties,
see Sun GlassFish Message Queue 4.4 Administration Guide.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
create-jms-host at the command line.
asadmin> list-jms-hosts
default_JMS_host
MyNewHost
Command list-jmsdest executed successfully
See Also You can also view the full syntax and options of the subcommand by typing asadmin help set
at the command line.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
delete-jms-host at the command line.
Two modes of integration are supported by the resource adapter. The first one uses JNDI as the
means of integration. In this situation, administered objects are set up in the JMS provider's
JNDI tree and will be looked up for use by the generic resource adapter. If that mode is not
suitable for integration, it is also possible to use the Java reflection of JMS administered object
javabean classes as the mode of integration.
Generic resource adapter 1.6 for JMS is a Java EE connector 2.0 resource adapter that can wrap
the JMS client library of external JMS providers such as IBM WebSphere MQ, Tibco EMS, and
Sonic MQ among others. This integrates any JMS provider with a Java EE 6 application server,
such as the Sun GlassFish Enterprise Server. The adapter is a .rar archive that can be deployed
and configured using Java EE 6 application server administration tools.
1 Deploy the generic resource adapter the same way you would deploy a connector module.
5 Make the following changes to the security Enterprise Server policy files:
■ Modify the sjsas_home/domains/domain1/config/server.policy file to add the
following:
java.util.logging.LoggingPermission "control"
■ Modify the sjsas_home/lib/appclient/client.policy file to add permission:
javax.security.auth.PrivateCredentialPermission
"javax.resource.spi.security.PasswordCredential ^ \"^\"","read":
Troubleshooting JMS
When you start Enterprise Server, the JMS service is available but is not loaded until it is needed
(for example, when you create a JMS resource). Use the jms-ping(1)subcommand to check if
the JMS service is running or, if it is not yet running, to start it. If thejms-ping subcommand is
unable to contact a built-in JMS service, an error message is displayed.
The Java Naming and Directory Interface (JNDI) API is used for accessing different kinds of
naming and directory services. Java EE components locate objects by invoking the JNDI lookup
method.
Instructions for accomplishing the tasks in this chapter by using the Administration Console
are contained in the Administration Console online help.
About JNDI
By making calls to the JNDI API, applications locate resources and other program objects. A
resource is a program object that provides connections to systems, such as database servers and
messaging systems. A JDBC resource is sometimes referred to as a data source. Each resource
object is identified by a unique, people-friendly name, called the JNDI name. A resource object
and its JNDI name are bound together by the naming and directory service, which is included
with the Enterprise Server.
When a new name-object binding is entered into the JNDI, a new resource is created.
313
About JNDI
Java EE application clients, enterprise beans, and web components must have access to a JNDI
naming environment.
The application component's naming environment is the mechanism that allows customization
of the application component's business logic during deployment or assembly. This
environment allows you to customize the application component without needing to access or
change the source code off the component. A Java EE container implements the provides the
environment to the application component instance as a JNDI naming context.
Each application component defines its own set of environment entries. All instances of an
application component within the same container share the same environment entries.
Application component instances are not allowed to modify the environment at runtime.
The JNDI name of a resource and the resource reference name are not the same. This approach
to naming requires that you map the two names before deployment, but it also decouples
components from resources. Because of this decoupling, if at a later time the component needs
to access a different resource, the name does not need to change. This flexibility makes it easier
for you to assemble J2EE applications from preexisting components.
The following table lists JNDI lookups and their associated resource references for the J2EE
resources used by the Enterprise Server.
Chapter 20 • Administering the Java Naming and Directory Interface (JNDI) Service 315
Administering JNDI Resources
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
create-custom-resource at the command line.
asadmin> list-custom-resources
sample_custom_resource01
sample_custom_resource02
Command list-custom-resources executed successfully
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
list-custom-resources at the command line.
Chapter 20 • Administering the Java Naming and Directory Interface (JNDI) Service 317
Administering JNDI Resources
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
delete-custom-resource at the command line.
Before You Begin The external JNDI factory must implement the javax.naming.spi.InitialContextFactory
interface.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
create-jndi-resource at the command line.
asadmin> list-jndi-resources
jndi_resource1
jndi_resource2
jndi_resource3
Command list-jndi-resources executed successfully
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
list-jndi-resources at the command line.
2 List the JNDI entries for a configuration by using the list-jndi-entries(1) subcommand.
asadmin> list-jndi-entries
jndi_entry03
jndi_entry72
jndi_entry76
Command list-jndi-resources executed successfully
Chapter 20 • Administering the Java Naming and Directory Interface (JNDI) Service 319
Administering JNDI Resources
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
list-jndi-entries at the command line.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
delete-jndi-resource at the command line.
Chapter 20 • Administering the Java Naming and Directory Interface (JNDI) Service 321
322
21
C H A P T E R 2 1
Administering Transactions
This chapter discusses how to manage the transaction service for the Sun GlassFishTM Enterprise
Server environment by using the asadmin command-line utility. Instructions for manually
recovering transactions are also included.
Instructions for accomplishing the tasks in this chapter by using the Administration Console
are contained in the Administration Console online help. For additional information on
configuring the transaction service, transaction logging, and distributed transaction recovery,
see Chapter 15, “Using the Transaction Service,” in Sun GlassFish Enterprise Server v3
Application Development Guide.
About Transactions
A transaction is a series of discreet actions in an application that must all complete successfully.
By enclosing one or more actions in an indivisible unit of work, a transaction ensures data
integrity and consistency. If all actions do not complete, the changes are rolled back.
For example, to transfer funds from a checking account to a savings account, the following steps
typically occur:
1. Check to see if the checking account has enough money to cover the transfer.
2. Debit the amount from the checking account.
3. Credit the amount to the savings account.
4. Record the transfer to the checking account log.
5. Record the transfer to the savings account log.
323
Managing the Transaction Service
If all the steps complete successfully, the transaction is committed. If any step fails, all changes
from the preceding steps are rolled back, and the checking account and savings account are
returned to the states they were in before the transaction started. This type of event is called a
rollback. A normal transaction ends in either a committed state or a rolled back state.
For instructions on configuring the transaction service and setting up automatic recovery, see
Chapter 15, “Using the Transaction Service,” in Sun GlassFish Enterprise Server v3 Application
Development Guide.
asadmin> freeze-transaction-service
Command freeze-transaction-service executed successfully
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
freeze-transaction-service at the command line.
Before You Begin Stop the transaction service before rolling back an in-flight transaction.
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
rollback-transaction at the command line.
asadmin> unfreeze-transaction-service
Command unfreeze-transaction-service executed successfully
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
unfreeze-transaction-service at the command line.
Recovering Transactions
There are some situations where the commit or rollback operations might be interrupted,
typically because the server crashed or a resource manager crashed. Crash situations can leave
some transactions stranded between steps. Enterprise Server is designed to recover from these
failures and complete the transactions upon server startup. If the failed transaction spans
multiple servers, the server that started the transaction can contact the other servers to get the
outcome of the transaction. If the other servers are unreachable, the transaction uses heuristic
decision information to determine the outcome. The transactions are resolved upon server
startup.
In a failure situation that is not a crash, you can perform manual recovery as described in the
following procedure
See Also You can also view the full syntax and options of the subcommand by typing asadmin help
recover-transactions at the command line.
Appendixes
329
330
A
A P P E N D I X A
This appendix lists the asadmin subcommands that are included with this release of the Sun
GlassFishTM Enterprise Server v3 software.
■ “General Administration Subcommands” on page 332
■ “Connectivity Subcommands” on page 334
■ “Domain Subcommands” on page 337
■ “Internet Connectivity Subcommands” on page 338
■ “JavaMail Subcommands” on page 339
■ “JMS Subcommands” on page 340
■ “JNDI Subcommands” on page 341
■ “JVM Subcommands” on page 342
■ “Life Cycle Module Subcommands” on page 342
■ “Logging and Monitoring Subcommands” on page 343
■ “ORB Subcommands” on page 343
■ “Security Subcommands” on page 344
■ “Thread Pool Subcommands” on page 345
■ “Transaction Service Subcommands” on page 346
■ “User Management Subcommands” on page 346
For information and instructions on using the asadmin application deployment subcommands,
see Sun GlassFish Enterprise Server v3 Application Deployment Guide.
Online help for the asadmin subcommands can be invoked on the command line, for example,
asadmin create-domain --help. The Sun GlassFish Enterprise Server v3 Reference Manual also
provides a collection of these help pages.
Note – The common options used with remote subcommands are described in the asadmin(1M)
help page.
331
General Administration Subcommands
Connectivity Subcommands
create-admin-object(1) Creates an administered object. For
procedural information in this guide, see “To
Create an Administered Object” on page 270.
create-connector-connection-pool(1) Adds a new connector connection pool with
the specified connection pool name. For
procedural information in this guide, see “To
Create a Connector Connection Pool” on
page 255.
create-connector-resource(1) Creates a connector resource. For procedural
information in this guide, see “To Create a
Connector Resource” on page 258.
create-connector-security-map(1) Creates a connector security map for the
specified connector connection pool. For
procedural information, see “To Create a
Connector Security Map” on page 264.
create-connector-work-security-map(1) Creates a connector work security map for the
specified resource adapter. Supported in
remote mode only. For procedural
information in this guide, see “To Create a
Connector Work Security Map” on page 267.
create-jdbc-resource(1) Creates a new JDBC resource. Supported in
remote mode only. For procedural
information in this guide, see “To Create a
JDBC Resource” on page 240.
create-jdbc-connection-pool(1) Registers a new JDBC connection pool with
the specified JDBC connection pool name.
Supported in remote mode only. For
procedural information in this guide, see “To
Create a JDBC Connection Pool” on page 236.
create-resource-adapter-config(1) Creates configuration information for the
connector module. Supported in remote mode
only. For procedural information in this guide,
see “To Create Configuration Information for
a Resource Adapter” on page 261.
delete-admin-object(1) Deletes an administered object. For
procedural information in this guide, see “To
Delete an Administered Object” on page 272.
Domain Subcommands
create-domain(1) Creates the configuration of a domain. A domain can exist
independent of other domains. Any user who has access to the asadmin
utility on a given host can create a domain and store its configuration
in a location of choice. For procedural information in this guide, see
“To Create a Domain” on page 84.
delete-domain(1) Deletes the specified domain. The domain must be stopped before it
can be deleted. For procedural information in this guide, see “To
Delete a Domain” on page 87.
list-domains(1) Lists the existing domains and their statuses. If the domain directory is
not specified, the domains in the default as-install/domains directory is
displayed. For procedural information in this guide, see “To List
Domains” on page 85.
login(1) Allows you to log in to a domain. For procedural information in this
guide, see “To Log In to a Domain” on page 86.
restart-domain(1) Restarts the Domain Administration Server (DAS) of the specified
domain. Supported in remote mode only. For procedural information
in this guide, see “To Restart a Domain” on page 90.
start-domain(1) Starts a domain. If the domain directory is not specified, the default
domain1 in the default as-install/domains directory is started. If there
are two or more domains, the domain_name operand must be
specified. For procedural information in this guide, see “To Start a
Domain” on page 88.
stop-domain(1) Stops the domain administration server (DAS) of the specified domain.
Supported in remote mode only. For procedural information in this
guide, see “To Stop a Domain” on page 89.
uptime(1) Displays the length of time that the domain administration server
(DAS) has been running since the last restart. Supported in remote
mode only. For procedural information in this guide, see “To Display
JavaMail Subcommands
create-javamail-resource(1) Creates a JavaMail session resource. Supported in remote
mode only. For procedural information in this guide, see
“To Create a JavaMail Resource” on page 296.
delete-javamail-resource(1) Deletes a JavaMail session resource. Supported in remote
mode only. For procedural information in this guide, see
“To Delete a JavaMail Resource” on page 298.
JMS Subcommands
create-jmsdest(1) Creates a JMS physical destination. Along with the physical
destination, you use the create-jms-resource subcommand to
create a JMS destination resource that has a Name property that
specifies the physical destination. Supported in remote mode
only. For procedural information in this guide, see “To Create a
JMS Physical Destination” on page 301.
create-jms-host(1) Creates a JMS host within the JMS service. Supported in remote
mode only. For procedural information in this guide, see “To
Create a JMS Host” on page 308.
create-jms-resource(1) Creates a JMS connection factory resource or JMS destination
resource. Supported in remote mode only. Supported in remote
mode only. For procedural information in this guide, see “To
Create a Connection Factory or Destination Resource” on
page 305.
delete-jmsdest(1) Removes the specified JMS destination. Supported in remote
mode only. For procedural information in this guide, see “To
Delete a JMS Physical Destination” on page 303.
delete-jms-host(1) Deletes a JMS host within the JMS service. Supported in remote
mode only. For procedural information in this guide, see “To
Delete a JMS Host” on page 309.
delete-jms-resource(1) Deletes a JMS connection factory resource or JMS destination
resource. Supported in remote mode only. For procedural
information in this guide, see “To Delete a Connection Factory
or Destination Resource” on page 307.
flush-jmsdest(1) Purges the messages from a physical destination in the specified
JMS Service configuration of the specified target. Supported in
remote mode only. For procedural information in this guide, see
“To Purge Messages From a Physical Destination” on page 303.
jms-ping(1) Checks if the JMS service (also known as the JMS provider) is up
and running. Supported in remote mode only. For procedural
information in this guide, see “Troubleshooting JMS” on
page 312.
JNDI Subcommands
create-custom-resource(1) Creates a custom JNDI resource. Supported in remote mode
only. For procedural information in this guide, see “To
Create a Custom JNDI Resource” on page 316.
create-jndi-resource(1) Creates an external JNDI resource. Supported in remote
mode only. For procedural information in this guide, see “To
Register an External JNDI Resource” on page 318.
delete-custom-resource(1) Deletes a custom JNDI resource. Supported in remote mode
only. For procedural information in this guide, see “To
Delete a Custom JNDI Resource” on page 317.
delete-jndi-resource(1) Deletes an external JNDI resource. Supported in remote
mode only. For procedural information in this guide, see “To
Delete an External JNDI Resource” on page 320.
list-custom-resources(1) Lists the existing custom JNDI resources. Supported in
remote mode only. For procedural information in this guide,
see “To List Custom JNDI Resources” on page 316.
list-jndi-entries(1) Lists the entries in the JNDI tree. Supported in remote mode
only. For procedural information in this guide, see “To List
External JNDI Entries” on page 319,
list-jndi-resources(1) Lists the existing external JNDI resources. Supported in
remote mode only. For procedural information in this guide,
see “To List External JNDI Resources” on page 319.
JVM Subcommands
create-jvm-options(1) Creates a JVM option in the Java configuration or profiler
elements of the domain.xml file. Supported in remote mode only.
For procedural information in this guide, see “To Create JVM
Options” on page 96.
create-profiler(1) Creates a profiler element. Supported in remote mode only. For
procedural information in this guide, see “To Create a Profiler”
on page 99.
delete-jvm-options(1) Deletes the specified JVM option from the Java configuration or
profiler elements of the domain.xml file. Supported in remote
mode only. For procedural information in this guide, see “To
Delete JVM Options” on page 97.
delete-profiler(1) Deletes the specified profiler element. Supported in remote
mode only. For procedural information in this guide, see “To
Delete a Profiler” on page 100.
generate-jvm-report(1) Generates a report showing the threads, classes, and memory for
the virtual machine that runs Enterprise Server. For procedural
information in this guide, see “To Generate a JVM Report” on
page 98.
list-jvm-options(1) Lists the command-line options that are passed to the Java
application launcher when Enterprise Server is started.
Supported in remote mode only. For procedural information in
this guide, see “To List JVM Options” on page 96.
ORB Subcommands
create-iiop-listener(1) Creates an IIOP listener. Supported in remote mode only. For
procedural information in this guide, see “To Create an IIOP
Listener” on page 292.
delete-iiop-listener(1) Deletes an IIOP listener. Supported in remote mode only. For
procedural information in this guide, see “To Delete an IIOP
Listener” on page 294.
list-iiop-listeners(1) Lists the existing IIOP listeners. Supported in remote mode
only. For procedural information in this guide, see “To List
IIOP Listeners” on page 293.
Security Subcommands
change-admin-password(1) Modifies the administration password. You are
prompted for the old and new admin password
(with confirmation). For procedural information
in this guide, see “To Change the Administration
Password” on page 192.
change-master-password(1) Changes the administration master password.
This password is used to access the secure store
where primary keys are stored. This
subcommand will not work unless the server is
stopped. For procedural information in this
guide, see “To Change the Master Password” on
page 190.
configure-ldap-for-admin(1) Configures the authentication realm named
admin-realm for the given LDAP. Supported in
remote mode only.
create-audit-module(1) Adds the named audit module for the plug-in
that implements the audit capabilities.
Supported in remote mode only. For procedural
information in this guide, see “To Create an
Audit Module” on page 197.
create-message-security-provider(1) Creates a provider-config subelement for the
given message layer (the
message-security-config element of
domain.xml, the file that specifies parameters
and properties). Supported in remote mode only.
For procedural information in this guide, see “To
Create a Message Security Provider” on page 226.
create-password-alias(1) Creates an alias for a password; aliases are not
stored as clear text in the domain.xml file.
Supported in remote mode only. For procedural
information in this guide, see “To Create a
Password Alias” on page 194.
delete-audit-module(1) Removes the named audit module. Supported in
remote mode only. For procedural information
in this guide, see “To Delete an Audit Module”
on page 198.
delete-message-security-provider(1) Deletes a provider-config subelement for the
given message layer. Supported in remote mode
list-file-users(1) Lists the file users supported by the file realm authentication
method. Supported in remote mode only. For procedural
information in this guide, see “To List File Users” on page 211.
list-file-groups(1) Lists groups for a file user, or all groups if the --name option is not
specified. For procedural information in this guide, see “To List File
Groups” on page 212.
update-file-user(1) Updates an existing entry in the keyfile using the specified user
name, password, and groups. Supported in remote mode only. For
procedural information in this guide, see “To Update a File User”
on page 213.
A AMX, 43
accessing a database, 232-235 anonymous login, 31
add-on components, 171 Apache Felix OSGi framework, 40-42
about monitoring, 130 Apache HTTP Server, 108
installing, 172 application security, overview, 218
overview, 171 applications
reverting to prior version, 176-178 listing, 58
updating, 174-175 monitoring statistics, 140
updating an image, 175-176 asadmin utility
add-resources command, 56 command syntax, 48-49
adding commands listing, 331-347
new components, 172 help information, 50-51
resources, 56 listing commands, 60
additional information man pages, 50-51
on Message Security, 228 operands, 49
on Update Tool, 171 options, 48-49
admin password, 183 overview, 39, 47-54
resetting, 192-193 path settings, 48
administered objects scripts, 53-54
creating, 270 single mode, 49-50
deleting, 272 subcommand options, 48-49
editing, 271 subcommands, 48
listing, 271 audit modules, 185
Administration Console creating, 197
overview, 38 deleting, 198
starting, 38 listing, 197-198
administration realm, 205 authentication
aliases methods, 182-184
creating for passwords, 194-195 overview, 182-184
deleting for a password, 195-196 overview of types, 182
for passwords, 183, 193-196 realms, 205-210
listing for passwords, 195 single sign-on, 183-184
349
Index
351
Index
353
Index
G I
garbage collectors monitoring statistics for JVM, 151 IBM DB2 JDBC driver, 243-244, 244
generate-jvm-report command, 98-99 IIOP listeners
generating, JVM report, 98-99 configuring, 292-294
generating certificates, with keytool, 199-201 creating, 292-293
generic resource adapter, configuring, 311-312 deleting, 294
get command, 132-133, 137-139 listing, 293
guidelines, 136-137 updating, 293-294
image, updating all installed components, 175-176
get subcommand, 131-132
Inet MSSQL JDBC driver, 251
glassfish-jk.properties file, 109
Inet Oracle JDBC driver, 250-251
global log levels, setting, 119
Inet Sybase JDBC driver, 251
Informix Type 4 JDBC driver, 249-250
installed components
uninstalling, 176-177
H
updating, 174-175
headless systems, updating, 172
installing
help information, asadmin utility, 50-51 add-on components, 172
HTML format, REST resources, 82 database and driver, 233
HTTP configuration internet connection, creating, 276
creating, 278-279
deleting, 279
HTTP listeners
administering, 275-285 J
common monitoring statistics, 134-135 JACC, overview, 185
configuring for SSL, 284 Java, switching version for a domain, 94
creating, 281-282 Java DB, utility scripts, 234-235
deleting, 283-284 Java DB driver, 244-245
deleting SSL from, 284-285 Java Message Service, See JMS
for mod_jk, 109 JavaMail, 295-298
listing, 282-283 creating a resource, 296-297
overview, 274 deleting a resource, 298
listing resources, 297
ports, 275
overview, 295
updating, 283
updating a resource, 297-298
HTTP protocol, creating, 277
JavaScript Object Notation, See JSON
HTTP protocols, listing, 277-278 JConsole, setting up connectivity, 165-166
HTTP service JDBC
administering, 273-289 configuring, 231-252
monitoring statistics, 143 configuring realm, 209-210
virtual server statistics, 143 configuring resources, 240-242
HTTP service monitoring statistics for JRuby, 148 creating a resource, 240-241
HTTP transport, creating, 280 creating connection pool, 236-237
HTTP transports, listing, 280 database setup, 232-235
httpd.conf file, 109 deleting connection pools, 239-240
355
Index
357
Index
overview (Continued) Q
OSGi module management subsystem, 40-42 queries, REST interfaces, 75
passwords, 182-183
realms, 205-210
roles, 184
system security, 181-190 R
thread pools, 101 realms
transactions, 323-324 certificate, 187
configuring digest realm, 209-210
Update Tool, 40
configuring JDBC, 209-210
virtual servers, 274
creating, 206-207
web services security, 216 deleting, 208
listing, 207
overview, 205-210
updating, 208
P
recover–transactions subcommand, 327
passwordfile option, 193 recovering, transactions manually, 327
passwords redirecting a URL, 108
admin, 183 registering, JNDI resource, 318
aliases, 183, 193-196 remote commands, listing, 60
changing admin password, 192-193 remote server access for JMS, 311
changing master, 191 Remote Shell for Apache Felix, 40-42
encoded, 183 remote subcommands, 48
encrypting, 194 representational state transfer interfaces, See REST
master, 183 interfaces
overview, 182-183 request monitoring statistics for web, 163
setting from a file, 193 resetting connection pools (flush), 238-239
path settings, asadmin utility, 48 resource adapter, generic, JMS, 311-312
physical destination (JMS), creating, 301-302 resource adapter configuration,
ping-connection-pool command, 238, 256 administering, 261-263
pkg command, 40, 172 resource adapter configurations
plugins, See add-on components creating, 261-262
deleting, 263
ports, defaults for listeners, 275
editing, 262
PostgreSQL JDBC driver, 248
listing, 262
profilers
resource references, 315
administering, 99-100 resources
creating, 99-100 adding, 56
deleting, 100 custom, 316
elements in domain.xml, 96 resources (JDBC), administering, 240-242
properties, administering for system, 54-56 REST interfaces, 39
protocol comparison of dotted names with URLs, 63
creating, 277 configuration, 62-63, 65-74
deleting, 278 HTML representation, 82
protocols, listing, 277-278 JSON representation, 76-79
359
Index
361
Index
U user security
unfreeze–transaction–service subcommand, 326 administering, 205-214
uninstalling, installed components, 176-177 creating users, 211
update-connector-security-map command, 265-266 deleting users, 213-214
update-connector–work-security-map listing file groups, 212
command, 268-269 listing users, 211-212
update-file-user command, 213 managing, 210-214
update-http-listener subcommand, 283 updating users, 213
update-iiop-listener command, 293-294
update-javamail-resource command, 297-298
update-jdbc-resource command, 241-242
update-message-security-provider command, 227 V
update-network-listener subcommand, 283 version command, 57
update-password-alias command, 196 viewing
Update Tool applications, 58
overview, 40 audit modules, 197-198
using the pkg command, 171 authentication realms, 207
update-virtual-server command, 288 common monitoring data, 133-134
updatetool command, 40 comprehensive monitoring data, 137-139
updating containers, 58
all installed components in an image, 175-176 DAS uptime, 93
connection factory, 305-306 Enterprise Server version, 57
connector security map, 265-266 file users, 211-212
connector work security map, 268-269 JDBC connection pools, 237-238
custom resource, 317 JDBC resources, 241
external JNDI resource, 320 JVM options, 96-97
HTTP listeners, 283 logs, 121
IIOP listeners, 293-294 modules, 59
installed components, 174-175 subcommands, 60
JavaMail resource, 297-298 system properties, 55
JDBC resources, 241-242 virtual servers, 287
JMS host, 309 virtual servers
JMS physical destination properties, 301-302 administering, 285-289
life cycle modules, 169-170 creating, 286-287
message security provider, 227 default, 285
password alias, 196 deleting, 288
realms, 208 listing, 287
threadpools, 103-104 monitoring statistics, 143
users, 213 overview, 274
virtual servers, 288 updating, 288
uptime command, 93
URL, redirecting, 108
URLs, REST interfaces, 62-63
W
web
monitoring statistics, 162
JSP statistics, 162
request statistics, 163
session statistics, 164
web applications
default, 105, 288-289
defining global features, 107
mod_jk, 108
redirecting a URL, 108
ways to invoke a servlet, 105
web container, monitoring statistics, 162
web module, monitoring statistics, 135-136
web services
message security, 215-228
sample application, 221
Wget, 62
Windows
invoking the Administration Console, 38
starting the default domain, 88
stopping the default domain, 89
work management, monitoring, 146
work security maps, 267-269
workers.properties file, 109
WSIT, 216
X
XML format, REST resources, 79-82
363
364