Sun Java System Application Server Platform Edition 9 Administration Guide
Sun Java System Application Server Platform Edition 9 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, Java, and Solaris are trademarks or registered trademarks of Sun
Microsystems, Inc. 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 2008 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, Java et Solaris sont des marques de fabrique ou des marques déposées de
Sun Microsystems, Inc. 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.
081215@21808
Contents
Preface ...................................................................................................................................................21
3
Contents
4 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Contents
6 Connectors ............................................................................................................................................77
Connector Connection Pools ............................................................................................................. 77
Connector Resources .......................................................................................................................... 79
Administered Object Resources ........................................................................................................ 79
5
Contents
6 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Contents
7
Contents
8 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Contents
9
Contents
10 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Contents
11
12
Figures
13
14
Tables
15
Tables
TABLE 16–19 JVM Statistics for J2SE 5.0 - Garbage Collection ................................................. 209
TABLE 16–20 JVM Statistics for J2SE 5.0 - Memory .................................................................... 209
TABLE 16–21 JVM Statistics for J2SE 5.0 - Operating System ................................................... 210
TABLE 16–22 JVM Statistics for J2SE 5.0 - Runtime ................................................................... 210
TABLE 16–23 JVM Statistics for J2SE 5.0 - Thread Info .............................................................. 211
TABLE 16–24 JVM Statistics for J2SE 5.0 - Threads .................................................................... 212
TABLE 16–25 Top Level .................................................................................................................. 223
TABLE 16–26 Applications Level ................................................................................................... 223
TABLE 16–27 Applications - Enterprise Applications and Standalone Modules ..................... 224
TABLE 16–28 HTTP-Service Level ................................................................................................ 227
TABLE 16–29 Thread-Pools Level .................................................................................................. 227
TABLE 16–30 Resources Level ........................................................................................................ 228
TABLE 16–31 Transaction-Service Level ...................................................................................... 228
TABLE 16–32 ORB Level ................................................................................................................. 228
TABLE 16–33 JVM Level ................................................................................................................. 229
TABLE 22–1 Remote Commands Required Options ................................................................ 259
TABLE 22–2 Server Lifecycle Commands ................................................................................... 263
TABLE 22–3 List and Status Commands ..................................................................................... 264
TABLE 22–4 Deployment Commands ........................................................................................ 265
TABLE 22–5 Message Queue Commands ................................................................................... 265
TABLE 22–6 Resource Management Commands ...................................................................... 266
TABLE 22–7 General Configuration Commands ...................................................................... 268
TABLE 22–8 IIOP Listener Commands ...................................................................................... 269
TABLE 22–9 Lifecycle Module Commands ................................................................................ 269
TABLE 22–10 Profiler and JVM Options Commands ................................................................. 270
TABLE 22–11 Virtual Server Commands ...................................................................................... 270
TABLE 22–12 Threadpool Commands ......................................................................................... 271
TABLE 22–13 Transaction Commands ......................................................................................... 271
TABLE 22–14 User Management Commands .............................................................................. 272
TABLE 22–15 Monitoring Data Commands ................................................................................ 272
TABLE 22–16 Rules Commands .................................................................................................... 272
TABLE 22–17 Database Commands .............................................................................................. 273
TABLE 22–18 Diagnostic and Logging Commands .................................................................... 273
TABLE 22–19 Web Service Commands ........................................................................................ 274
TABLE 22–20 Security Commands ................................................................................................ 275
TABLE 22–21 Password Commands ............................................................................................. 276
16 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Tables
17
18
Examples
19
20
Preface
The Sun Java System Administration Guide describes how to configure, manage, and deploy the
Application Server subsystems and components.
Chapter Description
Chapter 2, “JDBC Resources” Describes JDBC resources (data source) provides applications with a means of
connecting to a database.
Chapter 3, “Configuring Java Message Service Describes how to configure resources for applications that use the Java
Resources” Message Service (JMS) API.
Chapter 4, “Configuring JavaMail Resources” Describes JavaMail Resources, a set of abstract APIs that model a mail system
Chapter 5, “JNDI Resources” Explains JNDI resources, which are used for accessing different kinds of
naming and directory services.
21
Preface
Chapter 9, “Configuring Message Security” Describes message security for the Application Server.
Chapter 10, “Transactions” Provides information on how to configure transactions in the Application
Server.
Chapter 11, “Configuring the HTTP Service” Describes how to deploy web applications and make deployed web
applications accessible by HTTP clients.
Chapter 12, “Managing Web Services” Describes web services management with Application Server.
Chapter 13, “Configuring the Object Request Describes how to configure the Object Request Broker (ORB) and IIOP
Broker” listeners.
Chapter 14, “Thread Pools” Describes how to create, edit, and delete thread pools in Application Server.
Chapter 15, “Configuring Logging” Describes how to use the Admin Console to configure logging and view the
server log.
Chapter 16, “Monitoring Components and Services” Contains information about monitoring components using the Application
Server Admin Console
Chapter 17, “Configuring Management Rules” Contains information about setting administration policies to automate
routine administration tasks, configure self-tuning of the application server
for diverse runtime condition and improve availability by preventing failures.
Chapter 18, “Configuring the Diagnostic Service” Explains the diagnostic framework and describes how to generate reports.
Chapter 19, “Java Virtual Machine and Advanced Explains how to configure JVM settings.
Settings”
Chapter 20, “Automatically Restarting a Domain” Describes automatic restart on various platforms including Windows and
Linux.
Chapter 21, “Dotted Name Attributes for Describes the dotted name attributes that can be used to address the MBean
domain.xml” and its attributes.
Chapter 22, “The asadmin Utility” Describes the command-line administration utility known as asadmin.
22 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Preface
Documentation Center Application Server documentation topics organized by task and subject.
Release Notes 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 How to get started with the Application Server product.
Application Deployment Guide Deployment of applications and application components to the Application Server. Includes
information about deployment descriptors.
Developer’s Guide Creating and implementing Java Platform, Enterprise Edition (Java EE platform)
applications intended to run on the Application Server that follow the open Java standards
model for Java EE components and APIs. Includes information about developer tools,
security, debugging, and creating lifecycle modules.
Java EE 5 Tutorial Using Java EE 5 platform technologies and APIs to develop Java EE applications.
Administration Guide Configuring, managing, and deploying Application Server subsystems and components from
the Admin Console.
Upgrade and Migration Guide Migrating your applications to the new Application Server programming model, specifically
from Application Server 6.x, and 7.x, and 8.x. This guide also describes differences between
adjacent product releases and configuration options that can result in incompatibility with
the product specifications.
Reference Manual Utility commands available with the Application Server; written in man page style. Includes
the asadmin command line interface.
Related Books
■ Message Queue documentation: http://docs.sun.com/app/docs/coll/1307.4
■ Directory Server documentation: http://docs.sun.com/app/docs/coll/1224.3
■ Web Server documentation: http://docs.sun.com/app/docs/coll/1653.1
The URL for all documentation about Sun Java Enterprise System (Java ES) and its components
is http://docs.sun.com/prod/entsys.06q3.
You can find a directory of URLs for the official specifications at install-dir/docs/index.htm.
Additionally, the following resources might be useful.
23
Preface
Core J2EE Patterns: Best Practices and Design Strategies by Deepak Alur, John Crupi, & Dan
Malks, Prentice Hall Publishing
Java Threads, 2nd Edition, by Scott Oaks & Henry Wong, O’Reilly Publishing
Database Programming with JDBC and Java, by George Reese, O’Reilly Publishing
JDBC Database Access With Java: A Tutorial and Annotated Reference (Java Series), by Graham
Hamilton, Rick Cattell, & Maydene Fisher
JavadocTM Tool:
A Javadoc tool reference for packages provided with the Application Server is located in
install-dir/docs/api.
24 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Preface
install-dir Represents the base installation directory for SolarisTM and Linux operating system installations, non-root user:
Application Server.
user’s-home-directory/SUNWappserver
Solaris and Linux installations, root user:
/opt/SUNWappserver
Windows, all installations:
SystemDrive:\Sun\AppServer
Typographic Conventions
The following table describes the typographic changes that are used in this book.
AaBbCc123 The names of commands, files, and directories, and Edit your .login file.
onscreen computer output
Use ls -a to list all files.
machine_name% you have mail.
AaBbCc123 What you type, contrasted with onscreen computer output machine_name% su
Password:
AaBbCc123 A placeholder to be replaced with a real name or value The command to remove a file is rm
filename.
AaBbCc123 Book titles, new terms, and terms to be emphasized (note Read Chapter 6 in the User's Guide.
that some emphasized items appear bold online)
A cache is a copy that is stored locally.
Do not save the file.
25
Preface
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 either the y
required command option. argument or the n argument.
- Joins simultaneous multiple Control-A Press the Control key while you press the A
keystrokes. key.
+ Joins consecutive multiple Ctrl+A+N Press the Control key, release it, and then press
keystrokes. the subsequent keys.
→ Indicates menu item selection in a File → New → Templates From the File menu, choose New. From the
graphical user interface. New submenu, choose Templates.
26 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Preface
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.
27
28
1
C H A P T E R
Getting Started
1
This chapter describes the Sun JavaTM System Application Server system administration.
Administering the Application Server includes many tasks such as creating and deploying
applications, monitoring and managing performance, and diagnosing and troubleshooting
problems. This chapter contains following sections:
■ “About the Sun Java System Application Server” on page 29
■ “About the Administration Console” on page 35
■ “Configuring the Application Server” on page 36
■ “Configuration Changes” on page 38
■ “Further Information” on page 39
29
About the Sun Java System Application Server
Key Features
The Sun Java System Application Server includes the following key features:
■ Java EE Platform Support — This release implements all of the specifications covered by
the Java EE platform. For a complete list of the Java EE technologies included, see “Java EE 5
Platform APIs” in Sun Java System Application Server Platform Edition 9 Release Notes.
30 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
About the Sun Java System Application Server
■ JavaServer Faces 1.2 — Application Server supports JavaServer Faces, which simplifies
building user interfaces for Java Server applications. Developers can quickly build web
applications by assembling reusable user-interface components in a page, connecting the
components to an application data source, and wiring client-generated events to server-side
event handlers.
■ JavaServer Pages Standard Tag Library 1.2 — The Application Server supports the
JavaServer Pages Standard Tag Library (JSTL) 1.2, which encapsulates core functionality
common to many JSP applications.
■ Administrative Tools — The Application Server includes a command-line tool and a
browser-based Administration Console graphical user interface.
■ High Performance Message Delivery — This product supports concurrent message
delivery with the Sun Java System Message Queue software.
■ Developer Tool Integration — The Application Server supports the NetBeans Integrated
Development Environment and Sun Java Studio Creator.
32 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
About the Sun Java System Application Server
■ Web Services — On the Java EE platform, it is possible to deploy a Web application that
provides a Web service implemented by Java API for XML-Based RPC (JAX-RPC). A Java
EE application or component can also be a client to other Web services. Applications access
XML registries through the Java API for XML Registries (JAXR).
■ Services for Applications — The Java EE platform was designed so that the containers
provide services for applications. Figure 1–1 shows the following services:
■ Naming — A naming and directory service binds objects to names. A Java EE
application locates an object by looking up its JNDI name. JNDI stands for the Java
Naming and Directory Interface API.
■ Security — The Java Authorization Contract for Containers (JACC) is a set of security
contracts defined for the Java EE containers. Based on the client’s identity, the containers
restrict access to the container’s resources and services.
■ Transaction management — A transaction is an indivisible unit of work. For example,
transferring funds between bank accounts is a transaction. A transaction management
service ensures that a transaction either completes fully or is rolled back.
Admin Console
The Admin Console is a browser-based tool that features an easy-to-navigate interface and
online help. The administration server must be running to use the Admin Console.
When the Application Server was installed, you chose a port number for the server, or used the
default port of 4848. You also specified a user name and master password.
http://hostname:port
For example:
http://kindness.sun.com:4848
If the Admin Console is running on the machine on which the Application Server was installed,
specify localhost for the host name.
On Windows, start the Application Server Admin Console from the Start menu.
The installation program creates the default administrative domain (named domain1) with the
default port number 4848, as well as an instance separate from the domain administration
server (DAS). After installation, additional administration domains can be created. Each
domain has its own domain administration server, which has a unique port number. When
specifying the URL for the Admin Console, be sure to use the port number for the domain to be
administered.
asadmin Utility
The asadmin utility is a command-line tool. Use the asadmin utility and the commands
associated with it to perform the same set of tasks that can be performed in the Admin Console.
For example, start and stop domains, configure the server, and deploy applications.
Use these commands either from a command prompt in the shell, or call them from other
scripts and programs. Use these commands to automate repetitive administration tasks.
$ asadmin
34 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
About the Administration Console
asadmin> help
$ asadmin help
To view a command’s syntax and examples, type help followed by the command name. For
example:
The asadmin help information for a given command displays the UNIX man page of the
command. These man pages are also available in HTML format.
For more information on using the Application Server Management Extension, see Chapter 20,
“Using the Application Server Management Extensions,” in Sun Java System Application Server
Platform Edition 9 Developer’s Guide.
The online help includes conceptual topics that are not context-sensitive. To view one of these
topics, select it from the table of contents in the help browser window.
Creating a Domain
Domains are created using the create-domain command. The following example command
creates a domain named mydomain. The administration server listens on port 1234 and the
administrative user name is admin. The command prompts for the administrative and master
passwords.
To start the Admin Console for mydomain domain, in a browser, enter the following URL:
http://hostname:80
For the preceding create-domain example, the domain’s log files, configuration files, and
deployed applications now reside in the following directory:
domain-root-dir/mydomain
To create the domain’s directory in another location, specify the --domaindir option. For the
full syntax of the command, type asadmin help create-domain.
36 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Configuring the Application Server
Deleting a Domain
Domains are deleted using the asadmin delete-domain command. Only the operating system
user (or root) who can administer the domain can execute this command successfully. To delete
a domain named mydomain, for example, type the following command:
Listing Domains
The domains created on a machine can be found using the asadmin list-domains command.
To list the domains in the default domain-root-dir directory, type this command:
$ asadmin list-domains
To list domains that were created in other directories, specify the --domaindir option.
To start a domain, type the asadmin start-domain command and specify the domain name.
For example, to start the default domain (domain1), type the following:
For the full command syntax, type asadmin help start-domain. If the password data is
omitted, you are prompted to supply it.
To stop a domain, type the asadmin stop-domain command and specify the domain name. For
example, to stop the default domain (domain1), type the following:
If there is only one domain, then the domain name is optional. For the full syntax, type asadmin
help stop-domain.
Configuration Changes
When making configuration changes, you may need to restart the server for the changes to take
effect. The following sections identify when you will need to restart the server for each
configuration change:
■ “Changing Application Server Configuration” on page 38
■ “Ports in the Application Server” on page 38
38 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Further Information
Administrative server 4848 A domain’s administrative server is accessed by the Admin Console and the asadmin utility.
For the Admin Console, specify the port number in the URL of the browser. When
executing an asadmin command remotely, specify the port number with the --port option.
HTTP 8080 The Web server listens for HTTP requests on a port. To access deployed Web applications
and services, clients connect to this port.
HTTPS 8181 Web applications configured for secure communications listen on a separate port.
IIOP Remote clients of enterprise beans (EJB components) access the beans through the IIOP
listener.
IIOP, SSL Another port is used by the IIOP listener configured for secure communications.
IIOP, SSL and mutual Another port is used by the IIOP listener configured for mutual (client and server)
authentication authentication.
Further Information
■ Sun Microsystems Worldwide Training - Over 250,000 students each year are trained by
Sun and its authorized centers through Web-based courses and at over 250 training sites
located in more than 60 countries.
■ The Java EE 5 Tutorial — written for developers, the tutorial has administrative instructions
for configuring JMS, setting up JavaMail resources, and managing security.
■ Sun Java System Application Server Platform Edition 9 Developer’s Guide contains
development information that is specific to the Application Server.
■ Sun Java System Application Server Platform Edition 9 Reference Manual provides a
reference all the application server command-line utilities including the asadmin
commands.
■ Sun Java System Application Server Platform Edition 9 Release Notes provide the most
up-to-date information on the product release.
■ Sun Product Documentation - To access all of our product documentation, see
http://docs.sun.com.
■ Java EE Documentation page- Contains links to the technical documentation for the Java EE
platform: .
■ Sun Java System Application Server Platform Edition 9 Quick Start Guide shows you how to
deploy and run a simple Web application. In addition to being online, the guide is provided
in the install-dir/docs/QuickStart.html file.
JDBC Resources
2
A JDBC resource (data source) provides applications with a means of connecting to a database.
Typically, the administrator creates a JDBC resource for each database accessed by the
applications deployed in a domain. (However, more than one JDBC resource can be created for
a database.)
To create a JDBC resource using the Admin Console, select Resources > JDBC Resources.
Specify the resources settings as follows:
41
About JDBC Connection Pools
■ JNDI Name: Specify a unique name. The JNDI name organizes and locates components
within a distributed computing environment similarly to the way that card catalogs organize
and represent locations of books in a library. Consequently, the JNDI name becomes an
important method of accessing the JDBC resource. By convention, the name begins with the
jdbc/ string. For example: jdbc/payrolldb. Don’t forget the forward slash.
■ Pool Name: Choose the connection pool to be associated with the new JDBC resource.
■ Description: Type a short description of the resource.
■ Status: If you want the resource to be unavailable, deselect the Enabled checkbox. By default,
the resource is available (enabled) as soon as it is created.
A JDBC connection pool is a group of reusable connections for a particular database. Because
creating each new physical connection is time consuming, the server maintains a pool of
available connections to increase performance. When an application requests a connection, it
obtains one from the pool. When an application closes a connection, the connection is returned
to the pool.
Certain data specific to the JDBC driver and the database vendor must be entered. Before
proceeding, gather the following information:
■ Database vendor name
■ Resource type, such as javax.sql.DataSource (local transactions only)
javax.sql.XADataSource (global transactions)
■ Data source class name: If the JDBC driver has a Datasource class for the resource type and
database, then the value of the Datasource Classname field is required.
■ Required properties, such as the database name (URL), user name, and password
42 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Configurations for Specific JDBC Drivers
For an up to date list of currently supported JDBC drivers, see the Sun Java System Application
Server Platform Edition 9 Release Notes.
Other JDBC drivers can be used with Application Server , but Java EE compliance tests have not
been completed with these drivers. Although Sun offers no product support for these drivers,
Sun offers limited support of the use of these drivers with Application Server .
■ “MM MySQL Type 4 Driver (XA Only)” on page 50
■ “JConnect Type 4 Driver for Sybase ASE 12.5 and 15 Databases” on page 51
■ “Inet Oraxo JDBC Driver for Oracle 9i and 10g Databases” on page 51
■ “Inet Merlia JDBC Driver for Microsoft SQL Server Databases” on page 52
■ “Inet Sybelux JDBC Driver for Sybase Databases” on page 53
■ “OCI Oracle Type 2 Driver for Oracle 9i and 10g Databases” on page 53
■ “IBM Informix Type 4 Driver” on page 54
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 Java System
Application Server Platform Edition 9 Reference Manual.
org.apache.derby.jdbc.ClientDataSource
org.apache.derby.jdbc.ClientXADataSource
■ Properties:
■ 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.
44 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Configurations for Specific JDBC Drivers
46 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Configurations for Specific JDBC Drivers
LD_LIBRARY_PATH=/usr/db2user/sqllib/lib:${j2ee.home}/lib
DB2DIR=/opt/IBM/db2/V8.1
DB2INSTANCE=db2user
INSTHOME=/usr/db2user
VWSPATH=/usr/db2user/sqllib
THREADS_FLAG=native
oracle.jdbc.pool.OracleDataSource
oracle.jdbc.xa.client.OracleXADataSource
■ Properties:
■ user - Set as appropriate.
■ password - Set as appropriate.
■ URL - Specify the complete database URL using the following syntax:
jdbc:oracle:thin:[user/password]@host[:port]/service
For example:
jdbc:oracle:thin:@localhost:1521:customer_db
■ xa-driver-does-not-support-non-tx-operations - Set to the value true. Optional:
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.
com.microsoft.sqlserver.jdbc.SQLServerDataSource
com.microsoft.sqlserver.jdbc.SQLServerXADataSource
■ Properties:
■ serverName - Specify the host name or IP address and the port of the database server.
This is optional. This could be a DNS or IP address, or it could be localhost or
127.0.0.1 for the local computer.
48 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Configurations for Specific JDBC Drivers
com.mysql.jdbc.jdbc2.optional.MysqlDataSource
■ Properties:
■ serverName - Specify the host name or IP address of the database server.
■ port - Specify the port number of the database server.
■ user - Set as appropriate.
■ password - Set as appropriate.
■ databaseName - Set as appropriate.
■ URL - If you are using global transactions, you can set this property instead of
serverName, port, and databaseName.
The MM MySQL Type 4 driver doesn’t provide a method to set the required
relaxAutoCommit property, so you must set it indirectly by setting the URL property:
jdbc:mysql://host:port/database?relaxAutoCommit="true"
com.mysql.jdbc.jdbc2.optional.MysqlXADataSource
■ Properties:
■ serverName - Specify the host name or IP address of the database server.
■ port - Specify the port number of the database server.
■ user - Set as appropriate.
■ password - Set as appropriate.
■ databaseName - Set as appropriate.
■ URL - If you are using global transactions, you can set this property instead of
serverName, port, and databaseName.
50 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Configurations for Specific JDBC Drivers
The MM MySQL Type 4 driver doesn’t provide a method to set the required
relaxAutoCommit property, so you must set it indirectly by setting the URL property:
jdbc:mysql://host:port/database?relaxAutoCommit="true"
com.sybase.jdbc2.jdbc.SybDataSource
com.sybase.jdbc2.jdbc.SybXADataSource
■ 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.
■ databaseName - Set as appropriate. Do not specify the complete URL, only the database
name.
■ BE_AS_JDBC_COMPLIANT_AS_POSSIBLE - Set to true.
■ FAKE_METADATA - Set to true.
■ Properties:
■ user - Specify the database user.
■ password - Specify the database password.
■ serviceName - Specify the URL of the database. The syntax is as follows:
jdbc:inetora:server:port:dbname
For example:
jdbc:inetora:localhost:1521:payrolldb
In this example,localhost is the host name of the machine 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.
■ serverName - Specify the host name or IP address of the database server.
■ port - Specify the port number of the database server.
■ 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. Optional:
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.
52 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Configurations for Specific JDBC Drivers
oracle.jdbc.pool.OracleDataSource
oracle.jdbc.xa.client.OracleXADataSource
■ Properties:
■ user - Set as appropriate.
■ password - Set as appropriate.
■ URL - Specify the complete database URL using the following syntax:
jdbc:oracle:oci:[user/password]@host[:port]/service
For example:
jdbc:oracle:oci:@localhost:1521:customer_db
■ xa-driver-does-not-support-non-tx-operations - Set to the value true. Optional:
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.
com.informix.jdbcx.IfxDataSource
com.informix.jdbcx.IfxXADataSource
■ Properties:
■ serverName - Specify the Informix database server name.
■ portNumber - Specify the port number of the database server.
■ user - Set as appropriate.
■ password - Set as appropriate.
■ databaseName - Set as appropriate. This is optional.
■ IfxIFXHost - Specify the host name or IP address of the database server.
54 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
3
C H A P T E R 3
This chapter describes how to configure resources for applications that use the Java Message
Service (JMS) API. It contains the following sections:
■ “About JMS Resources” on page 55
■ “JMS Connection Factories” on page 57
■ “JMS Destination Resources” on page 58
■ “JMS Physical Destinations” on page 58
■ “JMS Providers” on page 59
■ “Foreign JMS Providers” on page 60
For details about administering Message Queue, see the Message Queue Administration Guide.
JMS Resources
The Java Message Service (JMS) API uses two kinds of administered objects:
55
About JMS Resources
■ Connection factories, objects that allow an application to create other JMS objects
programmatically
■ Destinations, which serve as the repositories for messages
These objects are created administratively, and how they are created is specific to each
implementation of JMS. In the Application Server, you can perform the following tasks:
■ Create a connection factory by creating a connection factory resource
■ Create a destination by creating two objects:
■ A physical destination
■ A destination resource that refers to the physical destination
JMS applications use the 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. To
learn what resources to create, study the application or consult with the application developer.
The chapters on JMS in the J2EE 1.4 Tutorial provide details on these two types of
communication and other aspects of JMS (see
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/index.html).
The order in which the resources are created does not matter.
For a Java EE application, specify connection factory and destination resources in the
Application Server deployment descriptors as follows:
■ Specify a connection factory JNDI name in a resource-ref or an
mdb-connection-factory element.
■ Specify a destination resource JNDI name in the ejb element for a message-driven bean and
in the message-destination element.
■ Specify a physical destination name in a message-destination-link element, within either
a message-driven element of an enterprise bean deployment descriptor or a
message-destination-ref element. In addition, specify it in the message-destination
element. (The message-destination-ref element replaces the resource-env-ref
56 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
JMS Connection Factories
See also:
■ “The Relationship Between JMS Resources and Connector Resources” on page 57
For each JMS connection factory that a user creates, the Application Server creates a connector
connection pool and connector resource. For each JMS destination that a user creates, the
Application Server creates an admin object resource. When the user deletes the JMS resources,
the Application Server automatically deletes the connector resources.
It is possible to create connector resources for the JMS system resource adapter by using the
Connectors node of the Admin Console instead of the JMS Resources node.
See also:
■ “JMS Resources” on page 55
list-jms-resources
delete-jms-resource
delete-jms-resource
flush-jmsdest
delete-jmsdest
58 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
JMS Providers
JMS Providers
Values of all these properties can be updated at run time too. However, only those connection
factories that are created after the properties are updated, will get the updated values. The
existing connection factories will continue to have the original property values. Also, for almost
all of the values to take effect, the application server needs to be restarted. The only property
that can be updated without having to restart the application server is the default JMS host.
For detailed descriptions of all the settings and properties mentioned above, you can see the
Admin Console Online Help.
jms-ping
Overall, the Resource Adapter can be configured to indicate whether the JMS provider supports
XA or not. It is also possible to indicate what mode of integration is possible with the JMS
provider. Two modes of integration are supported by the resource adapter. The first one uses
JNDI as the means of integration. In this case, 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.
You can use the Sun Java System Application Server's Admin Console or the CLI to configure
the resource adapter. This is not different from configuring any other resource adapter.
60 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Foreign JMS Providers
1 Deploy the generic resource adapter the same way you would deploy a connector module.
For steps to do this, refer to the Admin Console Online Help. During deployment, make sure
that you specify
install-dir/lib/addons/resourceadapters/genericjmsra/genericra.rar as the location
of the generic resource adapter. Also, you must specify the properties explained in the section
“Resource Adapter Properties” on page 61.
5 Make the following changes to the security policy in Sun Java System Application Server.
ConnectionFactoryClassName
Name of the class None Class name of
available in the appserver javax.jms.ConnectionFactory
classpath, for example, implementation of the
com.sun.messaging.ConnectionFactory jms client. Used if
ProviderIntegrationMode
is javabean.
QueueConnectionFactoryClassName
Name of the class None Class name of
available in the appserver javax.jms.QueueConnectionFactory
classpath, for example, implementation of the
com.sun.messaging.QueueConnectionFactory jms client. Used if
ProviderIntegrationMode
is javabean.
TopicConnectionFactoryClassName
Name of the class None Class name of
available in the appserver javax.jms.TopicConnectionFactory
classpath , for example, implementation of the
com.sun.messaging.TopicConnectionFactory jms client. Used if
ProviderIntegrationMode
is specified as javabean.
XAConnectionFactoryClassName
Name of the class None Class name of
available in appserver javax.jms.ConnectionFactory
classpath , for example, implementation of the
com.sun.messaging.XAConnectionFactory jms client. Used if
ProviderIntegrationMode
is specified as javabean.
XAQueueConnectionFactoryClassName
Name of the class None Class name of
available in appserver javax.jms.XAQueueConnectionFactory
classpath , for example, implementation of the
com.sun.messaging.XAQueueConnectionFactory JMS client. Used if
ProviderIntegrationMode
is specified as javabean.
XATopicConnectionFactoryClassName
Name of the class None Class name of
available in appserver javax.jms.XATopicConnectionFactory
classpath , for example, implementation of the
com.sun.messaging.XATopicConnectionFactory JMS client. Used if
ProviderIntegrationMode
is javabean.
62 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Foreign JMS Providers
ConnectionFactoryProperties
Name value pairs None Specifies the javabean
separated by comma property names and
values of the
ConnectionFactory of the
JMS client. Required only
if
ProviderIntegrationMode
is javabean.
CommonSetterMethodName
Method name None Specifies the common
setter method name that
some JMS vendors use to
set the properties on their
administered objects.
Used only if
ProviderIntegrationMode
is javabean. In the case of
Sun Java System Message
Queue, this property is
named setProperty.
64 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Foreign JMS Providers
ManagedConnectionFactory Properties
ManagedConnectionFactory properties are specified when a connector-connection-pool is
created. All the properties specified while creating the resource adapter can be overridden in a
ManagedConnectionFactory. Additional properties available only in
ManagedConnectionFactory are given below.
ConnectionFactoryJndiName
JNDI Name None JNDI name of the
connection factory bound
in the JNDI tree of the
JMS provider. The
administrator should
provide all connection
factory properties (except
clientID) in the JMS
provider itself. This
property name will be
used only if
ProviderIntegratinMode
is jndi.
ConnectionValidationEnabled
true/false FALSE If set to true, the resource
adapter will use an
exception listener to catch
any connection exception
and will send a
CONNECTION_ERROR_OCCURED
event to application
server.
66 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Foreign JMS Providers
ConnectionFactoryJndiName
A valid Jndi Name None JNDI name of connection
factory created in JMS
provider. This connection
factory will be used by
resource adapter to create
a connection to receive
messages. Used only if
ProviderIntegrationMode
is configured as jndi.
68 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Foreign JMS Providers
DeadMessageDestinationJndiName
a valid JNDI name. None JNDI name of the
destination created in the
JMS provider. This is the
target destination for
dead messages. This is
used only if
ProviderIntegrationMode
is jndi.
DeadMessageDestinationClassName
class name of destination None Used if
object. ProviderIntegrationMode
is javabean.
DeadMessageDestinationProperties
Name Value Pairs None Specifies the javabean
separated by comma property names and
values of the destination
of the JMS client. This is
required only if
ProviderIntegrationMode
is javabean.
The Application Server includes the JavaMail API. The JavaMail API is a set of abstract APIs
that model a mail system. The API provides a platform-independent and protocol-independent
framework to build mail and messaging applications. The JavaMail API provides facilities for
reading, composing, and sending electronic messages. Service providers implement particular
protocols. Using the JavaMail 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. It
does not provide mail server functionality; you must have access to a mail server to use
JavaMail.
To learn more about the JavaMail API, consult the JavaMail web site at
http://java.sun.com/products/javamail/index.html
This chapter contains the following section:
■ “Creating a JavaMail Session” on page 71
71
Creating a JavaMail Session
■ Mail Host: The host name of the default mail server. The connect methods of the Store and
Transport objects use this value if a protocol-specific host property is not supplied. The
name must be resolvable to an actual host name.
■ Default User: The user name to provide when connecting to a mail server. The connect
methods of the Store and Transport objects use this value if a protocol-specific username
property is not supplied.
■ Default Return Address: The email address of the default user, in the form:
[email protected].
■ Description: Provide a descriptive statement for the component.
■ Session: Deselect the Enabled checkbox if you do not want to enable the mail session at this
time.
Additionally, define the following Advanced settings only if the mail provider has been
re-configured to use a non-default store or transport protocol:
■ Store Protocol: Defines the Store object communication method to be used. By default, the
Store Protocol is imap.
■ Store Protocol Class: Provides the Store communication method class that implements the
desired Store protocol. By default, the Store Protocol Class is
com.sun.mail.imap.IMAPStore.
■ Transport Protocol: Identifies the transport communication method. By default, the
Transport Protocol is smtp.
■ Transport Protocol Class: Defines the communication method for the transport class. By
default, the Transport Protocol Class is com.sun.mail.smtp.SMTPTransport
■ Debug: Select this checkbox to enable extra debugging output, including a protocol trace,
for this mail session.If the JavaMail log level is set to FINE or finer, the debugging output is
generated and is included in the system log file. See “Configuring Log Levels” on page 186 for
information about setting the log level.
■ Additional Properties: Create properties required by applications, such as a
protocol-specific host or username property. The JavaMail API documentation lists the
available properties.
72 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
5
C H A P T E R
JNDI Resources
5
The Java Naming and Directory Interface (JNDI) is an application programming interface
(API) for accessing different kinds of naming and directory services. Java EE components locate
objects by invoking the JNDI lookup method.
JNDI is the acronym for the Java Naming and Directory Interface API. By making calls to this
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 Application
Server. To create a new resource, a new name-object binding is entered into the JNDI.
Java EE application clients, enterprise beans, and web components are required to have access
to a JNDI naming environment.
73
Naming References and Binding Information
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 name of the resource reference are not the same. This
approach to naming requires that you map the two names before deployment, but it also
de-couples components from resources. Because of this de-coupling, if at a later time the
component needs to access a different resource, the name does not need to change. This
flexibility also makes it easier for you to assemble Java EE applications from preexisting
components.
The following table lists JNDI lookups and their associated references for the Java EE resources
used by the Application Server.
74 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Using External JNDI Repositories and Resources
<resources>
<!-- external-jndi-resource element specifies how to access J2EE resources
-- stored in an external JNDI repository. The following example
-- illustrates how to access a java object stored in LDAP.
-- factory-class element specifies the JNDI InitialContext factory that
-- needs to be used to access the resource factory. property element
-- corresponds to the environment applicable to the external JNDI context
-- and jndi-lookup-name refers to the JNDI name to lookup to fetch the
-- designated (in this case the java) object.
-->
<external-jndi-resource jndi-name="test/myBean"
jndi-lookup-name="cn=myBean"
res-type="test.myBean"
factory-class="com.sun.jndi.ldap.LdapCtxFactory">
<property name="PROVIDER-URL" value="ldap://ldapserver:389/o=myObjects" />
<property name="SECURITY_AUTHENTICATION" value="simple" />
<property name="SECURITY_PRINCIPAL", value="cn=joeSmith, o=Engineering" />
<property name="SECURITY_CREDENTIALS" value="changeit" />
</external-jndi-resource>
</resources>
76 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
6
C H A P T E R
Connectors
6
A connector module (also called a resource adapter), is a Java component that enables
applications to interact with enterprise information systems (EISs). EIS software includes
various types of systems: enterprise resource planning (ERP), mainframe transaction
processing, and non-relational databases, among others. To install a connector module you
deploy it, as you do for other Java modules.
A connector connection pool is a group of reusable connections for a particular EIS. To create a
connector connection pool, specify the connector module (resource adapter) that is associated
with the pool.
77
Connector Connection Pools
Parameter Description
Initial and Minimum Pool Size The minimum number of connections in the pool. This value also determines the
number of connections placed in the pool when the pool is first created or when
application server starts.
Pool Resize Quantity When the pool shrinks toward the minimum pool size it is resized in batches. This
value determines the number of connections in the batch. Making this value too large
will delay connection recycling; making it too small will be less efficient.
Idle Timeout The maximum time in seconds that a connection can remain idle in the pool. After
this time expires, the connection will be removed from the pool.
Max Wait Time The amount of time the application that has requested a connection will wait before
getting a connection time-out. Because the default wait time is long, the application
might appear to hang indefinitely.
On Any Failure If you select the checkbox labelled Close All Connections, if a single connection fails,
then the application server will close all connections in the pool and then reestablish
them. If you do not select the checkbox, then individual connections will be
reestablished only when they are used.
Transaction Support Use the Transaction Support list to select the type of transaction support for the
connection pool. The chosen transaction support overrides the transaction support
attribute in the resource adapter associated with this connection pool in a downward
compatible way. In other words, it can support a lower transaction level than that
specified in the resource adapter or the same transaction level as that specified in
resource adapter, but it cannot specify a higher level.
The None selection from the Transaction Support menu indicates that the resource
adapter does not support resource manager local or JTA transactions and does not
implement XAResource or LocalTransaction interfaces. For JAXR resource
adapters, you need to choose None from the Transaction Support menu. JAXR
resource adapters do not support local or JTA transactions.
Local transaction support means that the resource adapter supports local transactions
by implementing the LocalTransaction interface. Local transactions are managed
internal to a resource manager and involve no external transaction managers.
XA transaction support means that the resource adapter supports resource manager
local and JTA transactions by implementing the LocalTransaction and XAResource
interfaces. XA transactions are controlled and coordinated by a transaction manager
external to a resource manager. Local transactions are managed internal to a resource
manager and involve no external transaction managers.
Connector Validation Select the Enabled checkbox if you want the connection pool to be validated before
being passed on to the application.
78 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Administered Object Resources
Before creating a connection pool, you need to deploy the connector module (resource adapter)
associated with the pool. You can deploy a connector module using the Admin Console or by
using the asadmin command. For information about the asadmincommand see, asadmin(1M)
To view, create, edit, or delete connection pools in the Admin Console, click Resources >
Connectors > Connector Connection Pools. You can add properties (a name-value pair) to a
connector connection pool. Alternatively, you can use the following asadmin commands to
create and delete connection pools:
■ create-connector-connection-pool(1)
■ delete-connector-connection-pool(1)
Connector Resources
A connector resource provides an application with a connection to an Enterprise Information
System (EIS). Every connector resource is associated with a connection pool. To view, create,
edit, or delete connector resources, click Resources > Connectors > Connector Resources in the
Admin Console. Alternatively, you can use the following asadmin commands to create and
delete connection resources:
■ create-connector-resource(1)
■ delete-connector-resource(1)
Chapter 6 • Connectors 79
80
7
C H A P T E R
Java EE Containers
7
This chapter explains how to configure the Java EE containers included in the server. This
chapter contains following sections:
■ “About the Java EE Containers” on page 81
■ “Configuring Java EE 5 Containers” on page 82
81
Configuring Java EE 5 Containers
There are three types of enterprise beans: session beans, entity beans, and message-driven
beans. Session beans represent transient objects and processes and typically are used by a single
client. Entity beans represent persistent data, typically maintained in a database.
Message-driven beans are used to pass messages asynchronously to application modules and
services.
The container is responsible for creating the enterprise bean, binding the enterprise bean to the
naming service so other application components can access the enterprise bean, ensuring only
authorized clients have access to the enterprise bean’s methods, saving the bean’s state to
persistent storage, caching the state of the bean, and activating or passivating the bean when
necessary.
Sun Java System Application Server 9 conforms to Java EE 5 and EJB 3.0 specifications
Therefore a JNDI name will be no longer be required for EJB 3.0 session beans that expose a
Remote view. If a deployed Remote EJB 3.0 bean does not provide a global JNDI name, the
container will assign it one at runtime. The assigned JNDI name is the fully qualified class name
of the remote EJB's business interface. In addition, EJB clients that use the new Remote EJB 3.0
client view will not be required to map their remote @EJB references to a global JNDI name
within sun-ejb-jar.xml. If a JNDI name has not been associated with the ejb reference, the
container will derive the default JNDI name for the target EJB from its associated business
interface.
Applications using this EJB 3.0 feature will no longer need sun-ejb-jar.xml or
sun-application-client.xml configuration files. The older method of providing a JNDI
name in sun-ejb-jar.xml will continue to work. It will also be possible for the application to
map an ejb-reference or @EJB reference to a specific global JNDI name.
See Also:
■ “Configuring the General EJB Settings” on page 85
82 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Configuring Java EE 5 Containers
In the Admin Console, go to Configuration> Web Container > Session Properties. In the
Session Timeout field, enter the number of seconds that a session is valid.
For detailed instructions on setting the session timeout value, Click Help in the Admin Console.
■ “Configuring Manager Properties” on page 83
■ “Configuring Store Properties” on page 84
To change the session manager settings in the Admin Console, go to Configuration> Web
Container > Manager Properties.
package com.sun.enterprise.util.uuid;
For detailed instructions on setting the manager properties, Click Help in the Admin Console.
■ “Configuring Store Properties” on page 84
■ “The Web Container” on page 81
For detailed instructions on setting the session store properties, Click Help in the Admin
Console.
84 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Configuring Java EE 5 Containers
To override the defaults on a per-container basis, adjust the values in the enterprise bean’s
sun-ejb-jar.xml file. For details, see the Sun Java System Application Server Platform Edition 9
Developer’s Guide.
Passivated beans are enterprise beans that have had their state written to a file on the file system.
Passivated beans typically have been idle for a certain period of time, and are not currently
being accessed by clients.
Similar to passivated beans, persisted HTTP sessions are individual web sessions that have had
their state written to a file on the file system.
The Commit Option field specifies how the container caches passivated entity bean instances
between transactions.
Option B caches entity bean instances between transactions, and is selected by default. Option
C disables caching.
If you experience performance problems in an application that uses deployed enterprise beans,
creating a pool, or increasing the number of beans maintained by an existing pool, can help
increase the application’s performance.
To set the EJB pool properties using the Admin Console, go to Configuration > EJB Container >
EJB Settings.
■ Under Pool Settings in the Initial and Minimum Pool Size field enter the minimum number
of beans the container creates in the pool.
■ In the Maximum Pool Size field enter the maximum number of beans the container
maintains in the pool, at any time.
■ In the Pool Resize Quantity field enter the number of beans that will be removed from the
pool if they are idle for more than the time specified in Pool Idle Timeout.
■ In the Pool Idle Timeout field enter the time, in seconds, that a bean in the pool can remain
idle before it will be removed from the pool.
■ Restart the Application Server.
For detailed instructions on configuring the EJB pool, Click Help in the Admin Console.
86 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Configuring Java EE 5 Containers
The NRU policy removes a bean that hasn’t been used recently. The FIFO policy removes
the oldest bean in the cache. The LRU policy removes the least recently accessed bean. By
default, the NRU policy is used by the container.
For detailed instructions on configuring the EJB pool, Click Help in the Admin Console.
To adjust the configuration of this pool using the Admin Console, go to Configuration > EJB
Container > MDB Settings.
■ Under Pool Settings in the Initial and Minimum Pool Size field, enter the minimum number
of message beans the container creates in the pool.
■ In the Maximum Pool Size field, enter the maximum number of beans the container
maintains in the pool, at any time.
■ In the Pool Resize Quantity field, enter the number of beans that are removed from the pool
if they are idle for more than the time specified in Pool Idle Timeout.
■ In the Pool Idle Timeout field, enter the time, in seconds, that a bean in the pool can remain
idle before it is removed from the pool.
■ Restart the Application Server.
For detailed instructions on configuring the MDB settings, Click Help in the Admin Console.
To configure the EJB Timer Service using the Admin Console, go to Configuration > EJB
Container > EJB Timer Service.
■ Set the minimum delivery interval in milliseconds in the Minimum Delivery Interval field.
Minimum Delivery Interval is the minimum number of milliseconds allowed before the
next timer expiration for a particular timer can occur. Setting this interval too low can cause
server overload.
■ Set the maximum number of attempts the timer service makes to deliver the notification in
the Maximum Redeliveries field.
■ Set the interval, in milliseconds, between redelivery attempts in the Redelivery Interval field.
■ Specify the JNDI name of the JDBC resource that will be used as the Timer Datasource.
■ Restart the Application Server.
Sample timer database creation files are provided for Java DB (Derby), PointBase, Oracle,
Sybase, DB2, and MS SQL Server at install-dir/lib/install/databases/.
To use an external database with the Timer Service, first, set up a JDBC resource for the selected
database as described in “Creating a JDBC Resource” on page 41. Then go to Configuration >
EJB Container > EJB Timer Service and enter the JNDI name of the resource in the Timer
DataSource field. Restart the Application Server.
88 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
8
C H A P T E R 8
Configuring Security
This chapter describes some core application server security concepts, and describes how to
configure security for the Application Server. This chapter contains the following topics:
■ “About Application Server Security” on page 89
■ “Configuring Security” on page 106
■ “Configuring Realms” on page 108
■ “Configuring JACC Providers” on page 116
■ “Configuring Audit Modules” on page 117
■ “Configuring Security” on page 106
■ “Configuring Listeners and JMX Connectors” on page 118
■ “Configuring Connector Connection Pools” on page 123
■ “Working with Certificates and SSL” on page 127
■ “Further Information” on page 131
Overview of Security
Security is about protecting data: how to prevent unauthorized access or damage to it in storage
or transit. The Application Server has a dynamic, extensible security architecture based on the
J2EE standard. Built in security features include cryptography, authentication and
authorization, and public key infrastructure. The Application Server is built on the Java security
89
About Application Server Security
model, which uses a sandbox where applications can run safely, without potential risk to
systems or users. The following topics are discussed:
■ “Understanding Application and System Security” on page 90
■ “Tools for Managing Security” on page 90
■ “Managing Security of Passwords” on page 91
■ “Assigning Security Responsibilities” on page 93
In addition to application security, there is also system security, which affects all the applications
on an Application Server system.
Programmatic security is controlled by the application developer, so this document does not
discuss it; declarative security is somewhat less so, and this document touches on it
occasionally. This document is intended primarily for system administrators, and so focuses on
system security.
The Java Enterprise Edition 5 platform (Java EE 5), provides two tools for managing security:
90 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
About Application Server Security
■ keytool, a command-line utility for managing digital certificates and key pairs. Use
keytool to manage users in the certificate realm.
■ policytool, a graphical utility for managing system-wide Java security policies. As an
administrator, you will rarely need to use policytool.
For more information on using keytool, policytool, and other Java security tools, see Java 2
SDK Tools and Utilities at
http://java.sun.com/j2se/1.5.0/docs/tooldocs/index.html#security.
However, use the Admin Console to add users and resources and assign passwords to these
users and resources. Some of these passwords are written to the domain.xml file in clear text, for
example, passwords for accessing a database. Having these passwords in clear text in the
domain.xml file can present a security hazard. You can encrypt any password in domain.xml,
including the admin-password attribute or a database password using the following procedure.
1 From the directory where the domain.xml file resides (domain-dir/config by default), run the
following asadmin command:
asadmin create-password-alias --user admin alias-name
For example,
2 Remove and replace the password in domain.xml using the asadmin set command. For
example:
asadmin set --user admin
server.jms-service.jms-host.default_JMS_host.admin-password=’${ALIAS=jms-password}’
1 Stop the Application Server for the domain. Use the asadmin change-master-password
command, which prompts for the old and new passwords, then re-encrypts all dependent
items. For example,
asadmin change-master-password>
Please enter the new master password>
Please enter the the new master password again>
It is also possible to change the admin password using the Admin Console as in the following
procedure.
92 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
About Application Server Security
5 Click the Manage Users button from the Edit Realm page.
Application Developer
The application developer is responsible for the following:
■ Specifying roles and role-based access restrictions for application components.
■ Defining an application’s authentication method and specifying the parts of the application
that are secured.
An application developer can use tools such as NetBeans to edit application deployment
descriptors. These security tasks are discussed in more detail in the Security chapter of The Java
EE 5 Tutorial, which can be viewed at Java EE 5 Tutorial
(http://java.sun.com/javaee/5/docs/tutorial/doc/index.html).
Application Deployer
The application deployer is responsible for:
■ Mapping users or groups (or both) to security roles.
■ Refining the privileges required to access component methods to suit the requirements of
the specific deployment scenario.
System Administrator
The system administrator is responsible for:
■ Configuring security realms.
■ Managing user accounts and groups.
■ Managing audit logs.
■ Managing server certificates and configuring the server’s use of secure sockets layer
(SSL).
■ Handling other miscellaneous system-wide security features, such as security maps for
connector connection pools, additional JACC Providers, and so on.
A system administrator uses the Admin Console to manage server security settings and
keytool to manage certificates. This document is intended primarily for system administrators.
Authenticating Entities
Authentication is the way 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 may be a user name and password or a digital certificate.
Typically, authentication means a user logging in to an application with a user name and
password; but it might also refer to an EJB providing security credentials when it requests a
resource from the server. Usually, servers or applications require clients to authenticate;
additionally, clients can require servers to authenticate themselves, too. When authentication is
bidirectional, it is called mutual authentication.
When an entity tries to access a protected resource, the Application 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.
94 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
About Application Server Security
Basic HTTP (SSL optional) Uses the server’s built-in None, unless using SSL.
pop-up login dialog box.
Form-based HTTP (SSL optional) Application provides its own None, unless using SSL.
custom login and error pages.
Client Certificate HTTPS (HTTP over Server authenticates the client SSL
SSL) using a public key certificate.
For more information on using NetBeans to configure the authentication method for an
application, see Security chapter of Java EE 5 Tutorial
(http://java.sun.com/javaee/5/docs/tutorial/doc/index.html).
Single sign-on is based on groups. All Web applications whose deployment descriptor defines
the same group and use the same authentication method (basic, form, digest, certificate) share
single sign-on.
Single sign-on is enabled by default for virtual servers defined for the Application Server. For
information on disabling single sign-on, see “To configure single sign-on (SSO)” on page 121.
Authorizing Users
Once a user is authenticated, the level of authorization determines what operations can be
performed. A user’s authorization is based on his role. For example, a human resources
application may authorize managers to view personal employee information for all employees,
but allow employees to view only their own personal information. For more on roles, see
“Understanding Users, Groups, Roles, and Realms” on page 97.
By default, the Application Server provides a simple, file-based authorization engine that
complies with the JACC specification. It is also possible to specify additional third-party JACC
providers.
JACC providers use the Java Authentication and Authorization Service (JAAS) APIs. JAAS
enables services to authenticate and enforce access controls upon users. It implements a Java
technology version of the standard Pluggable Authentication Module (PAM) framework.
Two message security providers are included with this release. The message security providers
can be configured for authentication for the SOAP layer. The providers that can be configured
include ClientProvider and ServerProvider.
Support for message layer security is integrated into the Application Server and its client
containers in the form of (pluggable) authentication modules. By default, message layer security
is disabled on the Application Server.
Message level security can be configured for the entire Application Server or for specific
applications or methods. Configuring message security at the Application Server level is
discussed in Chapter 9, “Configuring Message Security.” Configuring message security at the
application level is discussed in “Configuring Message Security for Web Services” in Sun Java
System Application Server Platform Edition 9 Developer’s Guide.
See Also:
■ “Configuring the Application Server for Message Security” on page 140
■ “Securing a Web Service” on page 138
■ “To enable providers for message security” on page 144
■ “To configure a message security provider” on page 145
■ “Creating a Message Security Provider” on page 148
■ “To delete a message security configuration” on page 151
■ “To delete a message security provider” on page 151
■ “To enable message security for application clients” on page 151
96 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
About Application Server Security
Note – Users and groups are designated for the entire Application Server, whereas each
application defines its own roles. When the application is being packaged and deployed, the
application specifies mappings between users/groups and roles, as illustrated in the following
figure.
Users
A user is an individual (or application program) identity that has been defined in the
Application Server. A user can be associated with a group. The Application Server
authentication service can govern users in multiple realms.
Groups
A J2EE group (or simply group) is a category of users classified by common traits, such as job
title or customer profile. For example, users of an e-commerce application might belong to the
customer group, but large customers would belong to the preferred group. Categorizing users
into groups makes it easier to control the access of large numbers of users.
Roles
A role defines which applications and what parts of each application users can access and what
they can do. In other words, roles determine users’ authorization levels.
For example, in a personnel application all employees might have access to phone numbers and
email addresses, but only managers would have access to salary information. The application
might define at least two roles: employee and manager; only users in the manager role are
allowed to view salary information.
98 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
About Application Server Security
A role is different from a user 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, in the personnel application
there might be groups such as full-time, part-time, and on-leave, but users in all these
groups would still be in the employee role.
Roles are defined in application deployment descriptors. In contrast, groups are defined for an
entire server and realm. The application developer or deployer maps roles to one or more
groups for each application in its deployment descriptor.
Realms
A realm, also called a security policy domain or security domain, is a scope over which the server
defines and enforces a common security policy. In practical terms, a realm is a repository where
the server stores user and group information.
The Application Server comes preconfigured with three realms: file (the initial default realm),
certificate, and admin-realm. It is possible to also set up ldap, solaris, or custom realms.
Applications can specify the realm to use in their deployment descriptor. If they do not specify a
realm, the Application Server uses its default realm.
In the file realm, the server stores user credentials locally in a file named keyfile. You can use
the Admin Console to manage users in the file realm. For more information, see “Managing
file Realm Users” on page 115.
In the certificate realm, the server stores user credentials in a certificate database. When
using the certificate realm, the server uses certificates with the HTTPS protocol to
authenticate Web clients. For more information about certificates, see “Introduction to
Certificates and SSL” on page 100.
The admin-realm is also a FileRealm and stores administrator user credentials locally in a file
named admin-keyfile. Use the Admin Console to manage users in this realm in the same way
you manage users in the file realm. For more information, see “Managing file Realm Users” on
page 115.
In the ldap realm the server gets user credentials from a Lightweight Directory Access Protocol
(LDAP) server such as the Sun Java System Directory Server. LDAP is a protocol for enabling a
user 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 on managing users and groups in the ldap realm.
In the solaris realm the server gets user credentials from the Solaris operating system. This
realm is supported on the Solaris 9 OS and later. Consult your Solaris documentation for
information on managing users and groups in the solaris realm.
A custom realm is any other repository of user credentials, such as a relational database or
third-party component. For more information, see “Creating a Custom Realm” on page 112.
100 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
About Application Server Security
In other cases, the CA can return a chain of certificates. In this case, 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.
When a Web browser (client) wants to connect to a secure site, an SSL handshake is initiated, as
described in the following procedure:
■ The browser sends a message over the network requesting a secure session (typically, by
requesting a URL that begins with https instead of http).
■ The server responds by sending its certificate (including its public key).
■ 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.
■ 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.
■ 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 TLS (Transport Layer Security). The
Application Server supports the Secure Sockets Layer (SSL) 3.0 and the Transport Layer
Security (TLS) 1.0 encryption protocols.
To use SSL, the Application 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 digital certificate has been installed. Use the procedure described in “To generate a
certificate using the keytool utility” on page 130 to set up a digital certificate that your Web
server can use for SSL.
About 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. Choose ciphers from the SSL3 and TLS protocols. During a secure
connection, the client and the server agree to use the strongest cipher 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.
102 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
About Application Server Security
About 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. This
section describes some common firewall architectures and their configuration. The information
here pertains primarily to the Application Server. For details about a specific firewall
technology, refer to the documentation from your firewall vendor.
In general, configure the firewalls 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 setup for port 8181, you must
configure the firewalls to allow HTTPS requests on port 8181.
If direct Remote Method Invocations over Internet Inter-ORB Protocol (RMI-IIOP) access
from the Internet to EJB modules are required, open the RMI-IIOP listener port as well, but this
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 the Application Server behind the firewall.
JACC Providers
JACC providers were introduced in “Specifying JACC Providers” on page 95. Use the Admin
Console to perform the following tasks:
■ Add a new JACC provider
■ Delete or modify an existing JACC provider
See “Configuring JACC Providers” on page 116 for details on these tasks.
See Also:
■ “Creating a JACC Provider” on page 116
■ “Setting the Active JACC Provider” on page 117
Audit Modules
Audit modules were introduced in “Auditing Authentication and Authorization Decisions” on
page 96. Auditing is the method by which significant events, such as errors or security breaches,
are recorded for subsequent examination. All authentication events are logged to the
Application Server logs. A complete access log provides a sequential trail of Application Server
access events.
See “Configuring Audit Modules” on page 117 for details on these tasks.
See Also:
■ “Creating an Audit Module” on page 117
■ “Enabling or Disabling Audit Logging” on page 118
Message Security
The concept of message security was introduced in “Configuring Message Security” on page 96.
Use the Admin Console to perform the following tasks:
■ Enable message security
■ Configure a message security provider
■ Delete or configure an existing message security configuration or provider
104 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
About Application Server Security
See Also:
■ “Configuring the Application Server for Message Security” on page 140
■ “Securing a Web Service” on page 138
■ “To enable providers for message security” on page 144
■ “To configure a message security provider” on page 145
■ “Creating a Message Security Provider” on page 148
■ “To delete a message security configuration” on page 151
■ “To delete a message security provider” on page 151
■ “To enable message security for application clients” on page 151
The Application Server supports CORBA (Common Object Request Broker Architecture)
objects, which use the Internet Inter-Orb Protocol (IIOP) to communicate across the network.
An IIOP listener accepts incoming connections from remote clients of EJB components and
from other CORBA-based clients. For general information on IIOP listeners, see “IIOP
Listeners” on page 178.
See “Configuring Listeners and JMX Connectors” on page 118 for details on these tasks.
See Also:
■ “Configuring Security for HTTP Listeners” on page 118
■ “Configuring Security for IIOP Listeners” on page 118
■ “To set listener security properties” on page 119
See “Configuring Security For The Admin Service’s JMX Connector” on page 119 for details on
these tasks.
See Also:
■ “Configuring Security For The Admin Service’s JMX Connector” on page 119
Security Maps
The concept of security maps for connector connection pools is introduced in “About Security
Maps” on page 123. Use the Admin Console to perform the following tasks:
■ Add a security map to an existing connector connection pool
■ Delete or configure an existing security map
See “Configuring Connector Connection Pools” on page 123 for details on these tasks.
See Also:
■ “About Connector Connection Pools” on page 123
■ “About Security Maps” on page 123
■ “To create a security map” on page 124
■ “To edit a security map” on page 125
■ “To delete a security map” on page 126
Configuring Security
This section contains the following topics:
■ “Configuring General Security Settings” on page 106
■ “Granting Access to Administration Tools” on page 108
■ “Configuring Mutual Authentication” on page 115
■ “To configure single sign-on (SSO)” on page 121
Go to Configuration > Security. The Security page displays with general security options. These
options are summarized in the following table.
106 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Configuring Security
Setting Description
Security Manager Select the Enable checkbox to turn on the security manager for the domain.
When enabled, a JVM option, –Djava.security.manager, will be added to the JVM
setting of the Application Server. You must restart the server to enable this change.
Ensure that you have granted correct permissions for all applications. You can turn
off the security manger to enhance performance.
Audit Logging Select to enable audit logging. If enabled, the server will load and run all the audit
modules specified in the Audit Modules setting. If disabled, the server does not access
audit modules. Disabled by default.
Default Realm The active (default) realm the server uses for authentication. Applications use this
realm unless they specify a different realm in their deployment descriptor. All
configured realms appear in the list. The initial default realm is the file realm.
Anonymous Role The name for the default or anonymous role. The anonymous role is assigned to all
users. Applications can use this role in their deployment descriptors to grant
authorization to anyone.
Default Principal Specifies the default user name. The server uses this when no principal is provided. If
you enter a value in this field, enter a corresponding value in the Default Principal
Password field.
This attribute is not required for normal server operation.
Default Principal Password Password of the default principal specified in the Default Principal field.
This attribute is not required for normal server operation.
JACC Class name of a configured JACC provider. See “Creating a JACC Provider” on
page 116
Audit Modules List of audit module provider classes, delimited by commas. A module listed here
must already be configured. If Audit Logging is enabled, this setting must list audit
modules. By default, the server uses an audit module named default. For
information on creating new audit modules, see “Creating an Audit Module” on
page 117.
Default Principal To Role Mapping Check to apply a default principal-to-role mapping to applications that do not have
an application-specific mapping.
Mapped Principal Classes Customize the java.security.Principal implementation class used in the default
principal-to-role mapping.
For more details on configuring all the options on the Security page, click Help in the Admin
Console.
To give a user access to these administration tools, add them to the asadmin group in the
admin-realm. In the Admin Console, go to Configuration> Security > Realms > admin-realm >
Edit Realm > Manage Users. If the user name exists, click on the user name to edit settings or
click New to add a new user name.
Initially after installation, the administrator user name and password entered during
installation are listed in a file named admin-keyfile. By default, this user belongs to the group
asadmin, which gives rights to modify the Application Server. Assign users to this group only if
you want to grant them administrator privileges for the Application Server.
If you add users to the admin-realm realm, but assign the user to a group other than asadmin,
the user information will still be written to the file named admin-keyfile, but the user will have
no access to administrative tools or to applications in the file realm.
To authorize a user to make modifications to the Application Server, include the asadmin group
in the Group List.
For detailed instructions on setting up a new user account with admin privileges, click Help in
the Admin Console.
See Also:
■ “Editing a Realm” on page 109
■ “Setting the Default Realm” on page 110
■ “Realms and file Realm Users” on page 103
Configuring Realms
This section contains the following topics:
■ “Creating a Realm” on page 108
■ “Editing a Realm” on page 109
■ “Setting the Default Realm” on page 110
■ “Additional Information for Specific Realms” on page 110
Creating a Realm
The Application Server comes preconfigured with three realms: file, certificate, and
admin-realm. It is also possible to create ldap, solaris, and custom realms. Generally, you will
108 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Configuring Realms
have one realm of each type on a server, but on the Application Server there are two file realms:
file and admin-realm. These are two realms of the same type used for two different purposes.
It is also possible to have a different certificate database for each virtual server on your system.
To create a realm using the Admin Console, go to Configuration > Security > Realms > New.
Enter a name for the realm and specify the class name for the realm you are creating. Class
names for different realms are shown in the following table:
file com.sun.enterprise.security.auth.realm.file.FileRealm
certificate com.sun.enterprise.security.auth.realm.certificate.CertificateRealm
ldap com.sun.enterprise.security.auth.realm.ldap.LDAPRealm
solaris com.sun.enterprise.security.auth.realm.solaris.SolarisRealm
Add the required properties and any desired optional properties for the realm.
■ For a description of file realm properties, see “Editing the file and admin-realm Realms”
on page 114.
■ For a description of certificate realm properties, see “Editing the certificate Realm” on
page 113.
■ For a description of ldap realm properties, see “Creating an ldap Realm” on page 110.
■ For a description of solaris realm properties, see “Creating the solaris Realm” on page 112.
■ For a description of custom realm properties, see “Creating a Custom Realm” on page 112.
For more details on creating a realm, click Help in the Admin Console.
Equivalent asadmin command.
Use the create-auth-realm asadmin command to create a realm. For details, see
create-auth-realm(1).
Editing a Realm
In the Admin Console, go to Configuration > Security > Realms and select the realm you want
to edit. The Edit Realm page will display, where you can make changes to the current
configuration.
For details on editing or deleting a realm, click Help in the Admin Console.
Equivalent asadmin command.
Use the delete-auth-realmcommand to delete a realm. For details, delete-auth-realm(1).
In the Admin Console, go to Configuration > Security and select the required realm from the
Default Realm drop-down list. Click Save.
To create an LDAP realm, follow the steps in “Creating a Realm” on page 108 for adding a new
realm, and add the properties shown in the following table.
directory LDAP URL of the directory server. LDAP URL of the form
ldap://hostname:portFor example,
ldap://myldap.foo.com:389.
base-dn Base Distinguished Name (DN) for the Domain for the search, for example:
location of user data, which can be at any dc=siliconvalley, dc=BayArea,
level above the user data, since a tree scope dc=sun, dc=com.
search is performed. The smaller the search
tree, the better the performance.
110 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Configuring Realms
jaas-context Type of login module to use for this realm. Must be ldapRealm.
Optional properties for the ldap realm are shown in the following table.
search-filter Search filter to use to find the user. uid=%s (%s expands to the subject
name).
group-base-dn Base DN for the location of group data. Same as the base-dn, but it can be
tuned if necessary.
group-search-filter Search filter to find group memberships for uniquemember=%d (%d expands to
the user. the user element DN).
Example
For example, suppose an LDAP user, Joe Java, is defined in the LDAP directory as follows:
uid=jjava,ou=People,dc=acme,dc=com
uid=jjava
givenName=joe
objectClass=top
objectClass=person
objectClass=organizationalPerson
objectClass=inetorgperson
sn=java
cn=Joe Java
Using the example code, when creating or editing the ldap realm, you can enter the values as
shown in the following table.
base-dn ou=People,dc=acme,dc=com.
Can be rooted higher, for example dc=acme, dc=com, but searches would
traverse a larger part of the tree, reducing performance.
jaas-context ldapRealm
The solaris realm has one required property, jaas-context that specifies the type of login
module to use. The property value must be solarisRealm.
As an administrator, the main thing you need to know is that a custom realm is implemented by
a class (called the LoginModule) derived from the Java Authentication and Authorization
Service (JAAS) package.
1 Follow the procedure outline in “Creating a Realm”on page 108, entering the name of the
custom realm and the name of the LoginModule class.
Any unique name can be used for the custom realm, for example myCustomRealm.
2 Add the properties for a custom realm shown in the following table.
112 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Configuring Realms
auth-type Description of the realm, for example “A simple example custom realm”.
3 Click OK.
4 Edit the domain's login configuration file, domain-dir/config/login.conf, and add the
fully-qualified class name of the JAAS LoginModule at the end of the file, as follows:
realmName {
fully-qualified-LoginModule-classname required;
};
For example,
myCustomRealm {
com.foo.bar.security.customrealm.simpleCustomLoginModule required;
};
5 Copy the LoginModule class and all dependent classes into the directory
domain-dir/lib/classes.
With the certificate realm, Java EE containers handle authorization processing based on
each user’s Distinguished Name (DN) from his or her certificate. The DN is the name of the
entity whose public key the certificate identifies. This name uses the X.500 standard, so it is
intended to be unique across the Internet. For more information on key stores and trust stores,
refer to the keytool documentation at
http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/keytool.html.
The following table lists the optional properties for the certificate realm.
Property Description
assign-groups A comma-separated list of group names. All clients who present valid
certificates are assigned to these groups. For example, employee,manager,
where these are the names of user groups.
jaas-context Type of login module to use for this realm. For the certificate realm, the
value must be certificateRealm.
jaas-context Type of login module to use for this realm. fileRealm is the only valid value
The keyfile is initially empty, so users must be added before the file realm is used. For
instructions, see “Managing file Realm Users” on page 115.
The admin-keyfile initially contains the admin user name, the admin password in an
encrypted format, and the group to which this user belongs, which is asadmin by default. For
more information on adding users to the admin-realm, read “Granting Access to
Administration Tools” on page 108.
Note – Users in the group asadmin in the admin-realm are authorized to use the Admin Console
and asadmin tools. Add only users to this group that have server administrative privileges.
114 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Configuring Realms
Note – It is also possible to use these steps to add users to any file realm, including the
admin-realm. Simply substitute the name of the target realm in place of the file realm
referenced in this section.
A user in the file realm can belong to a JavaEE group, a category of users classified by common
traits. For example, customers of an e-commerce application might belong to the CUSTOMER
group, but the big spenders would belong to the PREFERRED group. Categorizing users into
groups makes it easier to control the access of large numbers of users.
Initially after installation of the Application Server, the only user is the administrator entered
during installation. By default, this user belongs to the group asadmin, in the realm
admin-realm, which gives rights to modify the Application Server. Any users assigned to this
group will have administrator privileges, that is, they will have access to the asadmin tool and
the Admin Console.
To manage file realm users, perform the following tasks:
■ Add a user.
■ Edit user information.
■ Delete a user.
To access the File Users page in the Admin Console, go to Configuration > Security > Realms >
File > Edit Realm > Manage Users. For detailed information on performing these tasks, click
Help in the Admin Console.
Equivalent asadmin commands.
The same tasks can be performed from the asadmin command line utility. For more
information, see
■ create-file-user: See create-file-user(1).
■ update-file-user: See update-file-user(1).
■ delete-file-userdelete-file-user(1).
In mutual authentication, both server and client-side authentication are enabled. To test mutual
authentication, a client with a valid certificate must exist. For information on mutual
authentication, see the Security chapter of Java EE 5 Tutorial
(http://java.sun.com/javaee/5/docs/tutorial/doc/index.html).
To edit or delete a JACC provider, go to Configuration > Security > JACC Providers and select
the provider you want to edit or delete.
For details on creating, editing or deleting JACC providers, click Help in the Admin Console.
116 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Configuring Audit Modules
Regardless of whether audit logging is enabled, the Application Server logs all denied
authentication events.
To edit or delete an audit module, go to Configuration > Security > Audit Modules, and select
an audit module. In the Edit Audit Module page, modify your settings and click Save.To delete,
select the check box to the left of an audit module, and click Delete.
For detailed information on managing audit modules, click Help in the Admin Console.
For detailed information on enabling or disabling audit logging, click Help in the Admin
Console.
The preconfigured audit module is called default. Make sure that this audit module has
auditOn.
118 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Configuring Listeners and JMX Connectors
An IIOP listener accepts incoming connections from remote clients of EJB components and
from other CORBA-based clients. With the Admin Console, create new IIOP listeners and edit
the settings of existing IIOP listeners.
To configure security for IIOP listeners, in the Admin Console, go to Configuration > ORB >
IIOP Listeners. Follow the procedure in “To set listener security properties” on page 119 to set
security properties.
1 In the Edit HTTP Listener, Edit IIOP Listener, or Edit JMX Connector page, go to the section
labeled SSL.
2 Check the Enabled box in the Security field to enable security for this listener. When this option
is selected, you must select SSL3 or TLS to specify which type of security is enabled, and you
must enter a certificate nickname.
3 Check the Enabled box in the Client Authentication field if clients are to authenticate
themselves to the Application Server when using this listener.
4 Enter the keystore alias in the Certificate Nickname field if the Enabled box is checked. The
keystore alias is a single value that identifies an existing server key pair and certificate. The
certificate nickname for the default keystore is s1as.
To find the Certificate Nickname, use keytool, as shown in the following example:keytool
-list -v -keystore keystore.jks.
If the name has changed in the keystore file, then use that name instead of keystore.jks.
5 Select SSL3 and/or TLS if the Enabled box is checked. By default, both SSL3 and TLS are enabled.
6 Enable individual cipher suites, if needed. By default, all supported cipher suites are enabled.
Ciphers are discusses in “About Ciphers”on page 102.
a. Expand the ORB node, and then the IIOP Listeners node.
d. Click Save.
2 Configure authorization.
To turn on authorization for CORBA objects, specify the appropriate security policy in the
server’s security configuration file, domain-dir/config/server.policy.
By default, all users are allowed to access all non-EJB CORBA objects in the server, as specified
by the following default grant block:
grant { permission com.sun.enterprise.security.CORBAObjectPermission "*", "*"; }
CORBAObjectPermission is a special Java Permission class that controls which users are allowed
to access non-EJB CORBA objects in the server. CORBAObjectPermission takes two
parameters:
■ A CORBA object name.
In the Application Server, only the name “*” is supported, that is, it is not possible to specify
a specific CORBA object name.
■ A comma-separated list of method names.
In the Application Server, only “*” is supported, that is, it is not possible to specify a specific
method name.
120 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Configuring Security for Virtual Servers
a. To force clients to use only SSL for IIOP invocations, remove all non-SSL iiop-listener
elements in the iiop-service element in domain.xml.
This ensures that the server will not service plain IIOP invocations. By default, application
clients use plain IIOP for making requests if the server supports plain IIOP.
b. To force the client to use SSL, a change is needed in the application client configuration file
sun-acc.xml (which is also located in the domain’s config directory).
Specifically, the property ssl with value required should be added inside the
<client-container> element, as follows:
<client-container>
<property name=”ssl” value=”required”/>
<target-server .... />
</client-container>
Single sign-on applies to Web applications configured for the same realm and virtual server.
Note – Single sign-on uses an HTTP cookie to transmit a token that associates each request with
the saved user identity, so it can be used only when the browser client supports cookies.
3 Expand the Virtual Servers node, and select the virtual server to be configured for single sign-on
support.
6 Enter false in the Value field to disable, enter true to enable SSO.
SSO is enabled by default.
7 Add or change any other single sign-on properties by clicking Add Property and configuring any
applicable SSO properties.
Valid SSO properties for virtual servers are discussed in the following table.
122 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Configuring Connector Connection Pools
8 Click Save.
Security maps enables the creation of a mapping between Java EE users and groups and EIS
users and groups. Use the Admin Console to create, update, list, and delete security maps for
connector connection pools.
Note – In this context, users are referred to as principals. The enterprise information system
(EIS) is any system that holds the information. It can be a mainframe, a messaging system, a
database system, or an application.
principal initiates a request to an EIS, the application server first checks for an exact principal
using the security map defined for the connector connection pool to determine the mapped
back end EIS principal. If there is no exact match, then the application server uses the wild card
character specification, if any, to determine the mapped back end EIS principal. Security maps
are used when an application user needs to execute EIS operations that require to be executed as
a specific identity in the EIS.
Use the following procedures in the Admin Console to manage security maps:
■ “To create a security map” on page 124
■ “To edit a security map” on page 125
■ “To delete a security map” on page 126
4 Select a Connector Connection Pool by selecting its name from the list of current pools or create
a new connector connection pool by selecting New from the list of current pools.
124 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Configuring Connector Connection Pools
■ Username – Enter the EIS user name. The enterprise information system (EIS) is any
system that holds the information. It can be a mainframe, a messaging system, a database
system, or an application.
■ Password – Enter the password for the EIS user.
4 Select a Connector Connection Pool by selecting its name from the list of current pools.
6 On the Security Maps page, select a security map from the list of current security maps.
7 On the Edit Security Map page, modify the following properties where needed.
■ User Groups – The caller identity of the application to be mapped to a suitable EIS
principal. Enter a comma-separated list of application-specific user groups, or enter the wild
card asterisk (*) to indicate all users or all user groups. Specify either the Principals or User
Groups options, but not both.
■ Principals – The caller identity of the application to be mapped to a suitable EIS principal.
Enter a comma-separated list of application-specific principals, or enter the wild card
asterisk (*) to indicate all principals. Specify either the Principals or User Groups options,
but not both.
4 Select a Connector Connection Pool by selecting its name from the list of current pools.
6 On the Security Maps page, click the checkbox to the left of the name of the security map to be
deleted.
7 Click Delete.
126 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Working with Certificates and SSL
See also “To change the location of certificate files” on page 127.
4 On the JVM Options page, add or modify the following values in the Value field to reflect the
new location of the certificate files:
-Djavax.net.ssl.keyStore=${com.sun.aas.instanceRoot}/path/ks-name
-Djavax.net.ssl.trustStore=${com.sun.aas.instanceRoot}/path/ts-name
where ks-name is the keystore file name and ts-name is the trust store file name.
5 Click Save.
Another example of creating a certificate is shown in “To generate a certificate using the
keytool utility” on page 130.
128 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Working with Certificates and SSL
■ Create a self-signed certificate in a keystore of type JKS using the default key algorithm.
An example of signing a certificate is shown in “To sign a digital certificate using the keytool
utility” on page 131
■ Display available certificates from a keystore of type JKS.
2 Enter the following keytool command to generate the certificate in the keystore file,
keystore.jks:
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 their default, then substitute the new password for changeit in the above
command.
A prompt appears that asks for your name, organization, and other information that keytool
uses to generate the certificate.
3 Enter the following keytool command to export the generated certificate to the file
server.cer (or client.cer if you prefer):
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 digital certificate using
the keytool utility”on page 131.
5 To create the truststore file cacerts.jks and add the certificate to the truststore, enter the
following keytool command:
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 their default, then substitute the
new password for changeit in the above command.
The tool displays information about the certificate and prompts whether you want to trust the
certificate.
130 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Further Information
1 Follow the instructions on the CA’s Web site for generating certificate key pairs.
4 Use keytool to import the certificate into the local keystore and, if necessary, the local
truststore.
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 changeit in the above command.
For a complete list of possible options for the -delete command, refer to the keytool
documentation at
http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/keytool.html.
Further Information
■ The Java 2 Standard Edition discussion on security can be viewed from
http://java.sun.com/j2se/1.5.0/docs/guide/security/index.html.
■ The chapter titled Security in the Java EE 5 Tutorial
(http://java.sun.com/javaee/5/docs/tutorial/doc/index.html).
■ The Administration Guide chapter titled Chapter 9, “Configuring Message Security.”
■ The chapter titled Chapter 5, “Securing Applications,” in Sun Java System Application Server
Platform Edition 9 Developer’s Guide in the Developer's Guide.
This chapter describes the configuration of message layer security for web services in the
Application Server. This chapter contains the following topics:
■ “About Application Server Security” on page 89
■ “Configuring Security” on page 106
Some of the material in this chapter assumes a basic understanding of security and web services
concepts. To learn more about these concepts, explore the resources listed in “Further
Information” on page 131 before beginning this chapter.
Web Services Security: SOAP Message Security (WS-Security) is an international standard for
interoperable Web Services Security that was developed in OASIS by a collaboration of all the
major providers of web services technology (including Sun Microsystems). WS-Security is a
message security mechanism that uses XML Encryption and XML Digital Signature to secure
133
About Message Security
web services messages sent over SOAP. The WS-Security specification defines the use of various
security tokens including X.509 certificates, SAML assertions, and username/password tokens
to authenticate and encrypt SOAP web services messages.
See Also:
■ “Understanding Message Security in the Application Server” on page 134
■ “Securing a Web Service” on page 138
■ “Securing the Sample Application” on page 139
■ “Configuring the Application Server for Message Security” on page 140
System Administrator
The system administrator is responsible for:
■ Configuring message security providers on the Application Server.
■ Managing user databases.
■ Managing keystore and truststore files.
134 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
About Message Security
A system administrator uses the Admin Console to manage server security settings and uses a
command line tool to manage certificate databases. In Platform Edition, certificates and private
keys are stored in key stores and are managed with keytool. Standard Edition and Enterprise
Edition store certificates and private keys in an NSS database, where they are managed using
certutil. This document is intended primarily for system administrators. For an overview of
message security tasks, see “Configuring the Application Server for Message Security” on
page 140.
Application Deployer
The application deployer is responsible for:
■ Specifying (at application assembly) any required application-specific message protection
policies if such policies have not already been specified by upstream roles (the developer or
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.
These security tasks are discussed in the Chapter 5, “Securing Applications,” in Sun Java System
Application Server Platform Edition 9 Developer’s Guide Securing Applications chapter of the
Developers’ Guide.
Application Developer
The application developer can turn on message security, but is not responsible for doing so.
Message security can be set up by the System Administrator so that all web services are secured,
or by the Application Deployer when the provider or protection policy bound to the application
must be different from that bound to the container.
Additional providers that employ other security tokens including SAML assertions will be
installed with subsequent releases of the Application Server.
When using a Username token, a valid user database must be configured on the Application
Server. For more information on this topic, read “Editing a Realm” on page 109.
When using digital signatures, valid keystore and truststore files must be configured on the
Application Server. For more information on this topic, read “About Certificate Files” on
page 127.
About Encryption
The purpose of encryption is to modify the data such that it can only be understood by its
intended audience. This is accomplished by substituting an encrypted element for the original
content. When predicated on public key cryptography, encryption can be used to establish the
identity of the parties that can read a message.
When using Encryption, you must have an installed JCE provider that supports encryption. For
more information on this topic, read “To configure a JCE Provider” on page 142.
136 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
About Message Security
receive the message can be established by the message sender. The providers apply specific
message security mechanisms to cause the message protection policies to be realized in the
context of SOAP web services messages.
Request and response message protection policies are defined when a provider is configured
into a container. Application-specific message protection policies (at the granularity of the web
service port or operation) may also be configured within the Sun-specific deployment
descriptors of the application or application client. In any case, where message protection
policies are defined, the request and response message protection policies of the client must
match (be equivalent to) the request and response message protection policies of the server. For
more information on defining application-specific message protection policies, refer to the
Securing Applications chapter of the Developers’ Guide.
The default server provider is used to identify the server provider to be invoked for any
application for which a specific server provider has not been bound. The default server
provider is sometimes referred to as the default provider.
■ Default Client Provider
The default client provider is used to identify the client provider to be invoked for any
application for which a specific client provider has not been bound.
■ Request Policy
The request policy defines the authentication policy requirements associated with request
processing performed by the authentication provider. Policies are 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.
■ Response Policy
The response policy defines the authentication policy requirements associated with response
processing performed by the authentication provider. Policies are 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.
See Also:
■ “Securing a Web Service” on page 138
■ “Securing the Sample Application” on page 139
■ “Configuring the Application Server for Message Security” on page 140
When the Application Server is installed, SOAP layer message security providers are configured
in the client and server-side containers of the Application Server, where they are available for
binding for use by the containers, or by individual applications or clients deployed in the
containers. During installation, the providers are configured with a simple message protection
policy that, if bound to a container, or to an application or client in a container, would cause the
source of the content in all request and response messages to be authenticated by XML digital
signature.
The administrative interfaces of the Application Server can be employed to bind the existing
providers for use by the server-side containers of the Application Server, to modify the message
protection policies enforced by the providers, or to create new provider configurations with
138 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
About Message Security
alternative message protection policies. These operations are defined in “Configuring Security”
on page 106. Analogous administrative operations can be performed on the SOAP message
layer security configuration of the application client container as defined in “To enable message
security for application clients” on page 151.
By default, message layer security is disabled on the Application Server. To configure message
layer security for the Application Server follow the steps outlined in “Configuring the
Application Server for Message Security” on page 140. If you want to cause web services security
to be used to protect all web services applications deployed on the Application Server, follow the
steps in “To enable providers for message security” on page 144.
Once you have completed the above steps (which may include restarting the Application
Server), web services security will be applied to all web services applications deployed on the
Application Server.
For more information on defining application specific message protection policies, refer to the
Securing Applications chapter of the Developers’ Guide. There is a link to this chapter in “Further
Information” on page 131.
See Also:
■ “To enable providers for message security” on page 144
■ “To enable message security for application clients” on page 151
■ “To configure a message security provider” on page 145
The xms sample application is provided to demonstrate the use of the Application Server’s
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 the
Application 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 “Configuring Application-Specific Web Services Security” on page 139 application.
For information on compiling, packaging, and running the xms sample application, refer to the
Securing Applications chapter of the Developers’ Guide.
TABLE 9–1 Message protection policy to WS-Security SOAP message security operation mapping
auth-source="content" The content of the SOAP message Body is signed. The message contains a
wsse:Security header that contains the message Body signature
represented as a ds:Signature.
auth-source="sender" The content of the SOAP message Body is encrypted and replaced with the
resulting xend:EncryptedData. The message contains a wsse:Security
auth-recipient="before-content"
header that contains a wsse:UsernameToken (with password) and an
OR xenc:EncryptedKey. The xenc:EncryptedKey contains the key used to
encrypt the SOAP message body. The key is encrypted in the public key of
auth-recipient="after-content" the recipient.
140 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
About Message Security
TABLE 9–1 Message protection policy to WS-Security SOAP message security operation mapping
(Continued)
Message Protection Policy Resulting WS-Security SOAP message protection operations
auth-source="content" The content of the SOAP message Body is encrypted and replaced with the
resulting xend:EncryptedData. The xenc:EncryptedData is signed. The
auth-recipient="before-content"
message contains a wsse:Security header that contains an
xenc:EncryptedKey and a ds:Signature. The xenc:EncryptedKey
contains the key used to encrypt the SOAP message body. The key is
encrypted in the public key of the recipient.
auth-source="content" The content of the SOAP message Body is signed, then encrypted, and then
replaced with the resulting xend:EncryptedData. The message contains a
auth-recipient="after-content"
wsse:Security header that contains an xenc:EncryptedKey and a
ds:Signature. The xenc:EncryptedKey contains the key used to encrypt
the SOAP message body. The key is encrypted in the public key of the
recipient.
auth-recipient="before-content" The content of the SOAP message Body is encrypted and replaced with the
resulting xend:EncryptedData. The message contains a wsse:Security
OR
header that contains an xenc:EncryptedKey. The xenc:EncryptedKey
auth-recipient="after-content" contains the key used to encrypt the SOAP message body. The key is
encrypted in the public key of the recipient.
1 If using a version of the Java SDK prior to version 1.5.0, and using encryption technology,
configure a JCE provider.
Configuring a JCE provider is discussed in “To configure a JCE Provider” on page 142.
Next Steps Once the facilities of the Application Server are configured for use by message security
providers, then the providers installed with the Application Server may be enabled as described
in “To enable providers for message security” on page 144.
Note – RSA is public-key encryption technology developed by RSA Data Security, Inc. The
acronym stands for Rivest, Shamir, and Adelman, the inventors of the technology.
If you are running the Application Server on version 1.5 of the Java SDK, the JCE provider is
already configured properly. If you are running the Application Server on version 1.4.x of the
Java SDK, you can add a JCE provider statically as part of your JDK environment, as follows.
security.provider.2=org.bouncycastle.jce.provider.
BouncyCastleProvider
Make sure that the Sun security provider remains at the highest preference, with a value of 1.
security.provider.1=sun.security.provider.Sun
Adjust the levels of the other security providers downward so that there is only one security
provider at each level.
142 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Admin Console Tasks for Message Security
The following is an example of a java.security file that provides the necessary JCE provider
and keeps the existing providers in the correct locations.
security.provider.1=sun.security.provider.Sun
security.provider.2=org.bouncycastle.jce.provider.
BouncyCastleProvider
security.provider.3=com.sun.net.ssl.internal.ssl.Provider
security.provider.4=com.sun.rsajca.Provider
security.provider.5=com.sun.crypto.provider.SunJCE
security.provider.6=sun.security.jgss.SunProvider
Support for message layer security is integrated into the Application Server and its client
containers in the form of (pluggable) authentication modules. By default, message layer security
is disabled on the Application Server. The following sections provide the details for enabling,
creating, editing, and deleting message security configurations and providers.
■ “To enable providers for message security” on page 144
■ “To configure a message security provider” on page 145
■ “Creating a Message Security Provider” on page 148
■ “To delete a message security configuration” on page 151
■ “To delete a message security provider” on page 151
■ “To enable message security for application clients” on page 151
In most cases, it will be necessary to restart the Application Server after performing the
administrative operations listed above. This is especially the case if you want the effects of
the administrative change to be applied to applications that were already deployed on the
Application Server at the time the operation was performed.
To enable message security for web service invocations originating from deployed endpoints,
you must specify a default client provider. If you enabled a default client provider for the
Application Server, you must ensure that any services invoked from endpoints deployed in the
Application Server are compatibly configured for message layer security.
6 On the Edit Message Security Configuration page, specify a provider to be used on the server
side and a provider to be used on the client side for all applications for which a specific provider
has not been bound.
This is accomplished by modifying the following optional properties:
■ Default Provider – The identity of the server provider to be invoked for any application for
which a specific server provider has not been bound.
By default, no provider configuration is selected for the Application Server. To identify a
server-side provider, select ServerProvider. Selecting the null option means that no
message security provider will be invoked (by default) on the server side.
You would generally select ServerProvider for this field.
■ Default Client Provider – The identity of the client provider to be invoked for any
application for which a specific client provider has not been bound.
By default, no provider configuration is selected for the Application Server. To identify a
client-side provider, select ClientProvider. Selecting the null option means that no
message security provider will be invoked (by default) on the client side.
You would generally select null for this field. You would select ClientProvider if you
wanted to enable a default provider and message protection policy to apply to the web
services invocations originating from web services endpoints deployed on the Application
Server.
144 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Admin Console Tasks for Message Security
7 Click Save.
8 If you enabled a client or server provider and you want to modify the message protection
policies of the enabled providers, refer to “To configure a message security provider”on
page 145 for information on modifying the message security providers enabled in this step.
7 In the Provider Configuration section of the Edit Provider Configuration page, the following
properties are available for modification:
■ Provider Type – Select client, server, or client-server to establish whether the provider
is to be used as a client authentication provider, a server authentication provider, or both (a
client-server provider).
■ Class Name - Enter the Java implementation class of the provider. Client authentication
providers must implement the com.sun.enterprise.security.jauth.ClientAuthModule
interface. Server-side providers must implement the
com.sun.enterprise.security.jauth.ServerAuthModule interface. A provider may
implement both interfaces, but it must implement the interface corresponding to its
provider type.
8 In the Request Policy section of the Edit Provider Configuration page, enter the following
optional values, if needed.
These properties are optional, but if not specified, no authentication is applied to request
messages.
The request policy defines the authentication policy requirements associated with request
processing performed by the authentication provider. Policies are 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.
■ Authentication Source– Select content or null (the blank option) to define a requirement
for message-layer content authentication (for example, digital signature) to be applied to
response messages. When null is specified, source authentication of the response is not
required. sender is not supported.
■ Authentication Recipient– Select beforeContent or afterContent to define a
requirement for message-layer authentication of the receiver of the request message to its
sender (by XML encryption). When the value is not specified it defaults to afterContent.
For a description of the actions performed by the SOAP message security providers as a result of
the following message protection policies see “Actions of Request and Response Policy
Configurations” on page 140.
9 In the Response Policy section of the Create a Provider Configuration page, enter the following
optional properties, if needed.
These properties are optional, but if not specified, no authentication is applied to response
messages.
The response policy defines the authentication policy requirements associated with response
processing performed by the authentication provider. Policies are 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.
146 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Admin Console Tasks for Message Security
■ Authentication Source – Select content or null (the blank option) to define a requirement
for message-layer content authentication (for example, digital signature) to be applied to
response messages. When null is specified, source authentication of the response is not
required.
■ Authentication Recipient – Select beforeContent or afterContent to define a
requirement for message-layer authentication of the receiver of the response message to its
sender (by XML encryption). When the value is not specified it defaults to afterContent.
For a description of the actions performed by the SOAP message security providers as a result of
the following message protection policies see “Actions of Request and Response Policy
Configurations” on page 140.
11 Click Save.
■ Add a request policy to the server and set the authentication recipient:
7 In the Provider Configuration section of the New Provider Configuration page, enter the
following:
■ Default Provider – Check the box beside this field to make the new message security
provider the provider to be invoked for any application for which a specific provider has not
been bound. Whether the provider becomes the default client provider, the default server
provider, or both will be based on the value selected for Provider Type.
■ Provider Type – Select client, server, or client-server to establish whether the provider
is to be used as a client authentication provider, a server authentication provider, or both (a
client-server provider).
■ Provider ID - Enter an identifier for this provider configuration. This name will appear in
the Current Provider Configurations list.
■ Class Name - Enter the Java implementation class of the provider. Client authentication
providers must implement the com.sun.enterprise.security.jauth.ClientAuthModule
interface. Server-side providers must implement the
com.sun.enterprise.security.jauth.ServerAuthModule interface. A provider may
implement both interfaces, but it must implement the interface corresponding to its
provider type.
148 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Admin Console Tasks for Message Security
8 In the Request Policy section of the Create a Provider Configuration page, enter the following
optional values, if needed.
These properties are optional, but if not specified, no authentication is applied to request
messages.
■ Authentication Source – Select sender, content, or null (the blank option) to define a
requirement for message-layer sender authentication (for example, username password),
content authentication (for example, digital signature), or no authentication be applied to
request messages. When null is specified, source authentication of the request is not
required.
■ Authentication Recipient – Select beforeContent or afterContent to define a
requirement for message-layer authentication of the receiver of the request message to its
sender (by XML encryption). When the value is not specified it defaults to afterContent.
For a description of the actions performed by the SOAP message security providers as a result of
the following message protection policies see “Actions of Request and Response Policy
Configurations” on page 140.
9 In the Response Policy section of the Create a Provider Configuration page, enter the following
optional properties, if needed.
These properties are optional, but if not specified, no authentication is applied to response
messages.
■ Authentication Source – Select sender, content, or null (the blank option) to define a
requirement for message-layer sender authentication (for example, username password) or
content authentication (for example, digital signature) to be applied to response messages.
When null is specified, source authentication of the response is not required. sender is not
supported.
■ Authentication Recipient – Select beforeContent or afterContent to define a
requirement for message-layer authentication of the receiver of the response message to its
sender (by XML encryption). When the value is not specified it defaults to afterContent.
For a description of the actions performed by the SOAP message security providers as a result of
the following message protection policies see “Actions of Request and Response Policy
Configurations” on page 140.
8 Click OK to create the provider. The new provider HttpServlet is listed in the Message Security
Configuration page as well as a new node under the Message Security node.
10 Click the Providers tab and click HttpServlet to open the Edit Provider Configuration page.
11 In the Request Policy section, click Authenticate Source and select content.
12 In the Response Policy section, click Authenticate Source and select content.
150 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Admin Console Tasks for Message Security
4 Click in the checkbox to the left of the Message Security Configuration to be deleted.
5 Click Delete.
7 Click Delete.
To enable message security for client applications, modify the Application Server specific
configuration for the application client container.
1 Stop any client applications that depend on the client container descriptor.
2 In a text editor, open the Sun application client container descriptor, located in
domain-dir/config/sun-acc.xml.
-Djavax.net.ssl.keyStore
-Djavax.net.ssl.trustStore
152 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Admin Console Tasks for Message Security
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 Application Server
specific configuration for the application client container as described in “To enable message
security for application clients” on page 151. In the application client configuration file, add the
request-policy and response-policy elements as shown to set the request policy.
The rest of the code shown here may differ slightly in your installation. Do not change it.
<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="install-dir/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 “Actions of Request and Response Policy
Configurations” on page 140.
To not specify a request or response policy, leave the element blank, for example:
<response-policy/>
Further Information
■ The Java 2 Standard Edition discussion of security can be viewed from
http://java.sun.com/j2se/1.5.0/docs/guide/security/index.html.
■ The Java EE 5 Tutorial chapter titled Security can be viewed from Java EE 5 Tutorial
(http://java.sun.com/javaee/5/docs/tutorial/doc/index.html).
154 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
10
C H A P T E R
Transactions
1 0
About Transactions
The following subsections explain what are transactions and how transaction processing is
handled in Java EE.
■ “What Is a Transaction?” on page 155
■ “Transactions in Java EE Technology” on page 156
■ “Workarounds for Specific Databases” on page 156
What Is a Transaction?
A transaction is a series of discreet actions in an application that must all complete successfully
or else all the changes in each action are backed out. For example, to transfer funds from a
checking account to a savings account is a transaction with the following steps:
1. Check to see if the checking account has enough money to cover the transfer.
2. If there’s enough money in the checking account debit the amount from the checking
account.
3. Credit the money to the savings account.
4. Record the transfer to the checking account log.
5. Record the transfer to the savings account log.
155
About Transactions
If any of these steps fails, all changes from the preceding steps must be backed out, and the
checking account and savings account must be in the same state as they were before the
transaction started. This event is called a rollback. If all the steps complete successfully, the
transaction is in a committed state. Transactions end in either a commit or a rollback.
156 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Configuring Transaction Management
■ 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.
To disable the Application Server workaround, set the oracle-xa-recovery-workaround
property value to false. For details about how to set a property, see the Admin Console
online help.
Note – These workaround do not imply support for any particular JDBC driver.
While performing the recovery, if some of the resources are unreachable the server restart may
be delayed as it tries to recover the transactions.
When the transaction spans across servers, the server that started the transaction can contact
the other servers to get the outcome of the transactions. If the other servers are unreachable, the
transaction uses the Heuristic Decision field to determine the outcome.
Note – For Oracle, the database user for an XA datasource requires necessary permissions to be
able to recover any transactions after Application Server has crashed and has been restarted.
The Oracle permissions required on various tables for transaction recovery are:
■ SELECT permissions on DBA_PENDING_TRANSACTIONS, PENDING_TRANS$,
DBA_2PC_PENDING and DBA_2PC_NEIGHBORS tables
■ EXECUTE permissions on DBMS_SYSTEM table
To enable the recovery of incomplete transactions, check the Recover box in the On Restart
field. When a resource becomes unreachable during critical points in the transaction Commit
protocol, transactions may not complete and remain in transaction log file. If this check box is
marked, the server attempts to recover stranded transactions upon server restart. If the involved
resources remain unreachable, this may delay server restart. This checkbox is not marked by
default. Note that if automatic recovery is not enabled, only 2048 XA transactions are
recoverable. Also see the use of the Keypoint Interval as described below.
Modify values of other fields as necessary. In the Keypoint Interval (transactions) field, specify
the number of transactions between keypoint operations in the log. Keypoint operations reduce
the size of the transaction log file by removing entries for completed transactions and
compressing the file. A larger value for this attribute results in a larger transaction log file, but
fewer keypoint operations mean a potentially better performance. A smaller value (for example,
100) results in smaller log files, but slightly reduced performance due to the greater frequency of
keypoint operations.
Detailed steps for doing this are provided in the Administration Console Online Help.
158 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Configuring Transaction Management
To set the location of the transaction logs using the Administration Console, select
Configuration>Transaction Service. The Transaction Service page displays the general
transaction service settings. Enter the location of the transaction logs in the Transaction Log
Location field.
A tx subdirectory is created and transaction logs are kept under that directory.
The HTTP service is the component of the Application Server that provides facilities for
deploying web applications and for making deployed web applications accessible by HTTP
clients. These facilities are provided by means of two kinds of related objects, virtual servers and
HTTP listeners.
■ “Virtual Servers” on page 161
■ “HTTP Listeners” on page 162
Virtual Servers
A virtual server, sometimes called a virtual host, is an object that allows the same physical server
to host multiple Internet domain names. All virtual servers hosted on the same physical server
share the Internet Protocol (IP) address of that physical server. A virtual server associates a
domain name for a server (such as www.aaa.com) with the particular server on which the
Application Server is running.
Note – Do not confuse an Internet domain with the administrative domain of the Application
Server.
For instance, assume you want to host these domains on your physical server:
www.aaa.com
www.bbb.com
www.ccc.com
Assume also that www.aaa.com, www.bbb.com, and www.ccc.com have web modules web1, web2,
and web3, respectively, associated with them.
This means that all of these URLs are handled by your physical server:
161
HTTP Listeners
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 host www.aaa.com, the second URL is mapped to virtual host
www.bbb.com, and the third is mapped to virtual host www.ccc.com.
On the other hand, the following URL results in a 404 return code, because web3 isn’t registered
with www.bbb.com:
http://www.bbb.com:8080/web3
For this mapping to work, make sure that www.aaa.com, www.bbb.com, and www.ccc.com all
resolve to your physical server’s IP address. They need to 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).
When the Application Server is started, it starts the following virtual servers automatically:
■ A virtual server named server, which hosts all user-defined web modules
■ A virtual server named __asadmin, which hosts all administration-related web modules
(specifically, the Admin Console). This server is restricted; you cannot deploy web modules
to this virtual server.
HTTP Listeners
Each virtual server provides connections between the server and clients through one or more
HTTP listeners. Each HTTP listener is a listen socket that has an IP address, a port number, a
server name, and a default virtual server.
HTTP listeners must have a unique combination of port number and IP address. For example,
an HTTP listener can listen on all configured IP addresses on a given port for a machine by
specifying the IP address 0.0.0.0. Alternatively, the HTTP listener can specify a unique IP
address for each listener, but use the same port.
Since 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 (for example, 1.1.1.1:8081
and 1.1.1.1:8082), or with different IP addresses and the same port number (for example,
1.1.1.1:8081 and 1.2.3.4:8081, if your machine was configured to respond to both these
addresses).
162 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
HTTP Listeners
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.
Because the system running the Application 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. If the system does have access to more than one IP address,
each address can serve a different purpose.
By default, when the Application Server starts, it has the following HTTP listeners:
■ Two HTTP listeners named http-listener-1 and http-listener-2, associated with the
virtual server named server. The listener named http-listener-1 does not have security
enabled; http-listener-2 has security enabled.
■ An HTTP listener named admin-listener, associated with the virtual server named
__asadmin. This listener does not have security enabled.
All these listeners use the IP address 0.0.0.0 and the port numbers specified as the HTTP server
port numbers during installation of the Application Server. If the Application Server uses the
default port number values, http-listener-1 uses port 8080, http-listener-2 uses port
8181, and admin-listener uses port 4848.
Each HTTP listener has a default virtual server. The default virtual server is the server to which
the HTTP listener routes all request URLs whose host component does not match any of the
virtual servers that are associated with the HTTP listener (a virtual server is associated with an
HTTP listener by listing the HTTP listener in its http-listeners attribute).
In addition, specify the number of acceptor threads in the HTTP listener. Acceptor threads are
threads that wait for connections. The threads accept connections and put them in a queue,
where they are then picked up by worker threads. Configure enough acceptor threads so that
there is always one available when a new request comes in, but few enough so that they do not
provide too much of a burden on the system. In the Application Server, there is no distinction
between acceptor and request processing (worker) threads: each HTTP listener thread is
responsible for accepting and processing requests. For this reason, the HTTP listeners in the
Application Server’s default configuration use 50 acceptor threads.
The HTTP listener’s server name is the host name that appears in the URLs the server sends to
the client as part of a redirect. This attribute affects URLs the server automatically generates; it
does not affect the URLs for directories and files stored in the server. This name is normally the
alias name if the server uses an alias. If a client sends a Host: header, that host name supersedes
the HTTP listener’s server name value in redirects.
Specify a redirect port to use a different port number from that specified in the original request.
A redirect occurs in one of these situations:
■ If a client tries to access a resource that no longer exists at the specified URL (that is, the
resource has moved to another location), the server redirects the client to the new location
(instead of returning a 404), by returning a designated response code and including the new
location in the response’s Location header.
■ If a client tries to access a resource that is protected (for example, SSL) on the regular HTTP
port, the server redirects the request to the SSL-enabled port. In this case, the server returns
a new URL in the Location response header, in which the original insecure port has been
replaced with the SSL-enabled port. The client then connects to this new URL.
Specify also whether security is enabled for an HTTP listener and what kind of security is used
(for example, which SSL protocol and which ciphers).
To access a web application deployed on the Application Server, use the URL
http://localhost:8080/ (or https://localhost:8181/ if it is a secure application), along
with the context root specified for the web application. To access the Admin Console, use the
URL http://localhost:4848/ or http://localhost:4848/asadmin/ (its default context
root).
Because a virtual server must specify an existing HTTP listener, and because it 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.
164 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
12
C H A P T E R 1 2
This chapter describes web services management with Application Server. Admin Console and
the asadmin tool enable you deploy, test, and manage web services. You can view, manage, and
monitor all web services deployed in a domain just as you see Java EE applications and
application components such as EJBs.
For information on securing web services, see Chapter 9, “Configuring Message Security.”
165
Overview of Web Services
A web service is an application accessed by clients using XML-based protocols, such as Simple
Object Access Protocol (SOAP), sent over internet protocols such as Hypertext Transfer
Protocol (HTTP). Clients access a web service application through its interfaces and bindings,
defined using XML artifacts such as a web services Definition Language (WSDL) file.
A Document Type Definition (DTD) or XML Schema Definition (XSD) describes the structure
of an XML document. It has the tags an XML document can have, the order of those tags, and so
on.
Extensible Stylesheet Language Transformation (XSLT) transforms XML documents from one
format to another.
ebXML (Electronic Business using eXtensible Markup Language) is a set of specifications that
enables enterprises to conduct business over the Internet. OASIS (Organization for the
Advancement of Structured Information Standards) controls the ebXML specifications. Similar
to a telephone system's yellow pages, an ebXML registry enables providers to register their
services and requestors to find services. Once a requestor finds a service, the registry has no
more role to play between the requestor and the provider.
Universal Description, Discovery, and Integration (UDDI) provides a standard way to register,
de-register, and look up web services.
Web Services Description Language (WSDL) defines a standard way to specify the details of a
web service. It is a general-purpose XML schema that can specify details of web service
interfaces, bindings, and other deployment details. By having such a standard way to specify
details of a service, clients who have no prior knowledge of a web service can use it.
166 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Overview of Web Services
Java API for XML Web Services (JAX-WS) 2.0 is the successor to JAX-RPC that provides an
“integrated stack” of APIs for developing web services, including:
■ JAXB 2.0-based data binding.
■ Support for the latest W3C and WS-I standards such as SOAP 1.2 and WSDL 1.2.
■ Ease-of-development features using annotations.
■ An improved handler framework, support for asynchronous RPC and non-HTTP
transports.
■ JSR 109 support.
SOAP with Attachments API for Java (SAAJ) enables developers to produce and consume
messages conforming to the SOAP 1.1 specification and SOAP with Attachments note. SAAJ
provides an abstraction for handling SOAP messages with attachments. Advanced developers
can use SAAJ to have their applications operate directly with SOAP messages. Attachments may
be complete XML documents, XML fragments, or MIME-type attachments. In addition, SAAJ
allows developers to enable support for other MIME types. JAX technologies, such as JAX-RPC,
internally use SAAJ to hide SOAP complexities from developers. SAAJ enables:
■ Synchronous request-response messaging: the client sends a message and then waits for the
response.
■ One-way asynchronous messaging: the client sends a message and continues with its
processing without waiting for a response.
JSR 109 (Implementing Enterprise Web Services) facilitates building interoperable web services
in the Java EE environment. It standardizes the deployment of Web services in a Java EE
container. JSR-109 builds upon JAX-RPC to define a standard mechanism for deploying a web
service in Enterprise JavaBean (EJB) and servlet containers. Application Server supports
managing JSR 109 applications based on either JAX-RPC or JAX WS 2.0.
JSR 181 (Web Services Metadata for the Java Platform) defines an annotated Java format that
uses Java Language Metadata to enable easy definition of Java web services in a Java EE
container.
A web service can also be implemented by a POJO (plain old Java Object). Deploy a POJO web
service using the auto-deploy feature by dragging and dropping it into the auto-deploy
directory. Application Server will automatically generate the appropriate deployment
descriptor files and deploy the web service.
In Admin Console, you can view a list of deployed web services under Application Server > Web
Services | General.
You can also use the deploy(1) command to deploy a web service.
To view details of a web service with Admin Console, select Web Services > web-service-name |
General. Admin Console displays the attributes of the web service:
168 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Deploying and Testing Web Services
You can also view deployed web services with the list-components(1) command with the
--type webservice option.
To test a web service with Admin Console, select Web Services > web-service-name | General,
then click the Test button. For JAX-WS 2.0–compliant web services, Application Server
generates a test page when a JAX-WS 2.0 web service is deployed. You can launch the test web
page from Admin Console to easily verify a web service's operation without writing a client
application.
The automatically-generated test page contains a form that enables you to invoke all the web
service's methods and display the SOAP messages for each method invocation. The test page
also contains a link that displays the WSDL file returned from the sever instance; that is, the
runtime version of the WSDL file, not the packaged version.
You can use default message security providers to provide web services security. Use the
following commands to customize the message security providers:
■ create-message-security-provider(1)
■ delete-message-security-provider(1)
■ list-message-security-providers(1)
For more information about configuring security for web services, see Chapter 9, “Configuring
Message Security”
Note – Application Server does not have an internal registry. To publish web services to an
internal registry, you must download and install the registry on the application server. To
publish a web service to an external registry, specify the address of the external registry.
170 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Publishing to Web Services Registries
To set up your own registry to work with Application Server, follow the procedures in this
section.
▼ To Create a Registry
6 Configure the resource adapter to work with Application Server, as described in the next
section.
Before You Begin Set the JWSDP_HOME environment variable to the directory where JWSDP 1.6 is installed and
the JAVA_HOME environment variable to the directory where J2SE is installed.
2 You can either download and execute a script, or perform the steps manually.
■ To use a script:
Note – The commands shown are for Unix or Linux. Use the equivalent commands on
Windows.
Now, the tmp directory should contain the following files and directories:
■ META-INF directory
■ com directory
■ jaxr-ebxml.jar
■ oasis-regrep.jar
■ omar-common.jar
■ oasis-saml1.1.jar
■ oasis-saml2.0.jar
■ commons-logging.jar
Note – To use the jar command on Windows, you must have the JAVA_HOME\bin
directory on your path.
Next Steps Once you have created the soar.rar file, deploy it to create a registry as described in the next
section.
172 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Publishing to Web Services Registries
Adding a Registry
Adding a registry is equivalent to creating a connector connection pool and adding a
corresponding resource to the Application Server. This functionality is provided as a
convenience, and enables Application Server to communicate to a registry, as described
previously.
Add or remove a web services registry with Admin Console at Application Server > Web
Services | Registry. Click Add to add a new registry to which to publish web services. The Add
Registry Page appears. Use this page to create a Registry Access Point (RAP). For help on using
Admin Console, click Help.
In the Publish Web Service screen, select one or more registries to which you want to publish
the web service, then click Publish. To publish to all the available registries, click the Add All
button.
Enter categories under which this web service will show up in the registry. Use a comma to
separate each category. The categories are defined in the registry you are using. Enter a
description and the name of the organization for this web service.
If you are using a load balancer, enter the load balancer host name, port number, and the SSL
port number. If you are publishing the web service to an external registry, where the WSDL can
be found over the internet, these options will replace the hostname and port name specified in
the WSDL to the one of the load balancer.
To un-publish a web service, In the Publish Web Service screen, select the registry from which
you want to un-publish the web service, then click Unpublish.
You can also use the following commands to publish a web service, un-publish a web service,
and list registry locations:
■ publish-to-registry(1)
■ unpublish-from-registry(1)
■ list-registry-locations(1)
To enable monitoring for a web service, with Admin Console, select Web Services >
web-service-name | Monitor | Configuration.
Enter a value for the Message History. The default is 25. Click the Reset button to clear all
statistics and the running averages are restarted.
View monitoring statistics at Web Services > web-service-name | Monitor | Statistics. The
statistics available are:
■ Response time in milliseconds on any successful or unsuccessful operation (maximum,
minimum, and average).
Note – Response time is the time the sever took to process the web service request, not
including any network transmission time.
■ Throughput.
■ Total number of requests.
■ Total number of faults.
174 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Transforming Messages with XSLT Filters
By default, Admin Console retains the last 25 messages. Admin Console displays details of
SOAP requests, responses, and HTTP header information. In addition, the following
information is displayed for a web service request:
■ Remote user name
■ Client host information
■ Timestamp
■ Response information (success or failure)
■ Size of the request
You can also select a filter to view only the success messages or the failure messages. If call flow
monitoring is enabled, each message is linked to call flow information that enables you to look
at the call stack information for each message.
Before revising an application to apply transformation rules, evaluate the pros and cons of
doing so: Applying XSLT can lengthen processing time for a web service. In other cases, XSLT
makes sense, for example if a web service is exposed to partners with different XML data
exchange formats or different security requirements. In such cases, transformation rules can act
as a proxy for the web service and be advantageous.
To add a transformation rule to apply to a web service operation with Admin Console, select
Web Services > web-service-name | Transformation. Click Add. Admin Console displays a list of
transformation rules available for the web service endpoint. To add a new transformation rule,
click Add, and then browse to the location of the XSLT file that contains the transformation
rule.
To enable a transformation rule, in the Transformation Rules page select the check box
corresponding to the rule, then click Enable. To disable the a rule, click Disable.
If you add multiple transformation rules for a web service endpoint, the transformation rules
are applied in the order in which they are added.
To remove a transformation rule, in the Transformation Rules page select the check box
corresponding to the rule, then click Remove. This removes the transformation rule from the
list and removes the corresponding XSLT file.
Additionally, you can create, delete, and list transformation rules with the following asadmin
commands:
■ create-transformation-rule(1)
■ delete-transformation-rule(1)
■ list-transformation-rules(1)
You can disable this feature by using asadmin to set the endpoint's jbi-enabled property to
false. For example, to deactivate HelloImpl from the JBI environment, use the commands:
Open ESB implements an Enterprise Service Bus (ESB) runtime with sample service engines
and binding components. Open ESB enables you to create composite applications by loosely
coupling enterprise applications and web services. Additionally, you can easily recompose such
composite applications, realizing the benefits of a true service oriented architecture (SOA). The
core of the Open ESB SDK is based on Java Business Integration (JBI) technology, defined in the
JSR 208 specification.
For more information on JBI and Open ESB, see Project Open ESB.
176 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
13
C H A P T E R 1 3
This section describes how to configure the Object Request Broker (ORB) and IIOP listeners. It
has the following topics:
■ “About the Object Request Broker” on page 177
■ “Configuring the ORB” on page 178
■ “Working with IIOP Listeners” on page 178
CORBA
The Application Server supports a standard set of protocols and formats that ensure
interoperability. Among these protocols are those defined by CORBA.
The CORBA (Common Object Request Broker Architecture) model is based on clients
requesting services from distributed objects or servers through a well-defined interface by
issuing requests to the objects in the form of remote method requests. A remote method request
carries information about the operation that needs to be performed, including the object name
(called an object reference) of the service provider and parameters, if any, for the invoked
method. CORBA automatically handles network programming tasks such as object
registration, object location, object activation, request de-multiplexing, error-handling,
marshalling, and operation dispatching.
177
Configuring the ORB
A CORBA object never talks directly with another. Instead, the object makes requests through a
remote stub to the ORB running on the local machine. The local ORB then passes the request to
an ORB on the other machine using the Internet Inter-Orb Protocol (IIOP for short). The
remote ORB then locates the appropriate object, processes the request, and returns the results.
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 the
Application Server via RMI-IIOP.
IIOP Listeners
An IIOP listener is a listen socket that accepts incoming connections from the remote clients of
enterprise beans and from other CORBA-based clients. Multiple IIOP listeners can be
configured for the Application Server. For each listener, specify a port number, a network
address, and optionally, security attributes.
To edit an IIOP listener, select Configuration > ORB > IIOP Listeners and select the listener to
be modified in the Admin Console. Modify the settings. If you have changed the port number,
restart the server.
To delete an IIOP listener, select Configuration > ORB > IIOP Listeners and select the listener
to be deleted in the Admin Console. Alternatively, you can use the delete-iiop-listener(1)
command.
178 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
14
C H A P T E R
Thread Pools
1 4
This chapter describes how to create, edit, and delete thread pools. It has the following sections:
■ “About Thread Pools” on page 179
■ “Configuring Thread Pools” on page 180
The Java Virtual Machine (JVM) can support many threads of execution at once. To help
performance, the Application Server maintains one or more thread pools. It is possible to assign
specific thread pools to connector modules and to the ORB.
One thread pool can serve multiple connector modules and enterprise beans. Request threads
handle user requests for application components. When the 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.
Specify the minimum and maximum number of threads that are reserved for requests from
applications. The thread pool is dynamically adjusted between these two values. 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.
Avoid thread starvation, where one resource adapter or application occupies all threads in the
Application Server, by dividing the Application Server threads into different thread-pools.
See Also:
179
Configuring Thread Pools
For more details on creating thread pools, click Help in the Admin Console.
You can also create a thread pool from the command line by using the asadmin command,
create-threadpool(1).
See Also:
■ “About Thread Pools” on page 179
■ “Editing the Thread Pool Settings” on page 181
■ “Deleting a Thread Pool” on page 181
180 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Configuring Thread Pools
For more details on editing thread pools, click Help in the Admin Console.
You can also create a thread pool from the command line by using the asadmin command,
delete-threadpool(1).
See Also:
■ “About Thread Pools” on page 179
■ “Creating a Thread Pool” on page 180
■ “Editing the Thread Pool Settings” on page 181
Configuring Logging
This chapter briefly describes how to use the Admin Console to configure logging and view the
server log. This chapter contains the following sections:
■ “About Logging” on page 183
■ “Configuring Logging” on page 186
About Logging
■ “Log Records” on page 183
■ “The Logger Namespace Hierarchy” on page 184
Log Records
The Application Server uses the Java EE 5 platform Logging API specified in JSR 047.
Application Server logging messages are recorded in the server log, normally found at
domain-dir/logs/server.log.
The domain-dir/logs directory contains two other kinds of logs in addition to the server log. In
the access subdirectory are the HTTP Service access logs, and in the tx subdirectory are the
Transaction Service logs. For information about these logs, click Help in the Admin Console.
The components of the Application Server generate logging output. Application components
can also generate logging output.
Application components may use the Apache Commons Logging Library to log messages. The
platform standard JSR 047 API, however, is recommended for better log configuration.
183
About Logging
For example:
[#|2004-10-21T13:25:53.852-0400|INFO|sun-appserver-epe8.1|javax.enterprise.
system.core|_ThreadID=13;|CORE5004: Resource Deployed:
[cr:jms/DurableConnectionFactory].|#]
In this example,
■ [# and #] mark the beginning and end of the record.
■ The vertical bar (|) separates the record fields.
■ 2004-10-21T13:25:53.852-0400 specifies the date and time.
■ The Log Level is INFO. This level may have any of the following values: SEVERE, WARNING,
INFO, CONFIG, FINE, FINER, and FINEST.
■ The ProductName-Version is sun-appserver-pe8.1.
■ The LoggerName is a hierarchical logger namespace that identifies the source of the log
module, in this case javax.enterprise.system.core.
■ The Key Value Pairs are key names and values, typically a thread ID such as _ThreadID=14;.
■ The Message is the text of the log message. For all Application Server SEVERE and WARNING
messages and many INFO messages, it begins with a message ID that consists of a module
code and a numerical value (in this case, CORE5004).
See Also:
■ “The Logger Namespace Hierarchy” on page 184
Admin javax.enterprise.system.tools.admin
Classloader javax.enterprise.system.core.classloading
Configuration javax.enterprise.system.core.config
184 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
About Logging
Connector javax.enterprise.resource.resourceadapter
CORBA javax.enterprise.resource.corba
Deployment javax.enterprise.system.tools.deployment
JavaMail javax.enterprise.resource.javamail
JAXR javax.enterprise.resource.webservices.registry
JAXRPC javax.enterprise.resource.webservices.rpc
JMS javax.enterprise.resource.jms
JTA javax.enterprise.resource.jta
JTS javax.enterprise.system.core.transaction
Naming javax.enterprise.system.core.naming
Persistence oracle.toplink.essentials,
javax.enterprise.resource.jdo,
javax.enterprise.system.container.cmp
Root javax.enterprise
SAAJ javax.enterprise.resource.webservices.saaj
Security javax.enterprise.system.core.security
Server javax.enterprise.system
Util javax.enterprise.system.util
Verifier javax.enterprise.system.tools.verifier
Core javax.enterprise.system.core
See Also:
■ “Log Records” on page 183
■ “Configuring Log Levels” on page 186
Configuring Logging
■ “Configuring General Logging Settings” on page 186
■ “Configuring Log Levels” on page 186
■ “Viewing Server Logs” on page 187
For details on setting the various configuration parameters, click Help in the Admin Console.
See Also:
■ “Configuring Log Levels” on page 186
■ “Viewing Server Logs” on page 187
■ “Log Records” on page 183
■ “The Logger Namespace Hierarchy” on page 184
For details on setting the various configuration parameters, click Help in the Admin Console.
■ “Configuring General Logging Settings” on page 186
■ “Viewing Server Logs” on page 187
■ “Log Records” on page 183
■ “The Logger Namespace Hierarchy” on page 184
186 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Configuring Logging
Use the options provided in the Search Criteria area to display log results based on your
preferences.
■ Instance Name — Choose an instance name from the drop-down list to view the log for that
server instance. The default is the current server instance.
■ Log File — Choose a log file name from the drop-down list to view the contents of that log.
The default is server.log.
■ Timestamp — To view the most recent messages, select Most Recent (the default). To view
messages only from a certain period of time, select Specific Range and type a date and time
value in the From and To fields that appear. For the Time value, the syntax must take the
following form (SSS stands for milliseconds):
hh:mm:ss.SSS
For example:
17:10:00.000
If the From value is later than the To value, an error message appears.
■ Log Level — To filter messages by log level, choose a log level from the drop-down list. By
default, the display includes all messages that appear in the server log at the chosen log level
and more severe levels. Select the checkbox labeled “Do not include more severe messages”
to display messages at only the chosen level.
To ensure that the messages you want to view appear in the server log, first set the
appropriate log levels on the Log Levels page. See “Configuring Log Levels” on page 186
If you choose to filter log messages based on log level, only messages matching the specified
filter criteria are shown. However, this filtering does not affect which messages are logged to
the server log.
The most recent 40 entries in the server log appear, with the settings specified on the
Logging Settings and Log Levels pages.
Click the triangle next to the Timestamp header to sort the messages so that the most recent
one appears last.
To view a formatted version of any message, click the link marked
(details)
A window labeled Log Entry Detail appears, with a formatted version of the message.
At the end of the list of entries, click the buttons to view earlier or later entries in the log file.
Click Advanced Search in the Search Criteria area to make additional refinements to the log
viewer. Use the Advanced Options fields as follows:
■ Logger — To filter by module, choose one or more namespaces from the drop-down list.
Use shift-click or control-click to choose multiple namespaces.
Selecting a namespace at a higher level selects all the namespaces below it. For example,
selecting javax.enterprise.system also selects the loggers for all the modules under that
namespace: javax.enterprise.system.core, javax.enterprise.system.tools.admin,
and so on.
■ Custom Logger — To view messages from loggers specific to a particular application, type
the logger names in the text field, one per line. If the application has several modules, you
can view any or all of them. For example, suppose the application has loggers with the
following names:
com.mycompany.myapp.module1
com.mycompany.myapp.module2
com.mycompany.myapp.module3
To view messages from all modules in the application, type com.mycompany.myapp. To view
messages from module2 only, type com.mycompany.myapp.module2.
When you specify one or more custom loggers, messages from Application Server modules
appear only if you specify them explicitly in the Logger area.
■ Name-Value Pairs — To view output from a specific thread, type the key name and value
for that thread in the text field. The key name is _ThreadID. For example:
_ThreadID=13
See Also:
■ “Log Records” on page 183
188 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Configuring Logging
This chapter contains information about monitoring components using the Application Server
Admin Console. This chapter contains the following sections:
■ “About Monitoring” on page 191
■ “Enabling and Disabling Monitoring” on page 212
■ “Viewing Monitoring Data” on page 214
■ “Using JConsole” on page 229
About Monitoring
■ “Monitoring in the Application Server” on page 191
■ “Overview of Monitoring” on page 192
■ “About the Tree Structure of Monitorable Objects” on page 192
■ “About Statistics for Monitored Components and Services” on page 196
See Also:
■ “Overview of Monitoring” on page 192
191
About Monitoring
Overview of Monitoring
To monitor the Application Server, perform these steps:
1. Enable the monitoring of specific services and components using either the Admin Console
or the asadmin tool.
For more information on this step, refer to “To configure monitoring levels using the
Admin Console” on page 212.
For more information on this step, refer to “Enabling and Disabling Monitoring” on
page 212.
2. View monitoring data for the specified services or components using either the Admin
Console or the asadmin tool.
For more information on this step, refer to “Viewing monitoring data in the Admin
Console” on page 214 or “Viewing Monitoring Data With the asadmin Tool” on page 214.
For more information on this step, refer to “Viewing Monitoring Data” on page 214.
See Also:
■ “To configure monitoring levels using the Admin Console” on page 212
■ “Viewing monitoring data in the Admin Console” on page 214
■ “Viewing Monitoring Data With the asadmin Tool” on page 214
192 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
About Monitoring
applications
|--- application1
| |--- ejb-module-1
| | |--- ejb1 *
| | |--- cache (for entity/sfsb) *
| | |--- pool (for slsb/mdb/entity) *
| | |--- methods
| | |---method1 *
| | |---method2 *
| | |--- stateful-session-store (for sfsb)*
| | |--- 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 *
| | |--- cache (for entity/sfsb) *
| | |--- pool (for slsb/mdb/entity) *
| | |--- methods
| | |--- method1 *
| | |--- method2 *
|--- application2
http-service
|--- virtual-server-1
|--- http-listener-1 *
|--- http-listener-2 *
|--- virtual-server-2
|--- http-listener-1 *
|--- http-listener-2 *
http-service *
|---connection-queue *
|---dns *
|---file-cache *
|---keep-alive *
|---pwc-thread-pool *
|---virtual-server-1*
| |--- request *
|---virtual-server-2*
| |--- request *
resources
|---connection-pool1(either connector-connection-pool or jdbc)*
|---connection-pool2(either connector-connection-pool or jdbc)*
194 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
About Monitoring
connector service components. The nodes at which monitoring statistics are available are
marked with an asterisk (*). See “JMS/Connector Service Statistics” on page 204.
connector-service
|--- resource-adapter-1
| |-- connection-pools
| | |-- pool-1 (All pool stats for this pool)
| |-- work-management (All work mgmt stats for this RA)
jms-service
|-- connection-factories [AKA conn. pools in the RA world]
| |-- connection-factory-1 (All CF stats for this CF)
|-- work-management (All work mgmt stats for the MQ-RA)
orb
|--- connection-managers
| |--- connection-manager-1 *
| |--- connection-manager-1 *
thread-pools
| |--- thread-pool-1 *
| |--- thread-pool-2 *
196 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
About Monitoring
The statistics available for EJB method invocations are listed in the following table.
The statistics for EJB Session Stores are listed in the following table.
198 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
About Monitoring
The statistics available for EJB pools are listed in the following table.
The statistics available for EJB caches are listed in the following table.
The statistics available for Timers are listed in the following table.
200 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
About Monitoring
Statistics available for web modules are shown in “Web Container Statistics” on page 200.
sessionsize (EE only) AverageRangeStatistic Size of the session for the web
module. Value is either high, low,
or average, or is in bytes for
serialized sessions.
202 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
About Monitoring
TABLE 16–9 HTTP Service Statistics (applicable to Platform Edition only) (Continued)
Statistic Units Data Type Comments
The statistics available for the JDBC connection pool are shown in the following table.
204 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
About Monitoring
Statistics available for Connector Work Management are listed in “JMS/Connector Service
Statistics” on page 204.
206 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
About Monitoring
The statistics available for class loading in the JVM in J2SE 5.0 are shown in “JVM Statistics in
J2SE 5.0” on page 208.
The statistics available for compilation in the JVM in J2SE 5.0 are shown in “JVM Statistics in
J2SE 5.0” on page 208.
208 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
About Monitoring
The statistics available for garbage collection in the JVM in J2SE 5.0 are shown in “JVM
Statistics in J2SE 5.0” on page 208.
The statistics available for memory in the JVM in J2SE 5.0 are shown in “JVM Statistics in J2SE
5.0” on page 208.
The statistics available for the operating system in the JVM in J2SE 5.0 are shown in “JVM
Statistics in J2SE 5.0” on page 208.
The statistics available for the runtime in the JVM in J2SE 5.0 are shown in “JVM Statistics in
J2SE 5.0” on page 208.
210 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
About Monitoring
The statistics available for ThreadInfo in the JVM in J2SE 5.0 are shown in “JVM Statistics in
J2SE 5.0” on page 208.
TABLE 16–23 JVM Statistics for J2SE 5.0 - Thread Info (Continued)
Statistic Data Type Description
The statistics available for threads in the JVM in J2SE 5.0 are shown in “JVM Statistics in J2SE
5.0” on page 208.
212 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Enabling and Disabling Monitoring
By default, monitoring is turned off for all components and services. To turn monitoring on,
select LOW or HIGH from the combo box. To turn monitoring off, select OFF from the combo
box.
For details on configuring monitoring, see the online help available with the Admin Console.
For example, to turn on monitoring for the HTTP Service, use the following asadmin
command:
1 Use the get command to find out what services and components currently have monitoring
enabled.
asadmin> get --user admin-user server.monitoring-service.module-monitoring-levels.*
Returns:
server.monitoring-service.module-monitoring-levels.
connector-connection-pool = OFF
server.monitoring-service.module-monitoring-levels.
connector-service = OFF
server.monitoring-service.module-monitoring-levels.ejb-container = OFF
server.monitoring-service.module-monitoring-levels.http-service = OFF
server.monitoring-service.module-monitoring-levels.jdbc-connection-pool = OFF
server.monitoring-service.module-monitoring-levels.jms-service = OFF
server.monitoring-service.module-monitoring-levels.jvm = OFF
server.monitoring-service.module-monitoring-levels.orb = OFF
server.monitoring-service.module-monitoring-levels.thread-pool = OFF
server.monitoring-service.module-monitoring-levels.transaction-service = OFF
server.monitoring-service.module-monitoring-levels.web-container = OFF
On this page, it is possible to select and view monitoring data for JVM, server, applications,
thread pools, HTTP service, transaction service, log statistics, and call flow statistics. A diagram
showing how these components and services are organized is shown in “About the Tree
Structure of Monitorable Objects” on page 192.
For details on viewing or configuring monitoring, see the online help available with the Admin
Console.
For more information on the attributes for each component or service, refer to “About Statistics
for Monitored Components and Services” on page 196.
For example, to view monitoring data for the JVM, use the following asadmin command:
214 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Viewing Monitoring Data
1 To view the names of the objects that can be monitored, use the asadmin list command.
For example, to view a list of application components and subsystems that have monitoring
enable for the server instance, type the following command in a terminal window:
asadmin> list --user adminuser --monitor server
The preceding command returns a list of application components and subsystems that have
monitoring enabled, for example:
server.resources
server.connector-service
server.orb
server.jms-service
server.jvm
server.applications
server.http-service
server.thread-pools
For further information on using the list command, refer to list(1).
For further examples using the list command, refer to “Examples of the list and get
Commands” on page 217. For further information on the dotted names you can use with the
list command, refer to “Understanding and Specifying Dotted Names” on page 216.
server.jvm.dotted-name = server.jvm
server.jvm.heapsize-current = 21241856
server.jvm.heapsize-description = Provides statistical information about
the JVM’s memory heap size.
server.jvm.heapsize-highwatermark = 21241856
server.jvm.heapsize-lastsampletime = 1080232913938
server.jvm.heapsize-lowerbound = 0
server.jvm.heapsize-lowwatermark = 0
server.jvm.heapsize-name = JvmHeapSize
server.jvm.heapsize-starttime = 1080234457308
server.jvm.heapsize-unit = bytes
server.jvm.heapsize-upperbound = 518979584
server.jvm.uptime-count = 1080234457308
server.jvm.uptime-description = Provides the amount of time the JVM has
been running.
server.jvm.uptime-lastsampletime = 1080234457308
server.jvm.uptime-name = JvmUpTime
server.jvm.uptime-starttime = 1080232913928
server.jvm.uptime-unit = milliseconds
For further information using the get command, refer to get(1).
For further examples using the get command, refer to “Examples of the list and get
Commands” on page 217. For further information on the dotted names you can use with the get
command, refer to “Understanding and Specifying Dotted Names” on page 216.
For example, http-service is one of the valid monitorable object types and is a singleton. To
address a singleton child node representing the http-service of instance server, the dotted
name is:
server.http-service
Another example, application, is a valid monitorable object type and is not a singleton. To
address a non-singleton child node representing, for example, the application PetStore, the
dotted name is:
server.applications.petstore
The dotted names can also address specific attributes in monitorable objects. For example,
http-service has a monitorable attribute called bytesreceived-lastsampletime. The
following name addresses the bytesreceived attribute:
server.http-service.server.http-listener-1.
bytesreceived-lastsampletime
The administrator is not expected to know the valid dotted names for asadmin list and get
commands. The list command displays available monitorable objects, while the get
command used with a wildcard parameter allows the inspection of all available attributes on
any monitorable object.
The underlying assumptions for using the list and get commands with dotted names are:
■ Any list command that has a dotted name that is not followed by a wildcard (*) gets as its
result the current node’s immediate children. For example, list --user adminuser
--monitor server lists all immediate children belonging to the server node.
216 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Viewing Monitoring Data
■ Any list command that has a dotted name followed by a wildcard of the form .* gets as its
result a hierarchical tree of children nodes from the current node. For example, list
--user adminuser --monitor server.applications.* lists all children of applications
and their subsequent child nodes and so on.
■ Any list command that has a dotted name preceded or followed by a wildcard of the form
*dottedname or dotted * name or dotted name * gets as its result all nodes and their children
matching the regular expression created by the provided matching pattern.
■ A get command followed by a .* or a * gets as its result the set of attributes and their values
belonging to the current node to be matched.
For more information, read “Expected Output for list and get Commands at All Levels” on
page 223.
Example 1
asadmin> list --user admin-user --monitor server
The preceding command returns a list of application components and subsystems that have
monitoring enabled, for example:
server.resources
server.orb
server.jvm
server.jms-service
server.connector-service
server.applications
server.http-service
server.thread-pools
It is also possible to list applications that are currently monitored in the specified server
instance. This is useful when particular monitoring statistics are sought from an application
using the get command.
Example 2
asadmin> list --user admin-user --monitor server.applications
Returns:
server.applications.adminapp
server.applications.admingui
server.applications.myApp
For a more comprehensive example, see “To use the PetStore example” on page 219.
Example 1
Attempt to get all attributes from a subsystem for a specific object:
Returns:
server.jvm.dotted-name= server.jvm
server.jvm.heapsize-current = 21241856
server.jvm.heapsize-description = Provides statistical information about
the JVM’s memory heap size.
server.jvm.heapsize-highwatermark = 21241856
server.jvm.heapsize-lastsampletime = 1080232913938
server.jvm.heapsize-lowerbound = 0
server.jvm.heapsize-lowwatermark = 0
server.jvm.heapsize-name = JvmHeapSize
server.jvm.heapsize-starttime = 1080234457308
server.jvm.heapsize-unit = bytes
server.jvm.heapsize-upperbound = 518979584
server.jvm.uptime-count = 1080234457308
server.jvm.uptime-description = Provides the amount of time the JVM has
been running.
218 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Viewing Monitoring Data
server.jvm.uptime-lastsampletime = 1080234457308
server.jvm.uptime-name = JvmUpTime
server.jvm.uptime-starttime = 1080232913928
server.jvm.uptime-unit = milliseconds
Example 2
Attempt to get all attributes from a J2EE application:
Returns:
There are no monitorable attributes exposed at the J2EE-application level, therefore this reply
displays.
Example 3
Attempt to get a specific attribute from a subsystem:
Returns:
server.jvm.uptime-lastsampletime = 1093215374813
Example 4
Attempt to get an unknown attribute from within a subsystem attribute:
Returns:
2 Set some useful environment variables to avoid entering them for every command:
asadmin> export AS_ADMIN_USER=admin AS_ADMIN_PASSWORD=admin123
asadmin>export AS_ADMIN_HOST=localhost AS_ADMIN_PORT=4849
server
server.applications
server.applications.CometEJB
server.applications.ConverterApp
server.applications.petstore
server.http-service
server.resources
server.thread-pools
The list of monitorable components includes thread-pools, http-service, resources, and all
deployed (and enabled) applications.
4 List the monitorable subcomponents in the PetStore application (-m can be used instead of
--monitor):
asadmin> list -m server.applications.petstore
Returns:
server.applications.petstore.signon-ejb_jar
server.applications.petstore.catalog-ejb_jar
server.applications.petstore.uidgen-ejb_jar
server.applications.petstore.customer-ejb_jar
server.applications.petstore.petstore-ejb_jar
server.applications.petstore.petstore\.war
server.applications.petstore.AsyncSenderJAR_jar
server.applications.petstore.cart-ejb_jar
5 List the monitorable subcomponents in the EJB module signon-ejb_jar of the PetStore
application:
asadmin> list -m server.applications.petstore.signon-ejb_jar
Returns:
server.applications.petstore.signon-ejb_jar.SignOnEJB
server.applications.petstore.signon-ejb_jar.UserEJB
220 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Viewing Monitoring Data
6 List the monitorable subcomponents in the entity bean UserEJB for the EJB module
signon-ejb_jar of the PetStore application:
asadmin> list -m server.applications.petstore.signon-ejb_jar.UserEJB
Returns (with dotted name removed for space considerations):
server.applications.petstore.signon-ejb_jar.UserEJB.bean-cache
server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods
server.applications.petstore.signon-ejb_jar.UserEJB.bean-pool
7 List the monitorable subcomponents in the method getUserName for the entity bean UserEJB in
the EJB module signon-ejb_jar of the PetStore application:
asadmin> list -m
server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.getUserName
Returns:
8 There are no monitorable subcomponents for methods. Get all monitorable statistics for the
method getUserName.
asadmin> get -m
server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.getUserName.*
Returns:
server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.
getUserName.executiontime-count = 0
server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.
getUserName.executiontime-description = Provides the time in milliseconds
spent during the last successful/unsuccessful attempt to execute the
operation.
server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.
getUserName.executiontime-lastsampletime = 1079981809259
server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.
getUserName.executiontime-name = ExecutionTime
server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.
getUserName.executiontime-starttime = 1079980593137
server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.
getUserName.executiontime-unit = count
server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.
getUserName.methodstatistic-count = 0
server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.
getUserName.methodstatistic-description = Provides the number of times an
operation was called, the total time that was spent during the
9 To also get a specific statistic, such as execution time, use a command such as the following:
asadmin> get -m server.applications.petstore.signon-ejb_jar.
UserEJB.bean-methods.getUserName.executiontime-count
222 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Viewing Monitoring Data
Returns:
server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.
getUserName.executiontime-count = 1
get -m server.* No output except a message saying there are no attributes at this node.
The following table shows the command, dotted name, and corresponding output for the
applications level.
The following table shows the command, dotted name, and corresponding output for
stand-alone modules and enterprise applications at the applications level.
224 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Viewing Monitoring Data
list -m server.applications.app1. Hierarchy of child nodes and a list of all attributes for this
ejb-module1_jar.bean1 node and for any subsequent child nodes.
Note: In standalone modules, the node containing
the application name (app1 in this example) will not
appear.
list -m server.applications.app1. No attributes, but a message saying “Use get command with
ejb-module1_jar.bean1.bean-cache the --monitor option to view this node’s attributes and
values.”
Note: In standalone modules, the node containing
the application name (app1 in this example) will not
appear.
list -m server.applications.app1. No attributes, but a message saying “Use get command with
ejb-module1_jar.bean1.bean-method.method1 the --monitor option to view this node’s attributes and
values.”
Note: In standalone modules, the node containing
the application name (app1 in this example) will not
appear.
list -m server.applications.app1.web-module1_war. No attributes, but a message saying “Use get command with
virtual_server.servlet1 the --monitor option to view this node’s attributes and
values.”
The following table shows the command, dotted name, and corresponding output for the
HTTP Service level.
226 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Viewing Monitoring Data
The following table shows the command, dotted name, and corresponding output for the
thread pools level.
The following table shows the command, dotted name, and corresponding output for the
resources level.
The following table shows the command, dotted name, and corresponding output for the
transaction service level.
The following table shows the command, dotted name, and corresponding output for the ORB
level.
228 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Using JConsole
The following table shows the command, dotted name, and corresponding output for the JVM
level.
Using JConsole
This section contains the following topics:
■ “Securing JConsole to Application Server Connection” on page 230
■ “Prerequisites for Connecting JConsole to Application Server” on page 231
■ “Connecting JConsole to Application Server” on page 231
■ “Connecting JConsole Securely to Application Server” on page 232
Administration (management and monitoring) of the Application Server is based on JMX. This
means that the managed components are represented as MBeans. With Java 2 Standard Edition
(J2SE) 5.0, you can monitor the JVM and view the JVM MBeans to understand what is going on
there. To expose this instrumentation, Application Server provides a configuration of Standard
JMX Connector Server called System JMX Connector Server. When the Application Server
starts up, an instance of this JMX Connector Server starts up, exposing the instrumentation to
trusted clients.
The Java Monitoring and Management Console (JConsole) is a popular JMX Connector that
can manage a JMX backend. JConsole
(http://java.sun.com/j2se/1.5.0/docs/tooldocs/share/jconsole.html) is available as
part of the standard JDK distribution beginning with J2SE 5.0. For more information on
JConsole, see http://java.sun.com/developer/technicalArticles/J2SE/jconsole.html
When you configure JConsole with Application Server, the Application Server becomes the
JMX Connector's server-end and JConsole becomes the JMX Connector's preferred client-end.
“Connecting JConsole to Application Server” on page 231shows how to make a successful
connection .
Note – RMI over SSL does not provide additional checks to ensure that the client is talking to
the intended server. Thus, there is always a possibility, while using JConsole, that you are
sending the user name and password to a malicious host. It is completely up to the
administrator to make sure that security is not compromised.
When you install a Platform Edition domain on a machine such as appserver.sun.com, you
will see the following in the DAS's (Domain Administration Server, the admin server or simply
the domain) domain.xml:
230 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Using JConsole
The security-enabled flag for the JMX Connector is false. If you are running the Enterprise
Edition, or if you have turned on security for the JMX Connector in the Platform Edition, this
flag is set to true.
The client end also has an installation of Application Server. Let us assume that the client end is
a Windows machine with Java SE 5.0 and Application Server installed.
Note – The Application Server installation is needed on the client end only when your
Application Server domain has security enabled on the remote machine (the default for
Enterprise Edition). If you just want to administer an Application Server Platform Edition
domain on the Solaris machine above, you do not need the Application Server installation on
this client machine.
If the server and client ends are on the same machine, you can use localhost to specify the host
name.
3 In the Connect to Agent tab of JConsole, enter user name, password, host name and port (8686,
by default).
The user name refers to the admin user name and password refers to the admin password of the
domain.
4 Click Connect.
In the JConsole window you will see all your MBeans, VM information etc., in various tabs.
3 From the local Application Server installation, run install-dir\bin\asadmin list --user admin
--secure=true --host appserver.sun.com --port 4849 (where 4849 is the server's admin
port).
Though asadmin list command is chosen for this example, you can run any remote asadmin
command. You will now be prompted to accept the certificate sent by the DAS of
appserver.sun.com.
Note – This step is not required if your server machine and client machine is the same. That is, if
you are running JConsole also on appserver.sun.com.
232 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Using JConsole
5 Let JConsole know the trust store location by using the following JConsole command:
JDK-dir\bin\jconsole.exe -J-Djavax.net.ssl.trustStore="C:\Documents and
Settings\user\.asadmintruststore"
7 In the Connect to Agent tab of JConsole, enter user name, password, host name and port (8686,
by default).
The user name refers to the admin user name and password refers to the admin password of the
domain.
8 Click Connect.
In the JConsole window you will see all your MBeans, VM information etc., in various tabs.
This section contains information about setting administration policies to automate routine
administration tasks, configure self-tuning of the application server for diverse runtime
condition and improve availability by preventing failures.
This section contains the following topics:
■ “About Management Rules” on page 235
■ “To Configure New Management Rule” on page 236
■ “To Configure Monitor Properties” on page 237
■ “To Configure Notification Properties” on page 238
■ “To Configure Life Cycle Event Properties” on page 238
■ “To Configure Log Properties” on page 239
■ “To Configure Timer Event Properties” on page 239
■ “To Configure Trace Event Properties” on page 239
■ “Equivalent asadmin Command” on page 240
235
About Management Rules
For example, when a SEVERE message occurs in the EJB logger, the log record will be sent to
the action Mbean as a field of javax.management.LogNotification.
The action specified in your rule is executed by an 'action' MBean. Therefore, before
configuring a management rule, you should deploy a custom Mbean designed to receive event
notifications and take appropriate action. For details on developing a custom Mbean and
deploying it, see Chapter 14, “Developing Custom MBeans,” in Sun Java System Application
Server Platform Edition 9 Developer’s Guide.
1 Access the Management Rules page by going to Configurations > Admin Service > Management
Rules.
3 Select New.
4 In the Name field, provide a name for this rule. For example, Rule1.
236 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
About Management Rules
■ Notification events
Notification events from a custom Mbean.
■ Lifecycle events
Corresponds to events in the com.sun.appserv.server.LifecycleEvent interface.
1 Enter the Observed object name of the Mbean you want to monitor.
Specifies the javax.management.ObjectName of a system Mbean or the name attribute of a
custom Mbean.
The ObjectName is of the form
domain:type=impl-class-name,name=BeanName,server=server, where domain is the JMX
Domain where the MBean is registered and BeanName is the name of the Mbean object. For
example:
user:impl-class-name=com.sun.example.mbeans.Memory,name=MemoryMBean,server=server.
You can determine the ObjectName of an Mbean from the deployed custom Mbean, and then
add “server=server.”
4 Specify the granularity, in milliseconds, at which data is collected for this attribute.
The default is 10 seconds.
■ Gauge — If the monitor is of type GaugeMonitor or the JSR 77 statistic field being monitored
is of an integral type containing a gauge value.
■ String — If the monitor is of type StringMonitor
6 Specify the action you want performed when the monitored data meets the condition specified
in the event type.
1 Select the deployed custom Mbean from the drop-down list or specify the Object Name of the
custom Mbean.
The Object Name is of the form =
domain:type=implementation-class-name,name=implementation-class-name, where
domain is the JMX Domain where the MBean is registered.
3 Enter a description for the event associated with this management rule.
4 Specify the action you want performed when the monitored data meets the condition specified
in the event type.
2 Enter a description for the event associated with this management rule.
3 Specify the action you want performed when the monitored data meets the condition specified
in the event type.
238 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
About Management Rules
3 Enter a description for the event associated with this management rule.
4 Specify the action you want performed when the monitored data meets the condition specified
in the event type.
3 Specify the time period in milliseconds at which notifications will be sent to the action Mbean.
5 Specify the message that will be written to the log when the pattern occurs.
6 Enter a description for the event associated with this management rule.
7 Specify the action you want performed when the monitored data meets the condition specified
in the event type.
2 Enter a description for the event associated with this management rule.
3 Specify the action you want performed when the monitored data meets the condition specified
in the event type.
For details on each option, see the man page for create-management-rule at Sun Java System
Application Server Platform Edition 9 Reference Manual
240 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
18
C H A P T E R 1 8
The Diagnostic Service provides more visibility into and control of the runtime performance of
a server and its applications, allowing you to diagnose and isolate faults as they occur.
This chapter contains the following sections:
■ “What is the Diagnostic Framework?” on page 241
■ “Diagnostic Service Framework” on page 241
241
Diagnostic Service Framework
Data collected using native code is not available on the Platform Edition of Application
Server.
■ Capture Application Deployment Descriptor: Deployment descriptors such as
ejb-jar.xml, sun-ejb-jar.xml, web.xml, sun-web.xml,
■ Log Level:
■ Log Entries:
The number of log entries to be included in the generated diagnostic report.
242 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
19
C H A P T E R 1 9
The Java virtual machine (JVM) is an interpretive computing engine responsible for running
the byte codes in a compiled Java program. The JVM translates the Java byte codes into the
native instructions of the host machine. The application server, being a Java process, requires a
JVM in order to run, and to support the Java applications running on it. JVM settings are part of
an application server configuration.
This chapter explains the configuration of the Java Virtual Machine (JVMTM) and other
advanced settings. It contains the following sections:
■ “Tuning the JVM Settings” on page 243
■ “Configuring Advanced Settings” on page 244
Note – If you enter a nonexistent directory name or the installation directory name of an
unsupported version of the Java EE software, then the Application Server will not start.
■ Javac Options: Enter the command-line options for the Java programming language
compiler. The Application Server runs the compiler when EJB components are deployed.
■ Debug: To set up debugging with the JPDA (Java Platform Debugger Architecture), select
this Enabled checkbox.
243
Configuring Advanced Settings
JPDA is used by application developers. For more information, see Chapter 4, “Debugging
Applications,” in Sun Java System Application Server Platform Edition 9 Developer’s Guide.
■ Debug Options: Specify the JPDA options passed to the JVM when the debugging is
enabled.
■ RMI Compile Options: Enter the command-line options for the rmic compiler. The
Application Server runs the rmic compiler when EJB components are deployed.
■ Bytecode Preprocessor: Enter a comma separated list of class names. Each class must
implement the com.sun.appserv.BytecodePreprocessor interface. The classes are called
in the order specified.
Tools such as profilers may require entries in the Bytecode Preprocessor field. Profilers
generate information used to analyze server performance. For more information about
profiling, see Chapter 4, “Debugging Applications,” in Sun Java System Application Server
Platform Edition 9 Developer’s Guide.
244 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Configuring Advanced Settings
■ Verifier: Check the Verifier Enabled box to verify your deployment descriptor files. This is
optional.
■ Precompile: Check the Precompile Enabled box to precompile any JSP files.
If your domain is stopped unexpectedly (for example, if you need to restart your machine), you
can configure your system to automatically restart the domain.
If you use /etc/rc.local, or your system’s equivalent, place a line in /etc/rc.local that calls
the desired asadmin command.
For example, to restart domain1 for an Application Server installed in the opt/SUNWappserver
directory, using a password file called password.txt:
Put the text on one line. The first three letters are a unique designator for the process and can be
altered.
247
Restarting Automatically on the Microsoft Windows Platform
The sc.exe command comes with Windows XP and is either located in the
C:\windows\system32 directory or C:\winnt\system32 directory.
For example, to create a service called SunJavaSystemAppServer DOMAIN1 that starts and stops
the domain domain1, using a password file C:\Sun\AppServer\password.txt:
Note – The start and stop commands entered as part of the binPath= parameter must have the
correct syntax. To test, run the commands from the command prompt. If the commands do not
properly start or stop the domain, the service does not work correctly.
Note – Don’t use a mixture of asadmin start and stop commands and service start and stops.
Mixing the two can cause the server status to be out of sync. For example, the service might not
show that the component has started even though the component is not running. To avoid this
situation, always use the sc.exe command to start and stop the component when using
services.
248 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Security for Automatic Restarts
AS_ADMIN_password=password
AS_ADMIN_password=adminadmin
3. On UNIX, use the --passwordfile option in the line you add to the inittab file:
AS_ADMIN_password=password
AS_ADMIN_password=adminadmin
■ Creating a service using a password that is populated from a command line option:
2 Create the alias for the admin user. To do this, from the directory where the domain.xml file
resides (install_dir/domains/domain_dir/config by default), run the following asadmin
command:
create-password-alias --port 4848 --user admin --password adminadmin
--aliaspassword adminadmin adminalias
250 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Executing Local Admin CLI Commands without Admin Password
This appendix describes the dotted name attributes that can be used to address the MBean and
its attributes. Every element in the domain.xml file has a corresponding MBean. Because the
syntax for using these names involves separating names between periods, these names are called
dotted names.
The following table identifies the top level elements and the corresponding dotted name prefix.
applications domain.applications
resources domain.resources
configurations domain.configs
servers domain.servers
Every server contained in this element is accessible as server-name. Where
server-name is the value of the name attribute for the server subelement.
253
Top Level Elements
clusters domain.clusters
Every cluster contained in this element is accessible as cluster-name. Where
cluster-name is the value of the name attribute for the cluster subelement.
node-agents domain.node-agents
lb-configs domain.lb-configs
system-property domain.system-property
The following table identifies dotted names beginning with the server name, or cluster name,
that are aliased to top level names under the domain:
target.applications.* domain.applications.* The alias resolves to applications referenced by the target only.
The following table identifies dotted names beginning with the server name, or cluster name,
that are aliased to top level names within the configuration referenced by the server or cluster.
target.http-service config-name.http-service
target.iiop-service config-name.iiop-service
target.admin-service config-name.admin-service
target.web-container config-name.web-container
target.ejb-container config-name.ejb-container
target.mdb-container config-name.mdb-container
254 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Elements Not Aliased
target.jms-service config-name.jms-service
target.log-service config-name.log-service
target.security-service config-name.security-service
target.transaction-service config-name.transaction-service
target.monitoring-service config-name.monitoring-service
target.java-config config-name.java-config
target.availability-service config-name.availability-service
target.thread-pools config-name.thread-pools
257
The asadmin Command Usage
To access the man pages for the Application Server asadmin utility commands on the Solaris
platform, add $AS_INSTALL/man to your MANPATH environment variable.
You can obtain overall usage information for any of the asadmin utility commands by invoking
the --help option. If you specify a command, the usage information for that command is
displayed. Using the --help option without a command displays a listing of all the available
commands.
258 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
The asadmin Command Usage
you invoke asadmin once, it then accepts multiple commands until you exit asadmin and return
to the normal command shell invocation. Environment variables set while in multiple
command mode are used for all subsequent commands until you exit multimode. You may
provide commands by passing a previously prepared list of commands from a file or standard
input (pipe). Additionally, you can invoke multimode from within a multimode session; once
you exit the second multimode environment, you return to your original multimode
environment.
You can also run the asadmin utility in interactive or non-interactive mode. By default, the
interactive mode option is enabled. It prompts you for the required arguments. You can use the
interactive mode option in command shell invocation under all circumstances. You can use the
interactive mode option in multimode when you run one command at a time from the
command prompt; and when you run in multimode from a file. Commands in multimode,
when piped from an input stream, and commands invoked from another program, cannot run
in the interactive mode.
Local Commands
Local commands can be executed without the presence of an administration server. However, it
is required that the user be logged into the machine hosting the domain in order to execute the
command and have access (permissions) for the installation and domain directories.
For commands that can be executed locally or remotely, if any one of the--host, --port,
--user, and --passwordfile options are set, either in the environment or in the command
line, the command will run in remote mode. Also, if none of the local options are set, either on
the command line or in the environment, the command is executed locally by default. For
commands that can be executed locally or remotely, if any one of the--host, --port, --user,
and --passwordfile options are set, either in the environment or in the command line, the
command will run in remote mode.
Remote Commands
Remote commands are always executed by connecting to an administration server and
executing the command there. A running administration server is required. All the remote
commands require the following common options:
-p --port The HTTP/S port for administration. This is the port to which you
should point your browser in order to manage the domain. For
example, http://localhost:4848. The default port number for
Platform Edition is 4848.
--passwordfile The --passwordfile option specifies the name of a file containing the
password entries in a specific format. The entry for the password must
have the AS_ADMIN_ prefix followed by the password name in
uppercase letters.
For example, to specify the domain administration server password,
use an entry with the following format:
AS_ADMIN_PASSWORD=password, where password is the actual
administrator password. Other passwords that can be specified
include AS_ADMIN_PASSWORD, AS_ADMIN_USERPASSWORD, and
AS_ADMIN_ALIASPASSWORD, AS_ADMIN_MAPPEDPASSWORD.
All remote commands must specify the admin password to
authenticate to the domain administration server, either
through--passwordfile or asadmin login, or interactively on the
command prompt. The asadmin login command can be used only to
specify the admin password. For other passwords, that must be
specified for remote commands, use the --passwordfile or enter
them at the command prompt.
If you have authenticated to a domain using the asadmin login
command, then you need not specify the admin password through the
--passwordfile option on subsequent operations to this particular
domain. However, this is applicable only to AS_ADMIN_PASSWORD
option. You will still need to provide the other passwords, for
example, AS_ADMIN_USERPASSWORD, as and when required by
individual commands, such as update-file-user.
For security reasons, passwords specified as an environment variable
will not be read by asadmin.
-I --interactive If set to true (default), only the required password and user options are
prompted.
-t --terse Indicates that any output data must be very concise, typically avoiding
human-friendly sentences and favoring well-formatted data for
consumption by a script. Default is false.
260 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
The List, Get and Set Commands
-e --echo Setting to true will echo the command line statement on the standard
output. Default is false.
AS_ADMIN_PASSWORD=value
AS_ADMIN_ADMINPASSWORD=value
AS_ADMIN_USERPASSWORD=value
AS_ADMIN_MASTERPASSWORD=value
Multimode Command
Use the multimode command to process the asadmin commands. The command-line interface
will prompt you for a command, execute that command, display the results of the command,
and then prompt you for the next command. Additionally, all the asadmin option names set in
this mode are used for all the subsequent commands. You can set your environment and run
commands until you exit multimode by typing “exit” or “quit.” You can also provide commands
by passing a previously prepared list of commands from a file or standard input (pipe). You can
invoke multimode from within a multimode session; once you exit the second multimode
environment, you return to your original multimode environment.
The configuration hierarchy provides attributes that are modifiable; whereas the attributes of
management components from themonitoring hierarchy are purely read-only.
Theconfiguration hierarchy is loosely based on the domain's schema document; whereas the
monitoring hierarchy is a little different.
Use the list command to reach a particular management component in the desired hierarchy.
Then, invoke the getand set commands to get the names and values or set the values of the
attributes of the management component at hand. Use the wildcard (*) option to fetch all
matches in a given fully qualified dotted name.
An Application Server dotted name uses the “.” (period) as a delimiter to separate the parts of a
complete name. This is similar to how the “/” character is used to delimit the levels in the
absolute path name of a file in the UNIX file system. The following rules apply while forming
the dotted names accepted by the get, set, and list commands. Note that a specific command
has some additional semantics applied.
■ A . (period) always separates two sequential parts of the name.
■ A part of the name usually identifies an application server subsystem and/or its specific
instance. For example: web-container, log-service, thread-pool-1, etc.
■ If any part of the name itself contains a . (period), then it must be escaped with a leading
\(backslash) so that the “.” does not act like a delimiter.
■ An * (asterisk) can be used anywhere in the dotted name and it acts like the wildcard
character in regular expressions. Additionally, an * can collapse all the parts of the dotted
name. Long dotted name like "<classname>this.is.really.long.hierarchy
</classname>" can be abbreviated to "<classname>th*.hierarchy</classname>." But
note that the . always delimits the parts of the name.
■ On Solaris, quotes are needed when executing commands with * as the option value or
operand.
■ The top level switch for any dotted name is --monitor or -m that is separately specified on a
given command line. The presence or lack of this switch implies the selection of one of the
two hierarchies for application server management: monitoring and configuration.
■ If you happen to know the exact complete dotted name without any wildcard character, then
list and get/set have a little difference in their semantics:
■ The list command treats this complete dotted name as the complete name of a parent
node in the hierarchy. Upon providing this name to the list command, it simply
returns the names of the immediate children at that level. For example,list
server.applications.web-module will list all the web modules deployed to the domain
or the default server.
■ The get and set commands treat this complete dotted name as the fully qualified name
of the attribute of a node (whose dotted name itself is the name that you get when you
remove the last part of this dotted name) and it gets/sets the value of that attribute. This
is true if such an attribute exists. You will never start with this case because in order to
find out the names of attributes of a particular node in the hierarchy, you must use the
262 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Server Lifecycle Commands
The list command is the progenitor of navigational capabilities of these three commands. If
you want to set or get attributes of a particular application server subsystem, you must know
its dotted name. The list command is the one which can guide you to find the dotted name of
that subsystem. For example, to find out the modified date (attribute) of a particular file in a
large file system that starts with /. First you must find out the location of that file in the file
system, and then look at its attributes. Therefore, two of the first commands to understand the
hierarchies in the Application Server are: * list "*" and <command>* list * --monitor.
Consult the get, set or list commands man pages to identify the sorted output of these
commands.
Command Definition
create-service Configures the starting of a DAS on an unattended boot. On Solaris 10, this
command uses the Service Management Facility (SMF). This is a local
command and must be run as the OS-level user with superuser privileges. It is
available only for Solaris 10. When the service is created, the user has to start,
enable, disable, delete, or stop the service. The DAS must be stored on a folder
to which the super-user has access. The configuration cannot be stored on a
network file system. The service is created such that it is controlled by the
OS-level user, who owns the folder where the configuration of the DAS resides.
To run this command, you must have solaris.smf.* authorization.
delete-domain Deletes the named domain. The domain must already exist and must be
stopped.
start-domain Starts a domain. If the domain directory is not specified, the domain in the
default install_dir/domains directory is started. If there are two or more
domains, the domain_name operand must be specified.
list-domains Lists the domain. If the domain directory is not specified, the domain in the
default install_dir/domains directory is listed. If there is more than one
domain, the domain_name operand must be specified.
list-backups Displays the status information about all backups in the backup repository.
shutdown Gracefully brings down the administration server and all the running
instances. You must manually start the administration server to bring it up
again.
Command Definition
show-component-status Gets the status of the deployed component. The status is a string representation
returned by the server. The possible status strings include status of app-name is
enabled or status of app-name is disabled.
list-components Lists all deployed Java EE 5 components. If the --type option is not specified,
all components are listed.
Deployment Commands
The deployment commands deploy an application or get the client stubs.
264 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Message Queue Administration Commands
Command Definition
get-client-stubs Gets the client stubs JAR file for an AppClient standalone module or an
application containing the AppClient module, from the server machine to the
local directory. The application or module should be deployed before
executing this command. it is also possible to get the client stubs as part of the
deploy command using --retrieve option.
Command Definition
create-jmsdest Creates a JMS physical destination. Along with the physical destination, you
use the create-jms-resource command to create a JMS destination resource
that has a Name property that specifies the physical destination.
flush-jmsdest Purges the messages from a physical destination in the specified target's JMS
Service configuration.
jms-ping Checks if the JMS service (also known as the JMS provider) is up and running.
When you start the Application Server, the JMS service starts by default.
Additionally, it pings only the default JMS host within the JMS service. It
displays an error message when it is unable to ping a built-in JMS service.
Command Definition
create-jdbc-connection-pool Registers a new JDBC connection pool with the specified JDBC
connection pool name.
delete-jdbc-connection-pool Deletes a JDBC connection pool. The operand identifies the JDBC
connection pool to be deleted.
list-jdbc-connection-pools Gets the JDBC connection pools that have been created.
list-jms-resources Lists the existing JMS resources (destination and connection factory
resources).
delete-jndi-resource Removes the JNDI resource with the specified JNDI name.
266 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Resource Management Commands
create-connector-connection-pool Adds a new connector connection pool with the specified connection
pool name.
delete-connector-connection-pool Removes the connector connection pool specified using the operand
connector_connection_pool_name.
list-connector-connection-pools Lists the connector connection pools that have been created.
create-connector-resource Registers the connector resource with the specified JNDI name.
delete-connector-resource Removes the connector resource with the specified JNDI name.
create-admin-object Adds the administered object that has the specified JNDI name.
delete-admin-object Removes the administered object with the specified JNDI name.
add-resources Creates the resources named in the specified XML file. The
xml_file_path is the path to the XML file containing the resources to
be created. The DOCTYPE should be specified as
install_dir/lib/dtds/sun-resources_1_2.dtd in the
resources.xml file.
ping-connection-pool Tests if a connection pool is usable for both JDBC connection pools
and connector connection pools. For example, if you create a new
JDBC connection pool for an application that is expected to be
deployed later, the JDBC pool is tested with this command before
deploying the application. Before pinging a connection pool, you
must create the connection pool with authentication and ensure that
the Application Server or database is started.
Command Definition
enable Enables the specified component. If the component is already enabled, then it is
re-enabled. The component must have been deployed in order to be enabled. If
it has not been deployed, then an error message is returned.
disable Immediately disables the named component. The component must have been
deployed. If the component has not been deployed, an error message is
returned.
export Marks a variable name for automatic export to the environment of subsequent
commands. All subsequent commands use the variable name value as specified
unless you unset them or exit multimode.
list Lists the configurable element. On Solaris, quotes are needed when executing
commands with * as the option value or operand.
unset Removes one or more variables you set for the multimode environment. The
variables and their associated values will no longer exist in the environment.
268 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Application Server Configuration Commands
Command Definition
create-ssl Creates and configures the SSL element in the selected HTTP listener, IIOP
listener, or IIOP service to enable secure communication on that
listener/service.
delete-ssl Deletes the SSL element in the selected HTTP listener, IIOP listener, or IIOP
service.
Command Definition
create-lifecycle-module Creates a lifecycle module. The lifecycle modules provide a means of running
short or long duration Java-based tasks within the Application Server
environment.
create-audit-module Adds the named audit module for the plug-in module that implements the
audit capabilities.
Command Definition
create-profiler Creates the profiler element. A server instance is tied to a particular profiler,
by the profiler element in the Java configuration. Changing a profiler requires
you to restart the server.
delete-profiler Deletes the profiler element you specify. A server instance is tied to a
particular profiler by the profiler element in the Java configuration. Changing
a profiler requires you to restart the server.
create-jvm-option Creates JVM options in the Java configuration or profiler elements of the
domain.xml file. If JVM options are created for a profiler, they are used to
record the settings needed to get a particular profiler going. You must restart
the server for newly created JVM options to take effect.
delete-jvm-option Removes JVM options from the Java configuration or profiler elements of the
domain.xml file.
Command Definition
create-virtual-server Creates the named virtual server. Virtualization in the Application Server
allows multiple URL domains to be served by a single HTTP server process
that is listening on multiple host addresses. If the application is available at
two virtual servers, they still share the same physical resource pools.
delete-virtual-server Removes the virtual server with the specified virtual server ID.
Threadpool Commands
The threadpool commands allow you to control these elements. These commands are
supported in remote mode only.
270 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
User Management Commands
Command Definition
create-threadpool Creates a threadpool with the specified name. You can specify maximum and
minimum number of threads in the pool, the number of work queues, and the
idle timeout of a thread. The created thread pool can be used for servicing
IIOP requests and for resource adapters to service work management
requests. A created thread pool can be used in multiple resource adapters.
Command Definition
freeze-transaction Freezes the transaction subsystem during which time all the inflight
transactions are suspended. Invoke this command before rolling back any
inflight transactions. Invoking this command on an already frozen
transaction subsystem has no effect.
unfreeze-transaction Resumes all the suspended inflight transactions. Invoke this command on an
already frozen transaction.
Command Definition
create-file-user Creates an entry in the keyfile with the specified username, password, and
groups. Multiple groups can be created by separating them with a colon (:).
delete-file-user Deletes the entry in the keyfile with the specified username.
update-file-user Updates an existing entry in the keyfile using the specified user_name,
user_password and groups. Multiple groups can be entered by separating
them, with a colon (:).
list-file-groups Lists the users and groups supported by the file realm authentication. This
command lists available groups in the file user.
Command Definition
start-callflow-monitoring Collects and correlates data from Web container, EJB container and JDBC
to provide a complete call flow/path of a request. Data is collected only if
callflow-monitoring is ON.
Rule Commands
Rules commands allow you to manage rules for the server. These commands are supported in
remote mode only.
Command Definition
272 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Diagnostic and Logging Commands
Database Commands
The database commands allow you to start and stop the Java DB database (based on Apache
Derby). These commands are supported in local mode only.
Command Definition
start-database Starts the Java DB server that is available with the Application Server. Use this
command only for working with applications deployed to the Application
Server.
stop-database Stops a process of the Java DB server. Java DB server is available with the
Application Server.
Command Definition
generate-jvm-report Displays the threads (dump of stack trace), classes and memory for a given
target instance, including the Domain Administration Service. This
command works only with the application server instance processes. This
command replaces the traditional techniques like sending ctrl+break or
kill -3 signals to application server processes. The command will not
work if the target server instance is not running.
display-error-statistics Displays a summary list of severities and warnings in server.log since the
last server restart.
display-log-records Displays all the error messages for a given module at a given timestamp.
Command Definition
list-transformation-rules Lists all the transformation rules of a given web service in the order
they are applied.
unpublish-from-registry Unpublishes the web service artifacts from the registry servers.
274 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Password Commands
Command Definition
create-connector-security-map Creates a security map for the specified connector connection pool. If
the security map is not present, a new one is created. Also, use this
command to map the caller identity of the application (principal or
user group) to a suitable enterprise information system (EIS)
principal in container-managed transaction-based scenarios. One or
more named security maps may be associated with a connector
connection pool. The connector security map configuration supports
the use of the wild card asterisk (*) to indicate all users or all user
groups. For this command to succeed, you must have first created a
connector connection pool. The EIS is any system that holds the data
of an organization. It can be a mainframe, a messaging system, a
database system, or an application.
delete-connector-security-map Deletes a security map for the specified connector connection pool.
update-connector-security-map Modifies a security map for the specified connector connection pool.
Password Commands
The password commands allow you to manage passwords and ensure security for the
Application Server.
Command Definition
create-password-alias Creates an alias for a password and stores it in domain.xml. An alias is a token
of the form ${ALIAS=password-alias-password}. The password
corresponding to the alias name is stored in an encrypted form. This
command takes both a secure interactive form (in which the user is prompted
for all information) and a more script-friendly form, in which the password is
propagated on the command line.
change-admin-password This remote command modifies the admin password. This command is
interactive in that the user is prompted for the old and new admin password
(with confirmation).
change-master-password This local command is used to modify the master password. This command is
interactive in that the user is prompted for the old and new master password.
This command will not work unless the server is stopped.
Command Definition
Command Definition
create-mbean Creates and registers a custom MBean . If the target MBeanServer (DAS) is not
running, the MBean is not registered.
276 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Miscellaneous Commands
delete-mbean Deletes a custom MBean. Ensure that the target MBeanServer is running.
Miscellaneous Commands
The miscellaneous commands allow you to manage various aspects of the Application Server.
Command Definition
login Lets you log into a domain. If various application server domains are created
on various machines (locally), asadmin invocation from any of these
machines can manage the domains located elsewhere (remotely). This comes
in handy especially when a particular machine is chosen as an administration
client and it manages multiple domains and servers. asadmin commands that
are used to manage domains located elsewhere are called remote commands.
The asadmin login command eases the administration of such remote
domains. The login command runs only in the interactive mode. It prompts
you for the admin user name and password. On successful login, the file
.asadminpass will be created in the user's home directory. This is the same file
that is modified by the create-domain command while using the
--savelogin option. The domain must be running for this command to run.
version Displays the version information. If the command cannot communicate with
the administration server with the given user/password and host/port, then
the command will retrieve the version locally and display a warning message.
help Displays a list of all the asadmin utility commands. Specify the command to
display the usage information for that command
install-license Prevents unauthorized use of the Application Server. Allows you to install the
license file.
A client access, 32
ACC CloudScape JDBC driver, 44-45
See containers Connection, Factories, JMS, 57
application client, 81 connection factories, JMS, overview, 55-57
acceptor threads, in HTTP listeners, 163 connector, 33
Admin Console, 34 connector connection pools, JMS resources and, 57
applets, 81 connector resources, JMS resources and, 57
Application Server connectors, modules, 179
restart, 87 container, 32
shut down, 87 containers
Application Server domains, 36 applet, 81
applications, performance, 85 application client, 81
asadmin command, 180, 181 Enterprise JavaBeans, 81, 82, 85-87
create-threadpool, 180 configuring, 85-87
delete-threadpool, 181 Java EE, 81
asadmin utility, 34 servlet
See containers, 81
web, 81
web, 81
B CORBA, 177
bean-cache, monitoring attribute names, 199-200 threads, 179
create-domain command, 36
custom resources, using, 75
C
cache-hits, 199
cache-misses, 199 D
caching databases
cleanup, 86 DB2, 88
disabling, 85 Java DB
Enterprise JavaBeans, 85 Derby, 88
timeouts, 86 JNDI names, 73
279
Index
databases (Continued) F
MS SQL Server, 88 Foreign Providers, JMS, 60-69
Oracle, 88
PointBase, 88
resource references, 74
supported, 43 G
Sybase, 88 get command, monitoring data, 218
delete-domain command, 37
Derby JDBC driver, 44-45
Destination
Physical, JMS, 58 H
Resources, JMS, 58 HTTP listeners
destinations, JMS, overview, 55-57 acceptor threads, 163
default virtual server, 163
documentation, overview, 23-24
overview, 162-164
domains, creating, 36
HTTP service
HTTP listeners, 162-164
virtual servers, 161-162
E HTTP sessions, 83
ebXML, 166
Enterprise Java Beans, threads, 179
Enterprise JavaBeans I
activating, 82
IBM DB2 JDBC driver, 45, 47
active, 86 IIOP listeners, 178
authorization, 82 Inet MSSQL JDBC driver, 52
caching, 82, 85, 86-87 Inet Oracle JDBC driver, 51-52
creating, 82 Inet Sybase JDBC driver, 53
entity, 82, 85, 86-87 Informix Type 4 JDBC driver, 54
idle, 85, 86
message-driven, 82, 87
passivating, 82, 85, 86
persistent, 82 J
pooling, 85-86, 87 Java API for XML-based remote procedure calls
removing from cache, 86 (JAX-RPC), 167
removing idle, 87 Java API for XML Web Services (JAX-WS) 2.0, 167
session, 82 Java DB JDBC driver, 44-45
stateful session, 86-87, 87 Java Message Service (JMS), See JMS resources, 55
stateless session, 85 Java Naming and Directory Service, See JNDI, 82
timer service, 87-88 Javadoc, 24
entity beans JavaEE group, 115
See Enterprise JavaBeans JavaMail, 33
entity, 85 JavaServer Pages, 81
execution-time-millis, 197 JAX-RPC, 167
external repositories, accessing, 75 JAX-WS 2.0, 167
280 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Index
JBI providers, Web services as, 176 log levels, configuring, 186
JCE provider log records, 183-184
configuring, 142 logging
JDBC, 33 configuring general settings, 186
drivers, 156 configuring levels, 186
resources, 88 logger namespaces, 184-186
supported drivers, 43 overview, 183-184
JMS
viewing the server log, 187-189
Connection Factories, 57
Destination Resources, 58
Foreign Providers, 60-69
Physical Destination, 58 M
providers, 59-60
man pages, 34
Resource Adapter, Generic, 60-69
Message Queue software, 55
jms-max-messages-load, 199
Messaging, 33
JMS provider, 55
JMS resources MM MySQL Type 4 JDBC driver
connection factory resources, 55-57 non-XA, 49-50
destination resources, 55-57 XA only, 50-51
overview, 55-57 monitoring
physical destinations, 55-57 bean-cache attributes, 199-200
queues, 55-57 container subsystems, 193
topics, 55-57 ORB service, 206
jmsra system resource adapter, 57 transaction service, 207
JNDI, 82 using get command, 218
custom resources, using, 75 using list command, 217
external repositories, 75 MSSQL Inet JDBC driver, 52
lookups and associated references, 74 MSSQL/SQL Server2005 Data Direct JDBC driver, 46
names, 73, 88 MSSQL/SQL Server2005 JDBC driver, 48-49
JSP, See JavaServer Pages, 81
JSR 109, 167
JSR 181, 167
N
naming, JNDI and resource reference, 74
naming and directory service, 33
K
naming service, 33
kestore.jks file, 127-128
keypoint intervals, 159 numbeansinpool, 199
keypoint operations, 159 numexpiredsessionsremoved, 200
numpassivationerrors, 200
numpassivations, 200
numpassivationsuccess, 200
L numthreadswaiting, 199
list command, monitoring, 217
list-domains command, 37
281
Index
O R
Oasis Web Services Security, See WSS realms, certificate, 100
object request broker, threads, 179 reap interval, 83
Object Request Broker (ORB), 177 Registry, web service, 170
overview, 178 Registry, Web service
online help, 36 adding, 173
Open ESB, 176 adding connector module for, 170
configuring resource adapter for, 171
Oracle, 88
Registry, web service, creating, 171
Oracle Data Direct JDBC driver, 45-46
Resource Adapter, Generic, JMS, 60-69
Oracle Inet JDBC driver, 51-52 resource adapters, 156
Oracle OCI JDBC driver, 53-54 jmsra, 57
Oracle Thin Type 4 Driver, workaround for, 157 resource managers, 156
Oracle Thin Type 4 JDBC driver, 47-48 resource references, 74
oracle-xa-recovery-workaround property, 157 rollback
ORB, 177 See transactions
IIOP listeners, 178 rolling back, 156
overview, 178 RSA encryption, 142
See object request broker, 179
service, monitoring, 206
S
SAAJ, 167
P security, 33
performance server administration, 33
increasing, 85 server log, viewing, 187-189
services, timer, 87-88
problems, 85
services for applications, 33
thread pools, 179
servlets, 81
Physical Destination, JMS, 58
session manager, 83
PointBase, 88 sessions
pooling configuring, 83-84
Enterprise JavaBeans, 85-86, 87 custom IDs, 83
Port listeners, 38 deleting, 84
PostgreSQL JDBC driver, 49 deleting data, 83
Providers, JMS, 59-60 file name, 83
HTTP, 83, 85
IDs, 83
inactive, 83, 84
Q managing, 83
queues storing, 85
work storing data, 83
See thread pools, 180 Simple Object Access Protocol (SOAP), 166
queues, JMS, 55-57 SOAP, 166
SOAP with Attachments API for Java (SAAJ), 167
282 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008
Index
283
Index
X
XSLT, using, 175
284 Sun Java System Application Server Platform Edition 9 Administration Guide • December 2008