Admin Guide
Admin Guide
Server and ™
WebLogic
Express ®
Administration Guide
Release 7.0
Document Revised: April 27, 2006
Copyright
Copyright © 2002 BEA Systems, Inc. All Rights Reserved.
iv Administration Guide
2. Starting and Stopping WebLogic Servers
The Server Lifecycle ......................................................................................... 2-1
Controlling the Server Lifecycle ................................................................ 2-4
Timeout Period for LifeCycle Operations .......................................... 2-5
Providing Usernames and Passwords to Start a Server ..................................... 2-6
Specifying an Initial Administrative Username ......................................... 2-6
Bypassing the Prompt for Username and Password................................... 2-7
Creating a Boot Identity File for an Administration Server................ 2-8
Creating a Boot Identity File for a Managed Server ........................... 2-9
Using a Boot Identity File................................................................. 2-10
Removing a Boot Identity File After Startup.................................... 2-11
Alternate Method: Passing Identity Information on the Command Line..
2-11
Starting an Administration Server ................................................................... 2-12
Starting an Administration Server from the Windows Start Menu.......... 2-13
Starting an Administration Server Using a Script.................................... 2-14
Using the Configuration Wizard Scripts to Start an Administration
Server ......................................................................................... 2-14
Creating Your Own Script to Start an Administration Server .......... 2-14
Using a Non-Default JVM with WebLogic Server........................... 2-16
Using the weblogic.Server Command...................................................... 2-17
Setting the Classpath ......................................................................... 2-18
Command Syntax for weblogic.Server ............................................. 2-19
Required Arguments ......................................................................... 2-19
Frequently Used Optional Arguments .............................................. 2-20
Other Optional Arguments................................................................ 2-27
Development Mode vs. Production Mode ........................................ 2-28
Startup Arguments for the Administration Port and the weblogic.Admin
Utility ......................................................................................... 2-30
A Server’s Root Directory ................................................................ 2-30
Using the Default Configuration to Start a Server ................................... 2-32
Starting a Managed Server .............................................................................. 2-33
Adding a Managed Server to a Domain ................................................... 2-34
Starting a Managed Server from the Windows Start Menu ..................... 2-35
Starting a Managed Server Using a Script ............................................... 2-35
Administration Guide v
Using the Configuration Wizard Scripts to Start a Managed Server 2-36
Creating Your Own Script to Start a Managed Server...................... 2-37
Starting a Managed Server from the Command Line............................... 2-37
Configuring a Connection to the Administration Server.......................... 2-38
Specifying the Default Startup State ........................................................ 2-40
Starting a Remote Managed Server.......................................................... 2-40
Starting and Killing All WebLogic Servers in a Domain or Cluster........ 2-41
Starting All Managed Servers in a Domain ...................................... 2-41
Starting All Managed Servers in a Cluster........................................ 2-42
Killing All Servers in a Domain........................................................ 2-42
Killing All Servers in a Cluster ......................................................... 2-43
Shutting Down WebLogic Servers .................................................................. 2-43
Configuring Startup and Shutdown Classes .................................................... 2-44
Setting Up a WebLogic Server Instance as a Windows Service ..................... 2-45
Setting Up a Windows Service: Main Steps............................................. 2-46
Create a Server-Specific Script ......................................................... 2-47
Set Additional Values for Managed Servers ..................................... 2-50
Require Managed Servers to Start After Administration Servers ..... 2-51
Enable Graceful Shutdowns from the Control Panel ........................ 2-53
Redirecting Standard Out and Standard Error to a File .................... 2-56
Adding Classes to the Classpath ....................................................... 2-58
Run the Server-Specific Script.......................................................... 2-59
Verifying the Setup................................................................................... 2-60
Verifying the User Account Under Which the Service Runs............ 2-60
Using the Control Panel to Stop or Restart a Server Instance.................. 2-61
Removing a Server as a Windows Service............................................... 2-62
Changing Startup Credentials for a Server Set Up as a Windows Service .....
2-63
vi Administration Guide
MBean Protections ..................................................................................... 3-6
How the WebLogic Security Service Verifies Layered Protections .......... 3-6
Example...................................................................................................... 3-7
Part 1: MBean Protections .................................................................. 3-7
Part 2: Security Policy on the Server Resource .................................. 3-8
Maintaining a Consistent Security Scheme................................................ 3-9
Permissions for Starting and Shutting Down Servers ..................................... 3-10
Permissions for Using the weblogic.Server Command .................... 3-10
Permissions for Using the Node Manager ........................................ 3-10
Shutting Down a WebLogic Server Instance .................................... 3-11
5. Deploying Applications
Supported Formats for Deployment .................................................................. 5-1
Deploying a Web Application Using the (deprecated) weblogic.deploy Utility.....
5-2
Deployment Documentation.............................................................................. 5-3
7. Managing Transactions
Overview of Transaction Management ............................................................. 7-1
Configuring Transactions .................................................................................. 7-3
Additional Attributes for Managing Transactions...................................... 7-4
Configuring Domains for Inter-Domain Transactions ...................................... 7-6
Limitations for Inter-Domain Transactions................................................ 7-6
Inter-Domain Transactions for WebLogic Server Domains ...................... 7-7
Using Security Interoperability Mode ........................................................ 7-8
Configuring Security Interoperability Mode....................................... 7-8
Determining the Security Interoperability Mode ................................ 7-9
Monitoring and Logging Transactions ............................................................ 7-10
Administration Guide ix
Creating the JDBC Objects ............................................................... 8-11
Targeting the JDBC Objects ............................................................. 8-11
Configuring JDBC Connectivity Using the Administration Console8-13
Database Passwords in Connection Pool Configuration ................... 8-15
JDBC Configuration Tasks Using the Command-Line Interface ..... 8-16
Managing and Monitoring Connectivity .................................................. 8-17
JDBC Management Using the Administration Console ................... 8-17
JDBC Management Using the Command-Line Interface ................. 8-18
JDBC Configuration Guidelines for Connection Pools, MultiPools, and
DataSources.............................................................................................. 8-19
Overview of JDBC Configuration ........................................................... 8-19
When to Use a Tx Data Source ......................................................... 8-21
Drivers Supported for Local Transactions ........................................ 8-22
Drivers Supported for Distributed Transactions Using XA .............. 8-22
Drivers Supported for Distributed Transactions without XA ........... 8-22
Avoiding Server Lockup with the Correct Number of Connections........ 8-22
Configuring JDBC Drivers for Local Transactions.................................. 8-23
Configuring XA JDBC Drivers for Distributed Transactions.................. 8-27
WebLogic jDriver for Oracle/XA Data Source Properties ............... 8-32
Additional XA Connection Pool Properties ...................................... 8-34
Configuring Non-XA JDBC Drivers for Distributed Transactions.......... 8-35
Non-XA Driver/Single Resource ...................................................... 8-35
Non-XA Driver/Multiple Resources ................................................. 8-35
Limitations and Risks When Using a Non-XA Driver in Global
Transactions ............................................................................... 8-36
Non-XA Connection Pool and Tx Data Source Configuration Example.
8-38
Increasing Performance with the Prepared Statement Cache .......................... 8-39
Non-XA Prepared Statement Cache......................................................... 8-40
XA Prepared Statement Cache ................................................................. 8-41
Usage Restrictions for the Prepared Statement Cache ............................. 8-43
Calling a Stored Prepared Statement After a Database Change May
Cause Errors............................................................................... 8-43
Using setNull In a Prepared Statement ............................................. 8-43
Prepared Statements in the Cache May Reserve Database Cursors.. 8-44
x Administration Guide
Determining the Proper Prepared Statement Cache Size ......................... 8-44
Using a Startup Class to Load the Non-XA Prepared Statement Cache.. 8-45
9. Managing JMS
JMS and WebLogic Server................................................................................ 9-1
Configuring JMS ............................................................................................... 9-2
JMS Resource Naming Rules for Domain Interoperability ....................... 9-3
Naming Rules for JMS Resources In a Single Domain Environment 9-3
Naming Rules for JMS Resources In a Multi-Domain Environment . 9-4
Starting WebLogic Server and Configuring JMS ...................................... 9-5
Starting the Default WebLogic Server................................................ 9-5
Starting the Administration Console................................................... 9-5
Configuring a Basic JMS Implementation.......................................... 9-5
Configuring JMS Servers ........................................................................... 9-8
Configuring Connection Factories ........................................................... 9-10
Configuring Destinations ......................................................................... 9-12
Configuring JMS Templates .................................................................... 9-13
Configuring Destination Keys.................................................................. 9-14
Configuring Stores ................................................................................... 9-15
About JMS JDBC Stores................................................................... 9-16
Using Oracle Primary Keys with a JMS JDBC Store....................... 9-17
About JMS JDBC Store Table Prefixes............................................ 9-18
Recommended JDBC Connection Pool Settings for JMS JDBC Stores ..
9-19
Configuring Session Pools ....................................................................... 9-19
Configuring Connection Consumers........................................................ 9-20
Monitoring JMS............................................................................................... 9-21
Monitoring JMS Objects .......................................................................... 9-21
Monitoring Durable Subscribers .............................................................. 9-22
Monitoring Distributed Destination System Subscriptions and Proxy Topic
Members............................................................................................ 9-22
Tuning JMS ..................................................................................................... 9-23
Persistent Stores ....................................................................................... 9-24
Configuring a Synchronous Write Policy for JMS File Stores......... 9-24
Using Message Paging ............................................................................. 9-27
Administration Guide xi
Configuring Paging ........................................................................... 9-28
JMS Paging Attributes ...................................................................... 9-33
Establishing Message Flow Control......................................................... 9-38
Configuring Flow Control................................................................. 9-38
Flow Control Thresholds................................................................... 9-40
Tuning a Distributed Destination ............................................................. 9-41
Configuring Message Load Balancing for a Distributed Destination9-41
Configuring Server Affinity for a Distributed Destination ............... 9-43
Configuring Distributed Destinations.............................................................. 9-44
Guidelines for Configuring Distributed Destinations............................... 9-44
Configuration Best Practices for Distributed Destinations ............... 9-45
Load Balancing and Server Affinity Tuning...................................... 9-45
Automatic JMS Template Creation ................................................... 9-46
JMS Server Removal Precaution....................................................... 9-46
Creating a Distributed Topic and Creating Members Automatically....... 9-46
Creating a Distributed Topic and Adding Existing Physical Topics as
Members Manually ........................................................................... 9-49
Creating a Distributed Queue and Creating Members Automatically...... 9-51
Creating a Distributed Queue and Adding Existing Physical Queues as
Members Manually ........................................................................... 9-54
Creating a JMS Distributed Queue Member ............................................ 9-56
Deleting a JMS Distributed Queue Member ............................................ 9-57
Creating a JMS Distributed Topic Member ............................................. 9-58
Deleting a JMS Distributed Topic Member ............................................. 9-59
Deleting a Distributed Destination ........................................................... 9-59
Monitoring Distributed Destinations........................................................ 9-60
Recovering from a WebLogic Server Failure.................................................. 9-60
Programming Considerations ................................................................... 9-60
Migrating JMS Data to a New Server ...................................................... 9-61
Administration Guide xv
B. WebLogic Server Command-Line Interface Reference
About the Command-Line Interface................................................................. B-2
Before You Begin...................................................................................... B-2
Using WebLogic Server Administration Commands ....................................... B-3
Syntax................................................................................................. B-3
Connection and User Credentials Arguments ........................................... B-4
Summary of User Credentials Arguments................................................. B-5
Examples of Providing User Credentials ........................................... B-6
WebLogic Server Administration Command Reference.................................. B-7
CANCEL_SHUTDOWN ................................................................. B-10
Syntax............................................................................................... B-10
Example............................................................................................ B-10
CONNECT ....................................................................................... B-11
Syntax............................................................................................... B-11
Example............................................................................................ B-11
FORCESHUTDOWN ...................................................................... B-12
Syntax............................................................................................... B-12
Example............................................................................................ B-12
GETSTATE...................................................................................... B-14
Syntax............................................................................................... B-14
Example............................................................................................ B-14
HELP................................................................................................ B-15
Syntax............................................................................................... B-15
Example............................................................................................ B-15
LICENSES ....................................................................................... B-16
Syntax............................................................................................... B-16
Example............................................................................................ B-16
LIST ................................................................................................. B-17
Syntax............................................................................................... B-17
Example............................................................................................ B-17
LOCK ............................................................................................... B-18
Syntax............................................................................................... B-18
Example............................................................................................ B-18
MIGRATE........................................................................................ B-19
Syntax............................................................................................... B-19
xx Administration Guide
About This Document
This document explains the management subsystem provided for configuring and
monitoring your WebLogic Server implementation. It is organized as follows:
Audience
This document is intended mainly for system administrators who will be managing the
WebLogic Server application platform and its various subsystems.
Adobe Acrobat Reader is available at no charge from the Adobe Web site at
http://www.adobe.com.
Contact Us!
Your feedback on BEA documentation is important to us. Send us e-mail at
[email protected] if you have questions or comments. Your comments will be
reviewed directly by the BEA professionals who create and update the documentation.
In your e-mail message, please indicate the software name and version you are using,
as well as the title and document date of your documentation. If you have any questions
about this version of BEA WebLogic Server, or if you have problems installing and
running BEA WebLogic Server, contact BEA Customer Support through BEA
WebSupport at http://www.bea.com. You can also contact Customer Support by using
the contact information provided on the Customer Support Card, which is included in
the product package.
Documentation Conventions
The following documentation conventions are used throughout this document.
Convention Usage
monospace Code samples, commands and their options, Java classes, data types,
text directories, and file names and their extensions. Monospace text also
indicates text that you enter from the keyboard.
Examples:
import java.util.Enumeration;
chmod u+w *
config/examples/applications
.java
config.xml
float
. Indicates the omission of items from a code example or from a syntax line.
.
.
1 Overview of WebLogic
System Administration
Size. Domains into organized in small units that can be managed more
efficiently, perhaps by different system administration personnel.
Note: All WebLogic Server instances in a domain must run the same version of the
WebLogic Server software. The Administration Server must also have the
same or later service pack installed as the Managed Servers in its domain. For
example, the Administration Server could be running version 7.0, Service
Pack 1 while the Managed Servers are running version 7.0 without Service
Pack 1.
For more information about domains, see Creating and Configuring WebLogic Server
Domains at http://e-docs.bea.com/wls/docs70/admin_domain/index.html.
Machines B and C each host two instances of WebLogic Server, WebLogic Servers 1
through 4. These instances are called Managed Servers. The Administration Server
communicates with an instance of Node Manager running on each machine to control
startup and shutdown of the Managed Servers.
WebLogic Servers 2 and 4 are part of a WebLogic Cluster (outlined in red). This
cluster is running an application that responds to HTTP requests routed to the cluster
from a hardware load balancer. (You could also use an instance of WebLogic Server
to provide load balancing.) The load balancer processes HTTP requests from the
Internet after they have passed through a firewall. The load balancer and firewall are
not part of the domain. A replicated copy of objects such as HTTP sessions is passed
between the two cluster members to provide failover capability.
WebLogic Server 1 runs an application that uses JDBC to access a database server
running on another physical machine that is not part of the WebLogic Domain.
Note: The pictured domain is only intended to illustrate the concepts of a WebLogic
Server domain and how you manage the domain. Many possible
configurations of servers, clusters, and applications are possible in a
WebLogic Server domain.
There are three types of MBeans used to manage a WebLogic Server domain:
administration, configuration, and runtime Mbeans.
The config.xml file, located on the machine that hosts the Administration Server,
provides persistent storage of Mbean attribute values. Every time you change an
attribute using the system administration tools, its value is stored in the appropriate
administration MBean and written to the config.xml file. Each WebLogic Server
domain has its own config.xml file.
If you set any configuration attributes on the command line when you start the
Administration Server using the -D arguments, these values override the values set by
the defaults or those read from the config.xml file. These overridden values are also
persisted to config.xml file by the Administration Server. For more information
about these command-line arguments, see “Using the weblogic.Server Command” on
page 2-17.
Configuration Mbeans are copies of Administration Mbeans that each Managed Server
uses to initialize its configuration. When you start a Managed Server, the server
receives a copy of the of all the administration MBeans from the Administration Server
and stores them in memory as configuration MBeans. If you override any
configuration attributes when starting a Managed Server, those values override the
values received from the Administration Server but are not written to the config.xml
file. For more information about starting a Managed Server, see “Starting a Managed
Server” on page 2-33.
Runtime Mbeans contain sets of attributes consisting of runtime information for active
WebLogic Servers instances and applications. By retrieving the values of attributes in
these runtime MBeans, you can monitor the running status of a WebLogic Server
domain.
Although users with a knowledge of these Mbeans and the JMX API can create their
own customized management system, most users prefer to use the system
administration tools provided with WebLogic Server to perform these tasks. These
tools do not require knowledge of the JMX API. For more information, see “System
Administration Tools” on page 1-8.
For a typical production system, BEA recommends that you deploy your applications
only on Managed Servers. This practice allows you to dedicate the Administration
Server to configuration and monitoring of the domain.
For more information, see “Starting and Stopping WebLogic Servers” on page 2-1.
instance that can assume the role of Administration Server. For more information, see
“Starting an Administration Server” on page 2-12 and Recovering Failed Servers at
http://e-docs.bea.com/wls/docs70/admin_domain/failures.html.
A Managed Server that starts in this way is running in Managed Server Independence
mode. In this mode, a server uses cached application files to deploy the applications
that are targeted to the server. You cannot change a Managed Server's configuration
until it is able to restore communication with the Administration Server. For more
information, see Recovering Failed Servers at
http://e-docs.bea.com/wls/docs70/admin_domain/failures.html.
It enables you to start a server in standby state. While in the standby state, the
administration port remains available to activate or administer the server.
However, the server’s other network connections are unavailable to accept client
connections. See Starting and Stopping WebLogic Server for more information
on the standby state.
http://e-docs.bea.com/wls/docs70/admin_domain/network.html#admi
nistration_port_and_administration_channel.
Configuration
Using the Administration Console, system administrators can easily perform all
WebLogic Server management tasks without having to learn the JMX API or the
underlying management architecture. The Administration Server persists changes to
attributes in the config.xml file for the domain you are managing.
Command-Line Interface
The command-line interface allows you to manage a WebLogic Servers domain when
using the Administration Console is not practical or desired—such as when you want
to use scripts to manage your domain, when you cannot use a Web browser to access
the Administration Console, or if you prefer using the command-line interface over a
graphical user interface. You can use only the command-line interface to manage your
domain, or you may use the command-line interface in combination with other system
administration tools such as the Administration Console to manage you domain.
The command line interface invokes a Java class called weblogic.Admin. Arguments
for this class provide the ability to perform many common management functions
without the need to learn the JMX API. For more information, see:
JMX
Advanced Java programmers with knowledge of the JMX API from Sun Microsystems
Inc. and WebLogic Server Mbeans can write their own management components as a
Java class.
Configuration Wizard
Use the Configuration Wizard to create a new WebLogic Server domain. This tool can
create domain configurations for stand-alone servers, Administration Servers with
Managed Servers, and clustered servers. The Configuration Wizard creates the
appropriate directory structure for your domain, a basic config.xml file, and scripts
you can use to start the servers in your domain.
You can run the Configuration Wizard either using a graphical user interface (GUI) or
in a text-based command line environment. You can also create user-defined domain
configuration templates for use by the Configuration Wizard.
For more information, see Creating New Domains Using the Configuration Wizard in
Creating and Configuring WebLogic Server Domains at
http://e-docs.bea.com/wls/docs70/admin_domain/configwiz.html.
Java Utilities
Utility programs are provided for common tasks such as deploying an application and
testing DBMS configurations. For more information, see “Using the WebLogic Java
Utilities” on page A-1.
Node Manager
Node Manager is a Java program provided with WebLogic Server that enables you to
start, shut down, restart, and monitor remote WebLogic Server instances. To enable
these capabilities, you run an instance of Node Manager on each physical machine in
your domain.
For more information, see Managing Server Availability with Node Manager at
http://e-docs.bea.com/wls/docs70/admin_domain/nodemgr.html.
SNMP
WebLogic Server includes the ability to communicate with enterprise-wide
management systems using Simple Network Management Protocol (SNMP). The
WebLogic Server SNMP capability enables you to integrate management of
WebLogic Servers into an SNMP-compliant management system that gives you a
single view of the various software and hardware resources of a complex, distributed
system.
Logs
Many WebLogic Server operations generate logs of their activity. Each server has its
own log as well as a standard HTTP access log. These log files can be configured and
used in a variety of ways to monitor the health and activity of your servers and
applications.
You can also configure a special domain log that contains a definable subset of log
messages from all WebLogic Server instances in a domain. You can modify which
logged messages from a local server appear in the domain log using the system
administration tools. You can view this domain log using the Administration Console
or a text editor/viewer.
Editing config.xml
You can manage a WebLogic Server domain by manually editing the persistent store
for configuration, the config.xml. (Other system administration tools automatically
save the configuration to the config.xml file.) Because of the difficulty of correctly
editing the XML syntax required in this file, this method of configuration is not
recommended but may provide advantages in limited situations.
Note: Do not edit the config.xml file while the Administration Server is running.
Servers
The administrative concept of a server represents an instance of WebLogic Server in
your domain. Using the system administration tools you can:
Start and stop servers. (To start and stop servers on a remote machine, you must
have Node Manager installed on the remote machine.) For more information see
“Node Manager” on page 1-12.
Configure a server’s connections: ports, HTTP settings, jCom settings, and time
outs.
Clusters
WebLogic Server clusters allow you to distribute the work load of your application
across multiple WebLogic Server instances. Clusters can improve performance and
provide fail-over should a server instance become unavailable. For example, clusters
provide several ways to replicate objects used in your applications so that data is not
lost in the event of hardware failure.
You can architect combinations of clusters to distribute the work load in a way that
provides the best performance for your applications.
Some services that are hosted on a single instance of WebLogic Server can be migrated
from one server to another in the event of server failure. The system administration
tools allow you to control these migrations.
Machines
The administrative concept of a machine represents the physical machine that hosts an
instance of WebLogic Server. WebLogic Server uses machine names to determine the
optimum server in a cluster to which certain tasks, such as HTTP session replication,
are delegated.
Using the system administration tools you can define one or more machines, configure
Node Manger for those machines, and assign servers to the machines. For UNIX
machines, you can configure UID and GID information.
Network Channels
Network channels are an optional feature that you can use to configure additional ports
with one or more WebLogic Server instances or clusters. All servers and clusters that
use a network channel inherit the basic port configuration of the channel itself. You
can also customize a channel's port settings on an individual server using channel
fine-tuning. This fine-tuning process creates an additional network resource called a
Network Access Point.
JDBC
Java Database Connectivity (JDBC) allows Java programs to interact with common
DBMSs such as Oracle, Microsoft SQL Server, Sybase, and others.
Using the System Administration tools you can manage and monitor connectivity
between WebLogic Server and your database management system. Connectivity is
usually established through connection pools.
JMS
The Java Message Service (JMS) is a standard API for accessing enterprise messaging
systems that allow communication between applications.
Using the system administration tools, you can define configuration attributes to:
Enable JMS
Enable any desired JMS features, such as server clustering, concurrent message
processing, destination sort ordering, persistent messaging, message paging, flow
control, and load balancing for distributed destinations.
For more information, see “Using the WebLogic Messaging Bridge” on page 10-1.
For more information on managing Web server functionality in WebLogic Server, see
“Configuring WebLogic Server Web Components” on page 6-1.
Applications
Application deployment tools, including the Administration Console allow you to
deploy, manage, update, and monitor your applications. The application deployment
tools also allow you to deploy and update applications in a cluster of WebLogic
Servers.
WebLogic Server 7.0 includes a new, two-phase deployment model that gives you
more control over the deployment process. For more information, see WebLogic
Server Deployment at
http://e-docs.bea.com/wls/docs70/programming/deploying.html.
Application Formats
You deploy applications in one or more of the following J2EE application formats:
Web Applications
Enterprise Applications
J2EE Connectors
Web Services. Web services are deployed as a Web Application that includes a
special deployment descriptor that configures the Web Service.
You use the system administration tools to register and manage startup and shutdown
classes.
For more information, see “Starting and Stopping WebLogic Servers” on page 2-1.
JNDI
The Java Naming and Directory Interface (JNDI) API enables applications to look up
objects—such as Data Sources, EJBs, JMS, and MailSessions—by name. You can
view the JNDI tree through the Administration Console.
Transactions
You use the system administration tools to configure and enable the WebLogic Server
Java Transaction API (JTA). The transaction configuration process involves
configuring:
XML
The XML Registry is a facility for configuring and administering the XML resources
of an instance of WebLogic Server. XML resources in WebLogic Server include the
parser used by an application to parse XML data, the transformer used by an
application to transform XML data, external entity resolution, and caching of external
entities.
Security
Security functionality has been completely re-written for WebLogic Server version 7.
The new security system allows you to plug in third-party security solutions and also
provides out-of-the box implementations for many common security systems. You can
also create your own security solution and implement it in WebLogic Server.
For backwards compatibility, the security functionality available in version 6.0 and 6.1
of WebLogic Server is also supported when running in Compatibility Mode.
Using the administration tools, you can define realms, users, groups, passwords, ACLs
and other security features.
Jolt
Jolt is a Java-based client API that manages requests to BEA Tuxedo services via a Jolt
Service Listener (JSL) running on a Tuxedo server.
Mail
WebLogic Server includes the JavaMail API version 1.1.3 reference implementation
from Sun Microsystems.
For more information, see “Using JavaMail with WebLogic Server Applications”
under Programming Topics at
http://e-docs.bea.com/wls/docs70/programming/topics.html.
If you use a Web browser that is not on the above list you may experience functional
or formatting problems.
2. Open one of the supported Web browsers and open the following URL:
http://hostname:port/console
Where hostname is the DNS name or IP address of the Administration Server
and port is the address of the port on which the Administration Server is
listening for requests (7001 by default). If you started the Administration Server
using Secure Socket Layer (SSL), you must add s after http as follows:
https://hostname:port/console
For more information about setting up SSL for system administration, see Server
--> Connections --> SSL Ports at
http://e-docs.bea.com/wls/docs70/ConsoleHelp/domain_server_conn
ections_ssl-ports.html.
3. When the login page appears, enter the user name and the password you used to
start the Administration Server (you may have specified this user name and
password during the installation process) or enter a user name that belongs to one
of the following security groups: Administrators, Operators, Deployers, or
Monitors. These groups provide various levels of access to system administration
functions in the Administration Console. For more information, see “Protecting
System Administration Operations” on page 3-1.
Using the security system, you can add or delete users to one of these groups to
provide controlled access to the console. For more information, see “Protecting
System Administration Operations” on page 3-1.
Note: If you have your browser configured to send HTTP requests to a proxy server,
then you may need to configure your browser to not send Administration
Server HTTP requests to the proxy. If the Administration Server is on the same
machine as the browser, then ensure that requests sent to localhost or
127.0.0.1 are not sent to the proxy.
The left pane in the Administration Console contains a navigation tree that you use to
navigate to tables of data, configuration pages, monitoring pages, or log files. By
selecting (left-clicking) a node in the domain tree, you can display a table of data for a
resource or configuration and monitoring pages for a selected resource. If a node in the
tree is preceded by a plus sign, you can click on the plus sign to expand the tree to
access additional resources.
Once you select a node from the navigation tree, in the right pane you will either see a
tabular listing of configured resources or objects or a tabbed interface.
When the data displayed is a table of data about resources or objects of a particular
type, you can customize the table by adding or subtracting columns. You can also sort
the data tables by clicking on the column headers. To customize a table, click on the
Customize this view link at the top of the table.
To edit your configuration, change values of the fields displayed in the right pane.
After you edit the configuration, click the Apply button to execute the change and
persist it to the config.xml file. Fields labeled with the icon require you to
restart any servers affected by the change before the change goes into effect.
To update the information click the icon in the upper right section of the screen.
The data will refresh regularly until you click the icon again. The icon displays a
circular animation to indicate when auto-refresh is active. By default, the data
refreshes every 10 seconds. You can alter the refresh interval by selecting the Console
node and changing the value of Auto-refresh every field.
Clicking this icon, located in the upper right corner of the console opens
another browser window containing information about the console page
you are viewing. You can also browse to other Administration Console
topics from this window.
Apache
Because these plug-ins operate in the native environment of the Web server,
management of the plug-ins is done using the administration facilities of that Web
server.
Special servlets are also available to proxy requests from an instance of WebLogic
Server to another instance of WebLogic Server or to a cluster of WebLogic Servers.
For more information, see:
Monitoring
The system administration tools contain extensive capabilities for monitoring
WebLogic Servers, domains, and resources. Using the tools you can monitor:
Security:
z Locked-out users
z Invalid Logins
z Login attempts
Transactions:
z Committed transactions
z Rolledback transactions
Applications:
z Servlet sessions
z Connector connection pools
z EJB performance
Licenses
WebLogic Server requires a valid license to function.
An evaluation copy of WebLogic Server is enabled for 30 days so you can start using
WebLogic Server immediately. To use WebLogic Server beyond the 30-day
evaluation period, you will need to contact your salesperson about further evaluation
or purchasing a license for each IP address on which you intend to use WebLogic
Server. All WebLogic Server evaluation products are licensed for use on a single
server with access allowed from up to five connections to the server.
If you downloaded WebLogic Server from the BEA Web site, your evaluation license
is included with the distribution. The WebLogic Server installation program allows
you to specify the location of the BEA home directory, and installs a BEA license file,
license.bea, in that directory.
For more information, see “Managing WebLogic Server Licenses” on page 13-1
The following sections describe procedures for starting and stopping Administration
Servers and Managed Servers:
files, and other SSL-related files and contacts the Administration Server for
the remaining configuration and security data.
b. Starts its kernel-level services, which include logging and timer services.
d. If you have configured a server to use a separate administration port, the server
enables remote configuration and monitoring. For information about
administration ports, refer to Configuring a Domain-Wide Administration Port
in the Creating and Configuring WebLogic Server Domains Guide.
e. Deploys modules in the appropriate container and in the order that you specify
in the WebLogic Server Administration Console.
For any startup classes that are configured to load before application
deployments, the classes are loaded and run before the server deploys JDBC
connection pools, Web applications, and EJBs.
f. For any startup classes that are configured to load after application
deployments, the classes are loaded and run after the server deploys JDBC
connection pools, Web applications, and EJBs.
3. STANDBY. (Available only if you have configured an administration port.) You can
issue a command that starts a server and places it in this state. In this state, a
server has initialized all of its services and applications and can accept
administration commands and participate in cluster communication. It is not
accessible for requests that come from external clients.
A typical use of the STANDBY state is to keep a server available as a “hot”
backup, especially in a high-availability or mission-critical environment. When
you need to use the backup server, you can quickly resume its ability to process
client requests.
4. RUNNING. In this state, a server offers its services to clients and can operate as a
full member of a cluster.
5. SHUTDOWN. You can move a server into this state either from the RUNNING state or
the STANDBY state. As it transitions to SHUTDOWN, a server goes through the
SHUTTING_DOWN state.
When you issue a graceful shutdown, the server invokes any shutdown classes
that you have configured. You can shut down a server gracefully only from the
RUNNING or STANDBY states.
When you issue a forceful shutdown, the server notifies all applications and
subsystems to drop all current work and release all resources. A forceful
shutdown could result in rolled back transactions and session loss for some
clients. You can shut down a server forcefully from any state.
For information about the Node Manager, refer to Managing Server Availability
with Node Manager in the Creating and Configuring WebLogic Server Domains
Guide.
If the state of the server at that time was SHUTTING_DOWN or if the operation was
FORCESHUTDOWN, then the server shuts down automatically.
You can change the default timeout period on the Server→Tuning tab. For more
information, refer to Setting the Timeout Period for LifeCycle Operations in the
Administration Console Online Help.
determine the type of resources that the user can access, and provide other
security-related services for WebLogic resources. WebLogic Server installs the
myrealm security realm and uses it by default.
The first time you start a WebLogic Server, enter this initial administrative username
and password. If you did not use the Configuration Wizard, the WebLogic Server
prompts you to enter a initial username and password.
You can use the Administration Console to add users to myrealm. If you use an
Authentication provider other than the one that WebLogic Server installs, you must use
the provider’s administration tools to create at least one user with administrative
privileges. For information on granting administrative privileges, refer to “Protecting
System Administration Operations” on page 3-1.
Note: The guest user is no longer supplied by default in WebLogic Server version
7.0. To use the guest user, you must run in Compatibility mode or define the
guest user as a user in the Authentication provider for your security realm.
For information about Compatibility mode, refer to Using Compatibility
Security in the Managing WebLogic Security guide.
You can configure a WebLogic Server to use a different security realm. If you set up
different security realms, you must designate one of those realms as the default. During
its startup cycle, a WebLogic Server uses the default realm to authenticate the
username that you supply.
1. Start the Administration Server at least once and provide the user credentials on the
command line.
During the Administration Server's initial startup process, it generates security
files that must be in place before a server can use a boot identity file.
The username and password values must match an existing user account in the
Authentication provider for the default security realm and must belong to a role
that has permission to start a server. For information on roles and permissions,
refer to “Protecting System Administration Operations” on page 3-1.
The first time you use this file to start a sever, the server reads the file and then
overwrites it with an encrypted version of the username and password.
Alternative Technique for Creating a Boot Identity File for an Administration Server
If you invoke the weblogic.Server class directly on the command line, instead of
following the steps in the previous section, you can create a boot identity file by
including the following options in the Java command:
-Dweblogic.management.username=username
-Dweblogic.management.password=password
-Dweblogic.system.StoreBootIdentity=true
These options cause the server instance to boot with the supplied user credentials and
then store them in a file named boot.properties.
java -Dweblogic.management.username=username
-Dweblogic.management.password=password
-Dweblogic.system.StoreBootIdentity=true
-Dweblogic.Name=myAdminServer weblogic.Server
For more information about invoking the weblogic.Server class directly from a
command line, refer to “Using the weblogic.Server Command” on page 2-17.
Note: If you use a script to start an Administration Server, BEA recommends that
you do not use the technique described in this section for the following
reasons:
In addition, if you use a Node Manager to start a Managed Server, you do not need to
create a boot identity file. Instead, you must specify user credentials on the Managed
Server’s Remote Start tab in the Administration Console. For more information, refer
to "Configure Startup Arguments for Managed Servers."
The username and password values must match an existing user account in the
Authentication provider for the default security realm and must belong to a role
that has permission to start a server. For information on roles and permissions,
refer to “Protecting System Administration Operations” on page 3-1.
If you want to specify a different file (or if you do not want to store boot identity
files in a server’s root directory), you can include the following argument in the
server’s weblogic.Server startup command:
-Dweblogic.system.BootIdentityFile=filename
where filename is the fully qualified pathname of a valid boot identity file.
If you use the startWebLogic script, add
-Dweblogic.system.BootIdentityFile as a value of the JAVA_OPTIONS
variable. For example:
JAVA_OPTIONS=-Dweblogic.system.BootIdentityFile=C:\BEA\user_dom
ains\mydomain\myidentity.prop
If you do not want a server instance to use a boot identity file, include the
following options in the server’s weblogic.Server startup command:
-Dweblogic.management.username=username
-Dweblogic.management.password=password
These options prevent a server instance from using any boot identity file and
override other startup options that cause a server to use boot identity files.
Note: If you use a script to start a server instance, BEA recommends that you do
not use this technique because it requires you to store an unencrypted
password in the startup script. Use this technique only if you invoke the
weblogic.Server class directly from the command line. For more
information, see “Using the weblogic.Server Command” on page 2-17.
If a server is unable to access its boot identity file, it displays the username and
password prompt in its command shell and writes a message to the log file.
For a given server instance, use only the boot identity file that the instance has created.
WebLogic Server does not support copying a boot identity file from one server root
directory to another.
For example, if you use ServerA to generate a boot identity file, use only that boot
identity file with ServerA. Do not copy ServerA’s boot identity file into the root
directory of ServerB. Instead, create a boot identity file for ServerB as described in the
previous sections.
-Dweblogic.system.RemoveBootIdentity=true
This argument removes only the file that the server used to start. For example, if you
specify -Dweblogic.system.BootIdentityFile=c:\secure\boot.MyServer,
only boot.MyServer is removed, even if the server’s root directory contains a file
named boot.properties.
If you supply both of these arguments, you can bypass the interactive prompt.
These options prevent a server instance from using any boot identity file and override
other startup options that cause a server to use boot identity files.
Because the command to start a server can be long, typically you place most of the
startup command in a script. Unless you are in an environment in which security is not
a concern, we recommend that you do not save the
-Dweblogic.management.password=password argument in a startup script.
For more information about these arguments, refer to “Using the weblogic.Server
Command” on page 2-17.
If a domain consists of only one WebLogic Server, that server is the Administration
Server. If a domain consists of multiple WebLogic Servers, you must start the
Administration Server before you start the Managed Servers.
The Administration Server and all Managed Servers in a domain must be the same
WebLogic Server version. The Administration Server must be either at the same
service-pack level or at a later service-pack level than the Managed Servers. For
example, if the Managed Servers are at release 7.0, then the Administration Server can
be either release 7.0 or 7.0 SP1. However, if the Managed Servers are at SP1, then the
Administration Server must be at SP1. Each server within a domain must have a unique
name.
Note: When starting WebLogic Server, JDK 1.3 may throw an OutOfMemory error
if you are trying to load a large number of classes. This error occurs even
though there appears to be plenty of memory available. If you encounter a
java.lang.OutOfMemory error exception when you start WebLogic Server,
increase the value of the following JVM option:
java -XX:MaxPermSize=<value>
For JDK1.3.1, the default value for MaxPermSize is 64m, where m stands for
megabytes.
The Start Server command opens a command window and calls the
domain_name\startWebLogic.cmd script, which is described in “Starting an
Administration Server Using a Script” on page 2-14. When the server has successfully
completed its startup process, it writes the following message to the command
window:
domain_name\startWebLogic.cmd (Windows)
The script sets values for some domain-specific variables and then calls the master
startup script, WL_HOME\server\bin\startWLS.cmd (startWLS.sh on UNIX),
where WL_HOME is the location in which you installed WebLogic Server. The master
startup script sets environment variables, such as the location of the JVM, and then
starts the JVM with WebLogic Server arguments.
1. Sets the value of a variable named SERVER_NAME. All servers in a domain must be
named. For example,
set SERVER_NAME=myserver
WLS_USER Variable for setting a cleartext user for server startup. Instead of using this variable, we
recommend that you use a boot identity file. For more information, refer to “Bypassing
the Prompt for Username and Password” on page 2-7.
WLS_PW Variable for setting a cleartext password for server startup. Instead of using this variable,
we recommend that you use a boot identity file. For more information, refer to
“Bypassing the Prompt for Username and Password” on page 2-7.
ADMIN_URL If you specify a URL for this variable, the server will start as a Managed Server and will
use the specified URL to contact its Administration Server.
For more information, refer to “The Administration Server and Managed Servers” on
page 1-6.
STARTMODE Determines whether the server runs in production mode or development mode. Specify
true for production mode servers or false for development mode.
For more information on using production and development modes refer to
“Development Mode vs. Production Mode” on page 2-28.
JAVA_OPTIONS Java command-line options for running the server. The Java command-line options will
be passed to the JVM after JAVA_VM and MEM_ARGS are passed.
-Dweblogic.ListenAddress is an example of a Java option that you can call from
the domain start script. For more information about command-line options, refer to
“Using the weblogic.Server Command” on page 2-17.
If you are listing multiple options in a UNIX shell, put quotes around the entire set of
options and include spaces between each option. For example:
JAVA_OPTIONS="-Dweblogic.attribute=value
-Djava.attribute=value"
JAVA_VM Java argument that specifies the mode in which the virtual machine runs. Use one of the
following options:
-server
-client
-hotspot (Windows only)
If you are using a JVM that does not support any of these operational modes, you must
edit the master script to prevent these arguments from being passed to the JVM. For more
information, refer to “Using a Non-Default JVM with WebLogic Server” on page 2-16.
MEM_ARGS Variable to override the default memory arguments passed to Java. In the master start
scripts, the options are set by default to -Xms200m and -Xmx200m.
4. If you plan to locate your startup script outside of the domain’s root directory,
your script must include the following value for the JAVA_OPTIONS variable:
-Dweblogic.RootDirectory=path
For detailed information, see "Using a Non-Bundled JVM With WebLogic Platform"
at the following URL: http://e-docs.bea.com/platform/docs70/relnotes/relnotes.html.
For example, a simple invocation for starting the examples server on Windows is as
follows (you must enter this command from the
WL_HOME\samples\server\config\examples directory):
c:\bea\jdk131\bin\java
-hotspot -Xms200m -Xmx200m
-classpath "c:\bea\jdk131\lib\tools.jar;
c:\bea\weblogic700\server\lib\weblogic_sp.jar;
c:\bea\weblogic700\server\lib\weblogic.jar;"
-Dweblogic.Name=examplesServer
-Dbea.home="C:\bea"
-Djava.security.policy="c:\bea\weblogic700\server\lib\weblogic.policy"
weblogic.Server
Required Arguments
Startup Arguments for the Administration Port and the weblogic.Admin Utility
For information about starting a Managed Server on a remote host, refer to Managing
Server Availability with Node Manager in the Creating and Configuring WebLogic
Server Domains Guide.
You can use the following command to set the classpath for a WebLogic Server:
WL_HOME/server/lib/weblogic_sp.jar
Depending on which WebLogic Server release, service pack, or patch that you
have installed, this file might not exist on your system. Regardless of whether
the file currently exists on your system, we recommend that you include
WL_HOME/server/lib/weblogic_sp.jar on your classpath to ensure
compatibility with any updates. You must add this file to the classpath before
you add weblogic.jar.
WL_HOME/server/lib/weblogic.jar
Required Arguments
The following table describes the required arguments for starting a WebLogic Server
from the java command line.
-Xms and -Xmx Specify the minimum and maximum values (in megabytes) for Java
heap memory.
For example, you may want to start the server with a default
allocation of 200 megabytes of Java heap memory to the WebLogic
Server. To do so, you can start the server with the java -Xms200m
and -Xmx200m options.
For best performance it is recommended that the minimum and
maximum values be the same so that the JVM does not resize the
heap.
The values assigned to these parameters can dramatically affect the
performance of your WebLogic Server and are provided here only
as general defaults. In a production environment you should
carefully consider the correct memory heap size to use for your
applications and environment.
-classpath The minimum content for this option is described under “Setting the
Classpath” on page 2-18.
-Dbea.home=bea_home Specifies the location of the BEA home directory, which contains
licensing and other essential information.
-Dweblogic.RootDirectory=path Specifies the server’s root directory. For more information, refer to
“A Server’s Root Directory” on page 2-30.
-Dweblogic.ListenAddress=host Specifies a listen address for this server. The host value must be
either the DNS name or the IP address of the server.
This option sets the value of the listenAddress attribute in the
ServerMBean, which is also accessible from the Administration
Console under Server→Configuration→General→Listen Address.
If you do not specify a Listen Address, a server uses either the
machine’s DNS name or the IP address.
We recommend that you specify a known IP address or DNS name
and that you use the Administration Console instead of this
argument to do so.
For more information, refer to Configuring Network Resources.
-Dweblogic.ListenPort= Enables and specifies the plain-text (non-SSL) listen port for this
portnumber server.
The argument sets the value of the listenPort attribute in the
ServerMBean, which is also accessible from the Administration
Console under Server→Configuration→General→Listen Port.
If you do not specify a Listen Port, a server uses 7001 as the default.
For more information, refer to Configuring Network Resources.
-Dweblogic.system. Specifies a boot identity file that contains a username and password.
BootIdentityFile=filename The filename value must be the fully qualified pathname of a
valid boot identity file. For example:
-Dweblogic.system.BootIdentityFile=C:\BEA\
wlserver7.0\user_config\mydomain\myidentity.pr
op
If you do not specify a filename, a server uses the
boot.properties in the server’s root directory. If there is no
boot identity file, the server prompts you to enter a username and
password.
-Dweblogic.management. Specifies the password for retrieving Secure Socket Layer (SSL)
pkpassword=pkpassword private keys from an encrypted flat file.
Use this option if you store private keys in an encrypted flat file.
-Dweblogic.security.SSL. Specifies the name of a custom Host Name Verifier class. The class
HostnameVerifier= must implement the
hostnameverifierimplmentation weblogic.security.SSL.HostnameVerifier interface.
-Dweblogic.security.anonymous Enables support for the guest user account. If you start a
UserName=guest WebLogic Server instance with this argument, you must also add the
guest user to the Authentication provider in the default security
realm.
For more information, refer to Creating Users in the Securing
WebLogic Resources guide.
-Dweblogic.Stdout="filename" Redirects the server and JVM’s standard output stream to a file. You
can specify a pathname that is fully qualified or relative to the
WebLogic Server root directory.
For more information, refer to “Redirecting System.out and
System.err to a File” on page 4-11.
-Dweblogic.Stderr="filename" Redirects the server and JVM’s standard error stream to a file. You
can specify a pathname that is fully qualified or relative to the
WebLogic Server root directory.
For more information, refer to “Redirecting System.out and
System.err to a File” on page 4-11.
You can set any attribute that the MBean exposes as a setter method. In the above
syntax statements, attribute-name is the name of an MBean’s setter method without
the set prefix.
For example, the ServerMBean exposes its listen port attribute with the following
setter method:
setListenPort()
To set the listen port value from the weblogic.Server command, use the following
syntax: -Dweblogic.ListenPort=portnumber
The command-line arguments override any settings currently in the MBean and they
are not persisted to the domain’s config.xml file.
Production mode disables the auto-deployment feature. Instead, you must use the
WebLogic Server Administration Console or the weblogic.Deployer tool. For more
information on deployment, refer to WebLogic Server Deployment in the Developing
WebLogic Server Applications Guide.
By default, a WebLogic Server runs in development mode. To specify the mode for a
server, do one of the following:
If you use the startWebLogic startup script, edit the script and set the
STARTMODE variable as follows:
Startup Arguments for the Administration Port and the weblogic.Admin Utility
An administration port is a separate port that you must set up if you want to start
server instances in the STANDBY state or if you want to separate administration traffic
from application traffic in your domain.
If you want to use an administration port to carry requests from the weblogic.Admin
utility, you must do the following:
1. Set up SSL and an administration port for all server instances in the domain as
described in "Configuring a Domain-Wide Administration Port" in the Creating
and Configuring WebLogic Server Domains guide.
In addition, an Administration Server uses its root directory as a repository for the
domain’s configuration data (such as config.xml) and security resources (such as the
default, embedded LDAP server), while a Managed Server stores replicated
administrative data in is root directory. (See Figure 2-2.)
Administration Server
config.xml
Security data
context
Runtime data
context
Runtime and
replicated data
Multiple instances of WebLogic Server can use the same root directory. However, if
your server instances share a root directory, make sure that all relative filenames are
unique. For example, if two servers share a directory and they both specify
.\MyLogFile, then each server instance will overwrite the other’s .\MyLogFile.
To determine the root directory for an Administration Server, WebLogic Server does
the following:
If neither of the previous statements is true, then the server looks for a
config.xml file in working-directory/config/domain-name. If it finds
config.xml in this directory, then
working-directory/config/domain-name is the root directory.
If WebLogic Server cannot find a config.xml file, then it offers to create one,
as described in “Using the Default Configuration to Start a Server” on page 32.
To determine the root directory for a Managed Server, WebLogic Server does the
following:
This new config.xml file contains only the default settings, unless you use
command-line arguments to override the defaults. The username and password that
you supply when you start the server becomes the default administrative user.
Note that the server starts as an Administration Server in a new domain. There are no
other servers in this domain, nor are any of your deployments or third-party solutions
included. You can add them as you would add them to any WebLogic domain.
2. Navigate to that directory, and in a command shell, enter the following command:
WL_HOME\server\bin\setWLSEnv.cmd (Windows)
WL_HOME/server/bin/setWLSEnv.sh (UNIX)
4. When the server prompts you, enter a username and password. This will become
the default administrative user for the domain.
5. When the server prompts you to create a new default configuration, enter y.
The server prompts you to reenter your password. Then it starts a server with the new
configuration.
Create an entry for that server in the configuration for the domain as described
in Adding a Managed Server to a Domain.
After describing how to add a Managed Server to a domain, this section describes
starting a Managed Sever by completing any of the following tasks:
3. If the server runs on a machine that is different from the Administration Server’s
machine, do the following:
a. In the left pane of the Administration Console, click the Machines node.
5. On the right pane, click Configure a new Server and do the following:
c. Click Create.
6. If you want to set up an administration channel for this server, refer to Configuring
a Domain-Wide Administration Port in the Creating and Configuring WebLogic Server
Domains Guide.
The Start Server command opens a command window and calls the
domain_name\startManagedWebLogic.cmd script, which is described in “Starting
a Managed Server Using a Script” on page 2-35. When the server has successfully
completed its startup process, it writes the following message to the command
window:
If you are not using the JVM installed with WebLogic Server, refer to “Using a
Non-Default JVM with WebLogic Server” on page 2-16.
domain_name\startManagedWebLogic.cmd (Windows)
Before you use startManagedWebLogic, open the script in a text editor and make
sure that the SERVER_NAME variable is set to the name of the WebLogic Managed
Server that you wish to start. Also verify that the ADMIN_URL specifies the host (host
name or IP address) and port number where the Administration Server is listening for
requests (default is 7001). For example:
set SERVER_NAME=bigguy
set ADMIN_URL=peach:7001
By passing two parameters to the script that starts an Administration Server, you
can start a Managed Server.
The above syntax overrides the values of the SERVER_NAME and ADMIN_URL in
the startManagedWebLogic script.
For a complete description of the variables and Java options that can be specified in
startManagedWebLogic, see Table 2-1 under “Starting an Administration Server
Using a Script” on page 2-14.
When the server has successfully completed its startup process, it writes the following
message to the command window:
You must set a value for a variable named ADMIN_URL. For information on configuring
a connection to the Administration Server, refer to “Configuring a Connection to the
Administration Server” on page 2-38.
When the server has successfully completed its startup process, it writes the following
message to the command window:
-Dweblogic.management.server=host:port
-Dweblogic.management.server=http://host:port
-Dweblogic.management.server=https://host:port
For information on the command and arguments for starting an Administration Server,
refer to “Using the weblogic.Server Command” on page 2-17.
When the server has successfully completed its startup process, it writes the following
message to the command window:
Note: The first time you start a Managed Server, it must be able to contact the
Administration Server. Thereafter you can configure Managed Servers to start
even if the Administration Server is unavailable. For more information, refer
to Starting a Managed Server When the Administration Server Is Not
Available in the Creating and Configuring WebLogic Server Domains Guide.
You can express the listen address in one of the following formats:
host:port
where host is the name or IP address of the machine where the Administration
Server is running and port is the Administration Server's default, non-SSL
listen port. (By default the Administration Server's listen port is 7001.)
With this format, the Managed Server uses its default protocol (t3) to access the
Administration Server. To modify the default protocol, do the following:
b. From the Administration Console, in the left pane, expand the Servers node and
click the name of the Managed Server.
d. The Default Protocol field determines the default protocol for a server.
http://host:port
where host is the name or IP address of the machine where the Administration
Server is running and port is the Administration Server's default, non-SSL
listen port. (By default the Administration Server's listen port is 7001.)
To verify the host IP address, name, and default listen port of the Administration
Server, start the Administration Server in a command shell. When the server
successfully finishes its startup cycle, it prints to standard out messages that are
similar to the following (among other messages):
<Apr 19, 2002 9:24:19 AM EDT> <Notice> <WebLogicServer>
<000355> <Thread "Listen Thread.Default" listening on port
7001, ip address 11.12.13.141>
...
<Apr 19, 2002 9:24:19 AM EDT> <Notice> <WebLogicServer>
<000331> <Started WebLogic Admin Server "myserver" for domain
"mydomain" running in Development Mode>
You can change the IP address and listen port values from the Administration
Console on a server’s Configuration→General tab.
https://host:port
If you have configured Secure Socket Layer (SSL) communication for the
Managed Server and Administration Server, you can use this format. In this
format, host is the name or IP address of the machine where the Administration
Server is running and port is the Administration Server's SSL listen port.
If you set up the Administration Server to use an Administration Port, port
must specify the Administration Port.
For information on enabling SSL, refer to Configuring the SSL Protocol in the
Administration Console Online Help. For more information on Administration
Ports, refer to Configuring a Domain-Wide Administration Port in the Creating and
Configuring WebLogic Server Domains Guide.
Because the Managed Server receives its configuration from the Administration
Server, the Administration Server specified must be in the same domain as the
Managed Server.
1. In the Administration Console, expand the Servers node in the left pane. A list of
servers appears under the Servers node.
For information about starting a remote server from the Administration Console, refer
to Starting a Server and Starting a Server in the STANDBY State in the Administration
Console Online Help.
For information about the Node Manager, refer to Managing Server Availability with
Node Manager in the Creating and Configuring WebLogic Server Domains Guide.
You can also use the Administration Console to force a shutdown (kill) of all
WebLogic Servers in a domain or in a cluster. The kill command initiates a forced
shutdown for Managed Servers and the Administration Server. It does not require the
Node Manager.
For information about the Node Manager, refer to Managing Server Availability with
Node Manager in the Creating and Configuring WebLogic Server Domains Guide.
2. Start the Node Manager on all machines in the domain. For more information,
refer to Starting Node Manager in the Creating and Configuring WebLogic
Server Domains Guide.
3. From the Administration Console, right click on the name of the active domain in
the left panel.
5. When the Administration Console prompts you to confirm the command, click
Yes.
The Administration Console displays a page that lists the name of each
WebLogic Server in the domain.
6. To view the result of the start operation for a server, click its name.
2. Start the Node Manager on all machines in the cluster. For more information,
refer to Starting Node Manager in the Creating and Configuring WebLogic
Server Domains Guide.
3. From the Administration Console, right click on the name of the cluster in the left
panel.
5. When the Administration Console prompts you to confirm the command, click
Yes.
The Administration Console displays the Tasks page, which displays the status
of the startup task for each Managed Server in the cluster.
6. To view details about a server’s startup status, on the Tasks page, click the startup
task’s name. Then click the Details tab.
1. From the Administration Console, right click on the name of the cluster in the left
panel.
3. When the Administration Console prompts you to confirm the command, click
Yes.
Managed Servers and the Administration Server immediately stop all work items
and shut down. If a Managed Server does not respond, and if you used the Node
Manager to start the server, the Node Manager kills the server.
4. To confirm that the domain is killed, review the output in the shell process that
runs the Administration Server. It displays an ALERT message that indicates the
shutdown sequence has been initiated, and then it exits the process.
1. From the Administration Console, right click on the name of the cluster in the left
panel.
3. When the Administration Console prompts you to confirm the command, click
Yes.
All servers in the cluster immediately stop all work items and shut down. If a
Managed Server does not respond, and if you used the Node Manager to start the
server, the Node Manager kills the server.
When you initiate a graceful shutdown, the server notifies subsystems to complete all
in-work requests. After the subsystems complete their work, the server stops.
When you initiate a forced shutdown, the server instructs subsystems to immediately
drop in-work requests. If you force a Managed Server to shut down and it fails to
respond, and if you started the server with the Node Manager, the Node Manager kills
the server process.
The server waits a number of seconds for all subsystems to successfully stop. After the
number of seconds expires, the server does one of the following:
If the timeout occurs when the server is in the RUNNING state, the server returns a
message to standard out. To shut down the server after this occurs, you must
issue a force shutdown command.
For information on changing the default number of seconds, refer to Setting the Timeout
Period for LifeCycle Operations in the Administration Console Online Help.
By default, startup classes are loaded and executed after all other server subsystems
have initialized and after the server deploys modules. For any startup class, you can
override the default and specify that the server loads and executes it before the server
deploys JDBC connection pools, Web applications, and EJBs.
A shutdown class is a Java program that is automatically loaded and executed when
the WebLogic Server is shut down either from the Administration Console or the
weblogic.admin shutdown command. For more information about when a server
invokes startup and shutdown classes, refer to “The Server Lifecycle” on page 2-1.
To use startup or shutdown classes, you must configure and assign these classes to one
or more servers. To configure a class from the Administration Console, refer to Startup
and Shutdown Classes in the Administration Console Online Help. BEA provides the
examples.jms.startup API code example which demonstrates how to establish a
JMS message consumer from a WebLogic startup class.
For each server instance that you set up as a Windows service, WebLogic Server
creates a key in the Windows Registry under
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services. The registry
entry contains such information as the name of the server and other startup arguments.
When you start the Windows host, the Windows Service Control Manager (SCM),
which is part of the Windows operating system, uses the information in the Windows
Registry key to invoke the weblogic.Server main class. The Windows SCM cannot
be configured to use a Node Manager to start Managed Servers, and therefore the Node
Manager’s monitoring and automatic restart features cannot be used for servers that
run as a Windows service.
The following tasks set up and manage WebLogic Server instances that run as
Windows Services:
2. If you are installing a Managed Server as a Windows service, you must set
additional variables in the server-specific script. For more information, refer to
“Set Additional Values for Managed Servers” on page 2-50.
4. If you want a server instance to shut down gracefully when you use the Windows
Control Panel to stop the Windows service, create a Java class and modify the
master script so that the Windows SCM will invoke the class. For more
information, refer to “Enable Graceful Shutdowns from the Control Panel” on
page 2-53.
5. If you want to see the messages that a server instance prints to standard out and
standard error (including stack traces and thread dumps), redirect standard out
and standard error to a file. For more information, refer to “Redirecting Standard
Out and Standard Error to a File” on page 2-56.
6. If you have created additional Java classes that you want the WebLogic Server
instance to invoke, you must add them to the server’s classpath. For more
information, refer to Adding Classes to the Classpath.
7. Run the server-specific script. For more information, refer to “Run the
Server-Specific Script” on page 2-59.
Note: For more information about beasvc, enter the following command at a
command prompt: WL_HOME\server\bin\beasvc -help, where WL_HOME
is the directory in which you installed WebLogic Server.
To see an example of a server-specific script, refer to Listing 2-1, “Example Script for
Setting Up a Server as a Windows Service,” on page 2-50.
1. In the root directory for the domain’s Administration Server (the directory that
contains the domain’s config.xml file), create a text file.
2. Add the following, required batch commands to the text file, each command on
a separate line:
z SETLOCAL
where server-name is the name of an existing server instance that you want
set up as a Windows service.
3. Add the following optional batch commands to the text file. Place each
command on a separate line:
z set WLS_USER=username
set WLS_PW=password
When the STARTMODE variable is set to true, the server instance starts in
production mode. When not specified, or when set to false, the server starts
in development mode. For more information about development mode and
production mode, refer to “Development Mode vs. Production Mode” on
page 2-28.
z set JAVA_OPTIONS=java-options
where java-options is one or more Java arguments that you want to pass
to the Java Virtual Machine (JVM). Separate multiple arguments with a
space. For a list of Java options that are specific to WebLogic Server, refer to
“Command Syntax for weblogic.Server” on page 2-19. The JVM that you
use supports additional options and are documented by the JVM vendor.
z set JAVA_VM=-JVM-mode
where JVM-mode is a text string that indicates the mode in which you want
the JVM to run. The values that you supply depend on the JVM that you are
using. If you use the JRockit JVM, the default value is -jrockit. For more
information, refer to "Starting and Configuring the JRockit JVM" in the
JRockit User Guide.
To see a list of supported JVMs, refer to the List of Supported Platforms at
the following URL:
http://e-docs.bea.com/wls/certifications/certs_700/overview.html.
z set MEM_ARGS=[-XmsNumberm] [-XmxNumberm]
5. Save the text file with a .cmd extension. By default, the Windows command
prompt associates the .cmd extension with batch files.
2. In the text file, between the SETLOCAL command and the call command, create
the following command:
set ADMIN_URL=protocol://listen-address:listen-port
where
z protocol is http or https
echo off
SETLOCAL
set DOMAIN_NAME=myWLSdomain
set USERDOMAIN_HOME=d:\bea\user_projects\myWLSdomain
set SERVER_NAME=myWLSserver
set STARTMODE=true
set JAVA_OPTIONS=-Dweblogic.Stdout="d:\bea\user_projects\myWLSdomain\stdout.txt"
-Dweblogic.Stderr="d:\bea\user_projects\myWLSdomain\stderr.txt"
set ADMIN_URL=http://adminserver:7501
call "d:\bea\weblogic700\server\bin\installSvc.cmd"
ENDLOCAL
To require a Managed Server to start after the Administration Server Windows service,
do the following:
3. Before you install (or reinstall) the Administration Server as a Windows Service,
do the following:
This specifies the number of milliseconds to wait before the Windows SCM
changes the service status from SERVER_START_PENDING to STARTED.
The modified beasvc invocation for the Administration Server will resemble
the following:
"%WL_HOME%\server\bin\beasvc" -install
-svcname:"%DOMAIN_NAME%_%SERVER_NAME%"
-delay:120000
-javahome:"%JAVA_HOME%" -execdir:"%USERDOMAIN_HOME%"
-extrapath:"%WL_HOME%\server\bin" -password:"%WLS_PW%"
-cmdline:%CMDLINE%
5. Before you install the Managed Server as a Windows service, do the following:
With this option, the Windows SCM will wait for the Administration Server
Windows service to report a status of STARTED before it starts the Managed
Server Windows service.
For example, the modified beasvc invocation for the Managed Server will
resemble the following:
"%WL_HOME%\server\bin\beasvc" -install
-svcname:"%DOMAIN_NAME%_%SERVER_NAME%"
-depend:"myDomain_myAdminServer"
-javahome:"%JAVA_HOME%" -execdir:"%USERDOMAIN_HOME%"
-extrapath:"%WL_HOME%\server\bin" -password:"%WLS_PW%"
-cmdline:%CMDLINE%
To enable graceful shutdowns from the Windows Control Panel, do the following:
This method gracefully shuts down a server after the server has completed all
inflight work. For an example of such a class, refer to “Java Class that Shuts
Down a Server Instance” on page 2-55.
a. Add the class that you created to the set CLASSPATH statement.
For example if you archived your class in a file named c:\myJar, the
modified statement will be as follows:
set
CLASSPATH=%JAVA_HOME%\lib\tools.jar;%WL_HOME%\server\lib\web
logic_sp.jar;%WL_HOME%\server\lib\weblogic.jar;c:\myJar;%CLA
SSPATH%
b. Add the following argument to the last line of the script, which calls the beasvc
utility:
–stopclass:javaclass
where javaclass is the full classpath name of the class that you created. This
argument loads javaclass and then invokes its public void static
stop() method.
For example, if you packaged the class in “Java Class that Shuts Down a
Server Instance” on page 2-55 in com.myClasses, the modified beasvc
command will be as follows:
the modified beasvc invocation will resemble the following:
"%WL_HOME%\server\bin\beasvc" -install
-svcname:"%DOMAIN_NAME%_%SERVER_NAME%"
–stopclass:com.myClasses.ServerStopper
-javahome:"%JAVA_HOME%" -execdir:"%USERDOMAIN_HOME%"
-extrapath:"%WL_HOME%\server\bin" -password:"%WLS_PW%"
-cmdline:%CMDLINE%
4. Consider modifying the default timeout value that the Windows SCM specifies.
By default, when you use the Windows 2000 Control Panel to stop a Windows
service, the Windows SCM waits 30 seconds for the service to stop before it
kills the service and prints a timeout message to the System event log.
If you use -stopclass to gracefully shut down a server, 30 seconds might not
be enough time for the server to gracefully end its processing.
To configure a timeout period on Windows 2000, create a REG_DWORD registry
value named ServicesPipeTimeout under the following registry key:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control
The class in Listing 2-2 uses the Administration MBeanHome interface, which can
retrieve and call ServerRuntime MBean operations for all server instances in a
domain.
For more information about JMX programming, refer to the Programming WebLogic
Management Services with JMX guide.
import java.util.Set;
import java.util.Iterator;
import java.rmi.RemoteException;
import javax.naming.*;
import weblogic.jndi.Environment;
import weblogic.management.MBeanHome;
import javax.management.ObjectName;
import weblogic.management.WebLogicMBean;
import weblogic.management.configuration.ServerMBean;
import weblogic.management.runtime.ServerRuntimeMBean;
import weblogic.management.WebLogicObjectName;
try {
// Set ContextClassloader to prevent assertions
URL[] urls = { new File("/").toURL() };
Thread.currentThread().setContextClassLoader(new
URLClassLoader(urls));
while(mbeanIterator.hasNext()) {
serverRuntime = (ServerRuntimeMBean)mbeanIterator.next();
if(serverRuntime.getState().equals("RUNNING")) {
serverRuntime.shutdown();
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
3. In installSvc.cmd, the last command in the script invokes the beasvc utility.
At the end of the beasvc command, append the following command option:
-log:"pathname "
where pathname is a fully qualified path and filename of the file that you want
to store the server’s standard out and standard error messages.
The modified beasvc command will resemble the following command:
"%WL_HOME%\server\bin\beasvc" -install
-svcname:"%DOMAIN_NAME%_%SERVER_NAME%"
-javahome:"%JAVA_HOME%" -execdir:"%USERDOMAIN_HOME%"
-extrapath:"%WL_HOME%\server\bin" -password:"%WLS_PW%"
-cmdline:%CMDLINE%
-log:"d:\bea\user_projects\myWLSdomain\myWLSserver-stdout.txt
z Make a copy of the file that you specified and view the copy. The Windows file
system cannot write to files that are currently opened.
z To view the messages as they are being printed to the file, open a command
prompt and use the DOS command tail -f stdout-filename.
For example:
D:\bea\weblogic70\server\bin\beasvc -dump
-svcname:mydomain_myserver
Note: Win32 systems have a 2K limitation on the length of the command line. If
the classpath setting for the Windows service startup is very long, the 2K
limitation could be exceeded.
To work around this limitation:
a. Place the value of the set CLASSPATH command in a separate text file and save
the text file in the WL_HOME\server\bin directory.
-Dweblogic.management.username=%WLS_USER%
-Dweblogic.management.server=\"%ADMIN_URL%\"
-Dweblogic.ProductionModeEnabled=%STARTMODE%
-Djava.security.policy=\"%WL_HOME%\server\lib\weblogic.polic
y\" weblogic.Server"
By default, standard out is the command prompt in which you run the
server-specific batch file.
2. Navigate to the directory immediately above your domain directory. For example,
to verify the setup for BEA_HOME\user_domains\mydomain, navigate to
BEA_HOME\user_domains.
3. Enter:
beasvc -debug "yourServiceName"
If your setup was successful, the beasvc -debug command starts your server. If the
script returns an error similar to the following, make sure that you specified the correct
service name:
Unable to open Registry Key .......
System\CurrentControlSet\Services\beasvc
example_examplesServer\Parameters
2. On the Services control panel, right click the WebLogic Server Windows service
and click Properties.
4. Under Log on as, select This account. Then enter the user name and password of
the special OS user account.
5. Click OK.
By default, if you use the Windows Control Panel to stop a server instance, the
Windows Service Control Manager (SCM) kills the server’s Java Virtual Machine
(JVM). If you kill the JVM, the server immediately stops all processing. Any session
data is lost. If you kill the JVM for an Administration Server while the server is writing
to the config.xml file, you can corrupt the config.xml file. For information on
enabling graceful shutdowns from the Windows Control Panel, refer to “Enable
Graceful Shutdowns from the Control Panel” on page 2-53.
2. On Windows 2000, open the Administrative Tools Control Panel. Then open the
Services Control Panel.
On Windows NT, open the Services Control Panel directly from the Control
Panel window.
3. In the Services Control Panel, find the service that you created. By default, the
service name starts with beasvc.
4. Right-click the service name and select commands from the shortcut menu.
If the Domain Configuration Wizard did not already create a script for your domain,
you can create one. The script sets values for variables that identify the name of the
server instance and other server-specific information. Then the script calls a master
uninstall script, WL_HOME\server\bin\uninstallSvc.cmd, where WL_HOME is the
directory in which you installed WebLogic Server. The master scripts invokes the
beasvc utility, which removes a key from the Windows Registry.
To create a script for removing a Windows service that runs a WebLogic Server
instance:
1. In the root directory for the domain’s Administration Server (the directory that
contains the domain’s config.xml file), create a text file.
2. Add the following, required batch commands to the text file, each command on
a separate line:
z SETLOCAL
where server-name is the name of an existing server instance that you want
set up as a Windows service.
z call "WL_HOME\server\bin\uninstallSvc.cmd"
3. Save the text file with a .cmd extension. By default, the Windows command
prompt associates the .cmd extension with batch files.
If the removal script runs successfully, it prints a line similar to the following to
standard out:
mydomain_myserver removed.
By default, standard out is the command prompt in which you run the batch file.
echo off
SETLOCAL
set DOMAIN_NAME=myWLSdomain
set SERVER_NAME=myWLSserver
call "D:\bea\weblogic700\server\bin\uninstallSvc.cmd"
ENDLOCAL
If you set up the Windows service to retrieve usernames and passwords from a
boot identity file, you can overwrite the existing file with a new one that
contains the new username and password. You must specify the name of an
existing user in the WebLogic Server default security realm. For information,
refer to “Creating a Boot Identity File for an Administration Server” on page
2-8.
If you set up the Windows service to retrieve usernames and passwords from the
Windows registry, then you must remove the Windows service and create a new
one that uses your new username or password:
1. Uninstall the Windows service that runs the WebLogic Server instance. For more
information, refer to “Removing a Server as a Windows Service” on page 2-62.
2. In a text editor, open the script that you used to install the service and enter the
new username and password as the value for the set WLS_USER and set
WLS_PW commands. WebLogic encrypts these values in the Windows Registry.
By default, standard out is the command prompt in which you run the
server-specific batch file.
5. (Optional) Remove the username and password from the script file.
3 Protecting System
Administration
Operations
The following sections describe security roles and system administration operations:
Note: These role-based permissions replace access control lists (ACLs) for securing
WebLogic Server MBeans, which were used before Release 7.0.
Anonymous All users (the group everyone) are granted this global role.
Note: If you are working directly with WebLogic Server MBeans and want more
detailed information about the global roles and their privileges than is shown
in Table 3-1, see "Protected MBean Attributes and Operations" in Securing
WebLogic Resources.
You can add to the default global roles by creating your own security roles (global or
scoped) as described in "Ways to Create Security Roles in the Administration
Console" in Securing WebLogic Resources.
Administrators Admin
Deployers Deployer
Operators Operator
Monitors Monitor
For information on creating users and assigning them to groups, refer to Creating Users
and Adding Users to Groups in the Securing WebLogic Resources guide.
“How the WebLogic Security Service Verifies Layered Protections” on page 3-6
More specifically, all server resources inherit a default security policy that is based on
the Admin and Operator default global security roles. As described in “Operations
Available to Each Role” on page 3-2, the Admin and Operator global roles are given
specific privileges that are required in order for administrators to interact with
administrative interfaces like the Administration Console or the weblogic.Admin
command. These default global roles are based on the default groups (described in
“Default Group Associations” on page 3-3). Therefore, administrators who need
access to Server resources need to be members of either the Administrators or
Operators default groups.
Note: Because WebLogic Server grants the four default global roles to four default
groups, adding a user to one of these groups automatically grants the user the
global role.
Warning: Do not modify the default security policies for Server resources to make
them more restrictive. Eliminating some of the existing security roles
MBean Protections
Each type of WebLogic resource (including a Server resource) exposes a set of its
operations through its own implementation of the
weblogic.security.spi.Resource interface (the
weblogic.security.service.ServerResource class for Server resources).
Therefore, the ServerResource class is the entity that is actually secured by the
security policy described in “Security Policies for Server Resources” on page 3-5.
The MBeans that expose the configuration of a Server resource are protected using one
of the four default global roles. This protection is in addition to the security policy on
the Server resource and is currently an unmodifiable part of the WebLogic Security
Service. Therefore, while you can create your own global roles for securing Server
resources, only users granted one of default global roles can view or change the
configuration of a server.
Determines whether the user is granted one of the default global roles permitted
to change the attributes or invoke the operations of the MBean.
Checks the default security policy for the Server resource to verify that the user
meets the requirement defined by that security scheme.
Therefore, a user must satisfy both security schemes for their request to be successful.
Figure 3-1 provides a visual representation of how a security policy on the Server
resource interacts with the security role-based protections on the underlying MBeans.
MBeans
isUserInRole()
Because the privileges given by the MBean protections are immutable, it is necessary
to maintain security policies in a way that ensures consistency. (For more information,
see “Maintaining a Consistent Security Scheme” on page 3-9.)
Example
This example illustrates how one Server resource is protected by the layered security
scheme.
An administrator with the user name JDoe wants to start the server called myserver.
This administrative user (JDoe) is a member of the default group Administrators,
which by default is granted the Admin global security role. This user-to-group and
group-to-security role configuration was set up using the WebLogic Server
Administration Console, as described in other sections of this guide.
start operations) is a privilege given only to users in these default security roles.
Because the administrative user JDoe is a member of the default group
Administrators, he is also granted the Admin global security role, and therefore
fulfills the first part of the dual security scheme for Server resources.
Note: Had the administrative user JDoe been a member of the Operators group
(and therefore granted the Operator default global role), he would have still
fulfilled both parts of the dual security scheme.
For example, if you use the WebLogic Server Administration Console to add a user to
the Operator global role, but fail to use the Operator global role in the security
policy defined for a Server resource, the user can call MBean operations that are used
in the startup and shutdown sequence, but cannot use any server-resource operations
to start or stop a server. Similarly, if you use the Administration Console to remove the
Operator global role from a security policy on the Server resource, a user granted the
Operator global role can still call MBean operations but cannot call the Server
resource. This result occurs because MBean protections for the default global roles are
part of the WebLogic Security Service and are currently unmodifiable.
To keep MBean protections synchronized with security policies, consider taking the
following actions when you create or modify a security policy:
The following sections provide more information about the permissions for starting
and shutting down servers:
If you have configured a Node Manager on the host machine of a remote WebLogic
Server instance, by default a user in the Admin or Operator global role can use the
Node Manager to start the remote server.
For information about the Node Manager, refer to Managing Server Availability with
Node Manager in the Creating and Configuring WebLogic Server Domains Guide.
WebLogic Server uses log messages to record information about events such as the
deployment of new applications or the failure of one or more subsystems. The
messages include information about the time and date of the event as well as the ID of
the user who initiated the event.
You can view and sort these messages to detect problems, track down the source of a
fault, and track system performance. For example, you can determine which user
deployed a specific application or which user changed the thread pool count on a
specific day. You can also create client applications that listen for these messages and
respond automatically. For example, you can create an application that listens for
messages indicating a failed subsystem. If a subsystem fails, the application can send
email to a system administrator.
Configuration Auditing
For information on setting up your application to listen for messages, refer to the Using
WebLogic Logging Services Guide.
Message Attributes
Message Output
Message Attributes
The messages for all subsystems contain a consistent set of fields (attributes) as
described in the following table.
Timestamp The time and date when the message originated, in a format that
is specific to the locale.
Subsystem Indicates the subsystem of WebLogic Server that was the source
of the message. For example, EJB, RMI, JMS.
Server Name Identify the origins of the message. Transaction ID is present only
Machine Name for messages logged within the context of a transaction.
Thread ID
Transaction ID
User The user ID under which the associated event was executed.
To execute some pieces of internal code, WebLogic Server
authenticates the ID of the user who initiates the execution and
then runs the code under a special Kernel Identity user ID.
J2EE modules such as EJBs that are deployed onto a server
instance report the user ID that the module passes to the server.
Log messages that are generated within a client JVM client do not
include this field.
Message Severity
The severity attribute of a WebLogic Server log message indicates the potential
impact of the event or condition that the message reports.
The following table lists the severity levels of log messages from WebLogic Server
subsystems, starting from the lowest level of impact to the highest.
WARNING A suspicious operation or configuration has occurred but it may not have
an impact on normal operation.
ERROR A user error has occurred. The system or application is able to handle the
error with no interruption, and limited degradation, of service.
CRITICAL A system or service error has occurred. The system is able to recover but
there might be a momentary loss, or permanent degradation, of service.
ALERT A particular service is in an unusable state while other parts of the system
continue to function. Automatic recovery is not possible; the immediate
attention of the administrator is needed to resolve the problem.
EMERGENCY The server is in an unusable state. This severity indicates a severe system
failure or panic.
WebLogic Server subsystems generate many messages of lower severity and fewer
messages of higher severity. For example, under normal circumstances, they generate
many INFO messages and no EMERGENCY messages.
If your application uses the WebLogic logging services, it can use an additional
severity level, DEBUG. WebLogic Server subsystems do not use this severity level. For
more information, refer to Writing Debug Messages in the Using WebLogic Logging
Services Guide.
Message Output
When a WebLogic Server instance outputs a message, the first line of each message
begins with #### followed by the message attributes. Each attribute is contained
between angle brackets.
In this example, the message attributes are: Timestamp, Severity, Subsystem, Machine
Name, Server Name, Thread ID, User ID, Transaction ID, Message ID, and Message
Text.
If a message is not logged within the context of a transaction, the angle brackets
(separators) for Transaction ID are present even though no Transaction ID is present.
If the message includes a stack trace, the stack trace follows the list of message
attributes.
The character encoding used in writing the log files is the default character encoding
of the host system.
You can specify whether a WebLogic Server instance writes the stack traces to its log
file.
If an application that uses WebLogic logging services is running in a remote JVM, the
application sends its exceptions and stack traces to the WebLogic logging services.
You use the Administration Console to determine whether an instance of WebLogic
Server writes these remote exceptions and stack traces to its log file.
For more information on configuring logging of exceptions and stack traces, refer to
Configuring Debug Information in the Server Log File in the Administration Console
Online Help.
Note: We recommend that you do not modify log files by manually editing them.
Modifying a file changes the timestamp and can confuse log file rotation. In
addition, editing a file might lock it and prevent updates from a WebLogic
Server.
When a WebLogic Server instance starts, the Administration Server's message listener
registers itself with the server’s log broadcaster. At the time of registration, a default
filter is provided that determines which messages the Administration Server listens for.
The Administration Server writes these messages to an additional domain-wide log
file. (See Figure 4-1.)
Managed Server
Local
Log Manager Log File
All messages
Log Broadcaster
Filter Domain
Message Listener
Log File
Log Manager
Local
Filter Log File
Log Broadcaster
The default filter selects only messages of severity level ERROR and higher. In this way,
the domain log provides a summary of the domain’s overall status.
For any given WebLogic Server instance, you can override the default filter and create
a domain log filter that causes a different set of messages to be written to the domain
log file. For information on setting up a domain log filter for a WebLogic Server
instance, refer to Domain Log Filters in the Administration Console Online Help.
The default name for a domain log file is ./DOMAIN_NAME.log, where DOMAIN_NAME
is the name of the domain. The path is relative to the root directory of the
Administration Server.
To include a time or date stamp in the file name when the log file is rotated add
java.text.SimpleDateFormat variables to the log’s file name. For more
information, see the next section, “Log File Rotation.”
For information, see the following: on changing the names and locations of the log
files, refer to the following topics in the Administration Console Online Help:
"Specifying the Name and Location of the Domain Log File" in the
Administration Console Help
To include a time or date stamp in the file name when the log file is rotated, add
java.text.SimpleDateFormat variables to the log’s file name. Surround each
variable with percentage (%) characters.
For example, if you enter the following value for a server’s local log file name:
myserver_%yyyy%_%MM%_%dd%_%hh%_%mm%.log
When the server instance rotates the log file, the rotated file name contains the date
stamp. For example, if the server instance rotates its local log file on 2 April, 2003 at
10:05 AM, the log file that contains the old log messages will be named:
myserver_2003_04_02_10_05.log
If you do not include a time and date stamp, the rotated log files are numbered in order
of creation filenamennnnn, where filename is the name configured for the log file.
For example: myserver.log00007.
You use the Administration Console to specify rotation criteria for each WebLogic
Server instance’s local log file. You also use the Administration Console to specify
criteria for rotating the domain message log file.
You can also specify the maximum number of rotated files that can accumulate. After
the number of log files reaches this number, subsequent file rotations overwrite the
oldest log file.
Note: Log rotation by time is based on the timestamp of the files. Modifying a log
file changes the timestamp and can confuse log rotation.
For information on specifying rotation criteria, refer to the following sections in the
Administration Console Online Help:
For information about viewing, configuring, and searching message logs from the
Administration Console, refer to the following topics in the Administration Console
Online Help:
Because log files are simple text files, you can also use other applications to view them.
For information about finding the log files, refer to “Log File Names and Locations”
on page 4-8.
If you use the Node Manager to start a Managed Server, the Node Manager writes
standard out and standard error messages to its log file. You can view these messages
from the Administration Console on the Machine→Monitoring tab.
For information on printing stack traces to a log file, refer to Configuring Debug
Information in the Server Log File in the Administration Console Online Help.
For information on viewing messages for a Managed Server that you start with
the Node Manager, refer to Managed Server Log Files in the Creating and
Configuring WebLogic Server Domains guide.
For information on viewing the standard output stream for server instances that
run as Windows services, refer to “Redirecting Standard Out and Standard Error
to a File” on page 2-56.
The JVM within which a WebLogic Server instance runs also can send messages to
standard error and standard out. If you use a WebLogic Server script to start a server
instance, there is no default, persistent storage for the standard error and standard out
messages.
If you want to keep a record of these messages, edit the WebLogic Server start script
so it specifies the following Java options:
-Dweblogic.Stdout="stdout-filename"
-Dweblogic.Stderr="stderr-filename"
Where stdout-filename is the name of a file that you want to save standard out
messages and stderr-filename is the name of a file that you want to save standard
error messages.
To view the contents of these files, use a text editor or command prompt utility such
as the DOS tail program. You cannot view them from the Administration Console.
Note: WebLogic Server prompts for entering your username and password are
sent to standard out. If you use -Dweblogic.Stdout, you will no longer
see the prompts to enter your username and password. To bypass this
prompt, use a boot identity file as described in “Bypassing the Prompt for
Username and Password” on page 2-7.
Configuration Auditing
You can configure the Administration Server to emit log messages when a user
changes the configuration or invokes management operations on any resource within
a domain. For example, if a user disables SSL on a Managed Server in a domain, the
Administration Server emits log messages. These messages provide an audit trail of
changes within a domain’s configuration (configuration auditing).
The Administration Server writes configuration auditing messages to its local log file.
Because all configuration auditing messages are of the Info severity, they are not
written to the domain-wide message log by default. For information on changing this
default, see "Domain Log Filters" in the Administration Console Online Help.
In addition to writing messages to its local log file, the Administration Server
broadcasts configuration auditing messages as JMX notifications. You can create a
JMX listener and filter that responds to these messages. For example, if the
Administration Server emits a message that indicates an unauthorized user has
attempted to change the domain’s configuration, the JMX listener and filter can send
email. See "Listening for Configuration Auditing Messages" in Programming
WebLogic Management Services with JMX.
When you start the Administration Server, include the following Java option in
the weblogic.Server command:
-Dweblogic.AdministrationMBeanAuditingEnabled=true
After the Administration Server has started, use the weblogic.Admin utility to
change the value of the DomainMBean’s
AdministrationMBeanAuditingEnabled attribute.
For example, the following command disables configuration auditing for the
examples domain:
java weblogic.Admin SET
-mbean examples:Name=examples,Type=Domain
-property AdministrationMBeanAuditingEnabled true
The messages use managed bean (MBean) object names to identify resources. MBean
object names provide an unambiguous identification regardless of the interface
(Administration Console, command-line utility, or API) that is used to invoke
operations or modify the resource. See "Using WebLogicObjectNames for WebLogic
Server MBeans" in Programming WebLogic Management Services with JMX.
Note: Each time an authorized user adds, modifies, or deletes a resource the
Management subsystem also generates Info message with the ID 140009. For
example:
While the message informs you that the domain’s configuration has changed,
it does not provide the detailed information that configuration auditing
messages provide. Nor does the Management subsystem generate this
message when you invoke operations on resources.
Table 4-4 lists additional message attributes for configuration auditing messages. All
configuration auditing messages specify the same values for these attributes.
Severity Info
Thread ID execute-thread
The value depends on the number of execute threads that
are currently running on the Administration Server.
Some subsystems maintain additional log files to provide an audit of the subsystem’s
interactions under normal operating conditions. The following list describes each of
the additional log files:
The HTTP subsystem can keep a log of all HTTP transactions in a text file. You
can set the attributes that define the behavior of HTTP access logs for each
server or for each virtual host that you define. For more information, refer to
“Setting Up HTTP Access Logs” on page 6-15.
The JDBC subsystem keeps a log of various events related to JDBC connections,
including registering JDBC drivers and SQL exceptions. Note that some events
related to JDBC are written to the server log, such as when connections are
created or refreshed or when configuration changes are made to JDBC objects.
5 Deploying
Applications
For information about deploying Web Applications see Assembling and Configuring
Web Applications at http://e-docs.bea.com/wls/docs70/webapp/index.html.
For information about deploying Resource Adaptors, see Packaging and Deploying
Resource Adapters at http://e-docs.bea.com/wls/docs70/jconnector/packdepl.html.
For information about deploying EJBs, see Packaging EJBs for the WebLogic Server
Container at http://e-docs.bea.com/wls/docs70/ejb/EJB_packaging.html#1011066.
1. Set up your local environment so that WebLogic Server classes are in your system
CLASSPATH and the JDK is available. You can use the setEnv script located in the
config/mydomain directory to set the CLASSPATH.
z username is a user that has permission to complete the request on the server
that you specify in the -host argument. The default is the username that you
used to start the server that you specify in the -host argument.username is the
user account under which WebLogic Server is booted.
For information about permissions for system administration tasks, refer to
“Protecting System Administration Operations” on page 3-1.
z application is the name you want to assign to this Web Application.
Deployment Documentation
WebLogic Server Deployment at
http://e-docs.bea.com/wls/docs70/programming/deploying.html describes Weblogic
Server deployment and deployment tools, procedures, and best practices. :
WebLogic Builder How to use WebLogic Builder to edit and generate XML
deployment descriptor files for J2EE applications and their
components.
6 Configuring WebLogic
Server Web
Components
The following sections discuss how to configure WebLogic Server Web components:
“Using Native I/O for Serving Static Files (Windows Only)” on page 6-26
Overview
In addition to its ability to host dynamic Java-based distributed applications,
WebLogic Server is also a fully functional Web server that can handle high volume
Web sites, serving static files such as HTML files and image files as well as servlets
and JavaServer Pages (JSP). WebLogic Server supports the HTTP 1.1 standard.
HTTP Parameters
You can configure the HTTP operating parameters using the Administration Console
for each Server or Virtual Host.
You define a separate listen port for regular and secure (using SSL) requests. You
define the regular listen port on the Servers node in the Administration Console, under
the Configuration/General tab, and you define the SSL listen port under the
Connections/SSL tab.
Web Applications
HTTP and Web Applications are deployed according to the Servlet 2.3 specification
from Sun Microsystems, which describes the use of Web Applications as a
standardized way of grouping together the components of a Web-based application.
These components include JSP pages, HTTP servlets, and static resources such as
HTML pages or image files. In addition, a Web Application can access external
resources such as EJBs and JSP tag libraries. Each server can host any number of Web
Applications. You normally use the name of the Web Application as part of the URI
you use to request resources from the Web Application.
By default JSPs are compiled into the servers' temporary directory the location for
which is (for a server: "myserver" and for a webapp: "mywebapp"):
<domain_dir>\myserver\.wlnotdelete\appname_mywebapp_4344862
The examples domain that is shipped with Weblogic Server has a default Web
Application already configured. The default Web Application in this domain is named
DefaultWebApp and is located in the applications directory of the domain.
If you declare a default Web Application that fails to deploy correctly, an error is
logged and users attempting to access the failed default Web Application receive an
HTTP 400 error message.
For example, if your Web Application is called shopping, you would use the
following URL to access a JSP called cart.jsp from the Web Application:
http://host:port/shopping/cart.jsp
If, however, you declared shopping as the default Web Application, you would access
cart.jsp with the following URL:
http://host:port/cart.jsp
(Where host is the host name of the machine running WebLogic Server and port is
the port number where the WebLogic Server is listening for requests.)
To designate a default Web Application for a server or virtual host, use the
Administration Console:
4. Select the Servers tab and move the server (or virtual host) to the chosen column.
(You can also target all the servers in a cluster by selecting the Clusters tab and
moving the cluster to the Chosen column.)
5. Click Apply.
6. Expand the Servers (or virtual host) node in the left pane.
9. Select the HTTP tab (If you are configuring a virtual host, select the General tab
instead.)
10. Select a Web Application from the drop-down list labeled Default Web
Application.
12. If you are declaring a default Web Application for one or more managed servers,
repeat these procedures for each managed server.
Applications are served by the virtual host. When used in a cluster, load balancing
allows the most efficient use of your hardware, even if one of the DNS host names
processes more requests than the others.
For example, you can specify that a Web Application called books responds to
requests for the virtual host name www.books.com, and that these requests are targeted
to WebLogic Servers A,B and C, while a Web Application called cars responds to the
virtual host name www.autos.com and these requests are targeted to WebLogic
Servers D and E. You can configure a variety of combinations of virtual host,
WebLogic Servers, clusters and Web Applications, depending on your application and
Web server requirements.
Virtual hosting also allows you to create one directory to serve static files such as
images for multiple Web Applications. For example, to serve image files using a
virtual host, you can create a mapping similar to the folowing:
<virtual-directory-mapping>
<local-path>c:/usr/gifs</local-path>
<url-pattern>/images/*</url-pattern>
</virtual-directory-mapping>
This use of a virtual host requires you to create a directory named images to hold the
image files. This directory must be located in the relative uri, such as
"/images/test.gif".
For each virtual host that you define you can also separately define HTTP parameters
and HTTP access logs. The HTTP parameters and access logs set for a virtual host
override those set for a server. You may specify any number of virtual hosts.
You activate virtual hosting by targeting the virtual host to a server or cluster of
servers. Virtual hosting targeted to a cluster will be applied to all servers in the cluster.
Unlike other Web Applications, a default Web Application does not use the Web
Application name (also called the context path) as part of the URI used to access
resources in the default Web Application.
For example, if you defined virtual host name www.mystore.com and targeted it to a
server on which you deployed a Web Application called shopping, you would access
a JSP called cart.jsp from the shopping Web Application with the following URI:
http://www.mystore.com/shopping/cart.jsp
If, however, you declared shopping as the default Web Application for the virtual host
www.mystore.com, you would access cart.jsp with the following URI:
http://www.mystore.com/cart.jsp
For more information, see “How WebLogic Server Resolves HTTP Requests” on page
6-11.
a. Expand the Services node in the left pane. The node expands and displays a list
of services.
b. Click on the virtual hosts node. If any virtual hosts are defined, the node
expands and displays a list of virtual hosts.
e. Enter the virtual host names, one per line. Only requests matching one of these
virtual host names will be handled by the WebLogic Server or cluster targeted
by this virtual host.
g. Click Create.
a. (Optional) Click on the Logging tab and fill in HTTP access log attributes (For
more information, see “Setting Up HTTP Access Logs” on page 6-15.)
b. Select the Servers tab. You will see a list of available servers.
c. Select a server in the available column and use the right arrow button to move
the server to the chosen column.
4. Define the clusters that will respond to this virtual host (optional). You must have
previously defined a WebLogic Cluster. For more information, see Using
WebLogic Server Clusters at
http://e-docs.bea.com/wls/docs70/cluster/index.html.
b. Select the Clusters tab. You will see a list of available servers.
c. Select a cluster in the available column and use the right arrow button to move
the cluster to the chosen column. The virtual host is targeted on all of the servers
of the cluster.
e. Select Virtual Host in the available column and use the right arrow button to
move the Virtual Host to the chosen column.
You must add a line naming the virtual host to the etc/hosts file on your server to
ensure that the virtual host name can be resolved.
Note: If you package your Web Application as part of an Enterprise Application, you
can provide an alternate name for a Web Application that is used to resolve
requests to the Web Application. For more information, see Deploying Web
Applications as Part of an Enterprise Application at
http://e-docs.bea.com/wls/docs70/webapp/deployment.html#war
-ear.
The table below provides some sample URLs and the file that is served by WebLogic
Server. The Index Directories Checked column refers to the Index Directories attribute
that controls whether or not a directory listing is served if no file is specifically
requested. You set Index Directories using the Administration Console, on the Web
Applications node, under the Configuration →Files tab.
For information on setting up HTTP logging for a server or a virtual host, refer to the
following topics in the Administration Console online help:
Log Rotation
You can also choose to rotate the log file based on either the size of the file or after a
specified amount of time has passed. When either one of these two criteria are met, the
current access log file is closed and a new access log file is started. If you do not
configure log rotation, the HTTP access log file grows indefinitely. You can configure
the name of the access log file to include a time and date stamp that indicates when
the file was rotated. If you do not configure a time stamp, each rotated file name
inlcudes a numeric portion that is incremented upon each rotation. Separate HTTP
Access logs are kept for each Web Server you have defined.
where:
host
Either the DNS name or the IP number of the remote client
RFC931
Any information returned by IDENTD for the remote client; WebLogic Server
does not support user identification
auth_user
If the remote client user sent a userid for authentication, the user name;
otherwise “-”
day/month/year:hour:minute:second UTC_offset
Day, calendar month, year and time of day (24-hour format) with the hours
difference between local time and GMT, enclosed in square brackets
"request"
First line of the HTTP request submitted by the remote client enclosed in
double quotes
status
HTTP status code returned by the server, if available; otherwise “-”
bytes
Number of bytes listed as the content-length in the HTTP header, not including
the HTTP header, if known; otherwise “-”
The extended log format allows you to specify the type and order of information
recorded about each HTTP communication. To enable the extended log format, set the
Format attribute on the HTTP tab in the Administration Console to Extended. (See
“Creating Custom Field Identifiers” on page 6-19).
You specify what information should be recorded in the log file with directives,
included in the actual log file itself. A directive begins on a new line and starts with a
# sign. If the log file does not exist, a new log file is created with default directives.
However, if the log file already exists when the server starts, it must contain legal
directives at the head of the file.
Where each xxxx describes the data fields to be recorded. Field types are specified as
either simple identifiers, or may take a prefix-identifier format, as defined in the W3C
specification. Here is an example:
#Fields: date time cs-method cs-uri
This identifier instructs the server to record the date and time of the transaction, the
request method that the client used, and the URI of the request for each HTTP access.
Each field is separated by white space, and each record is written to a new line,
appended to the log file.
Note: The #Fields directive must be followed by a new line in the log file, so that the
first log message is not appended to the same line.
bytes
Number of bytes transferred, field has type <integer>.
Note that the cached field defined in the W3C specification is not supported in
WebLogic Server.
The following identifiers require prefixes, and cannot be used alone. The supported
prefix combinations are explained individually.
c-ip
The IP address of the client.
s-ip
The IP address of the server.
c-dns
The domain name of the requesting client.
s-dns
The domain name of the requested server.
sc-status
Status code of the response, for example (404) indicating a “File not found”
status. This field has type <integer>, as defined in the W3C specification.
sc-comment
The comment returned with status code, for instance “File not found”. This
field has type <text>.
cs-method
The request method, for example GET or POST. This field has type <name>,
as defined in the W3C specification.
cs-uri
The full requested URI. This field has type <uri>, as defined in the W3C
specification.
cs-uri-stem
Only the stem portion of URI (omitting query). This field has type <uri>, as
defined in the W3C specification.
cs-uri-query
Only the query portion of the URI. This field has type <uri>, as defined in the
W3C specification.
1. Include the field name in the Fields directive, using the form:
x-myCustomField.
2. Create a Java class with the same fully-qualified class name as the custom field
you defined with the Fields directive (for example myCustomField). This class
defines the information you want logged in your custom field. The Java class
must implement the following interface:
weblogic.servlet.logging.CustomELFLogger
In your Java class, you must implement the logField() method, which takes a
HttpAccountingInfo object and FormatStringBuffer object as its
arguments:
z Use the HttpAccountingInfo object to access HTTP request and response
data that you can output in your custom field. Getter methods are provided to
access this information. For a complete listing of these get methods, see “Get
Methods of the HttpAccountingInfo Object” on page 6-20.
3. Compile the Java class and add the class to the CLASSPATH statement used to start
WebLogic Server. You will probably need to modify the CLASSPATH statements
in the scripts that you use to start WebLogic Server.
Note: Do not place this class inside of a Web Application or Enterprise
Application in exploded or jar format.
4. Configure WebLogic Server to use the extended log format. For more
information, see “Setting Up HTTP Access Logs by Using Extended Log
Format” on page 6-16.
Note: When writing the Java class that defines your custom field, you should not
execute any code that is likely to slow down the system (For instance,
accessing a DBMS or executing significant I/O or networking calls.)
Remember, an HTTP access log file entry is created for every HTTP request.
Note: If you want to output more than one field, delimit the fields with a tab
character. For more information on delimiting fields and other ELF formatting
issues, see Extended Log Format at
http://www.w3.org/TR/WD-logfile-960221.html.
For details on these methods see the corresponding methods in the Java interfaces
listed in the following table, or refer to the specific information contained in the table.
boolean javax.servlet.http.Http.ServletRequest
isRequestedSessionIdFromCookie();
boolean javax.servlet.http.Http.ServletRequest
isRequestedSessionIdFromURL();
boolean javax.servlet.http.Http.ServletRequest
isRequestedSessionIdFromUrl();
String getFirstLine(); Returns the first line of the HTTP request, for example:
GET /index.html HTTP/1.0
long getInvokeTime(); Returns the length of time it took for the service method
of a servlet to write data back to the client.
import weblogic.servlet.logging.CustomELFLogger;
import weblogic.servlet.logging.FormatStringBuffer;
import weblogic.servlet.logging.HttpAccountingInfo;
MaxPostTimeSecs
Limits the total amount of time that WebLogic Server spends receiving post
data. If this limit is triggered, a PostTimeoutException is thrown and the
following message is sent to the server log:
Post time exceeded MaxPostTimeSecs.
MaxPostSize
Limits the number of bytes of data received in a POST from a single request. If
this limit is triggered, a MaxPostSizeExceeded exception is thrown and the
following message is sent to the server log:
POST size exceeded the parameter MaxPostSize.
An HTTP error code 413 (Request Entity Too Large) is sent back to the client.
If the client is in listening mode, it gets these messages. If the client is not in
listening mode, the connection is broken.
Note that the server must also support both the HTTP and T3 protocols in order
to use HTTP tunneling.
Tunneling Client Ping
When an HTTP tunnel connection is set up, the client automatically sends a
request to the server, so that the server may volunteer a response to the client.
The client may also include instructions in a request, but this behavior happens
regardless of whether the client application needs to communicate with the
server. If the server does not respond (as part of the application code) to the
client request within the number of seconds set in this attribute, it does so
anyway. The client accepts the response and automatically sends another
request immediately.
On the client side, a special tag is appended to the http protocol, so that WebLogic
Server knows this is a tunneling connection, instead of a regular HTTP request. Your
application code does not need to do any extra work to make this happen.
The client must specify the port in the URL, even if the port is 80. You can set up your
WebLogic Server to listen for HTTP requests on any port, although the most common
choice is port 80 since requests to port 80 are customarily allowed through a firewall.
You specify the listen port for WebLogic Server in the Administration Console under
the “Servers” node, under the “Network” tab.
The following example shows the complete entries that should be added to the
web.xml deployment descriptor. These entries must be placed in the web.xml file after
the <distributable> element and before <servlet> element.
<context-param>
<param-name>weblogic.http.nativeIOEnabled</param-name>
<param-value>TRUE</param-value>
</context-param>
<context-param>
<param-name>weblogic.http.minimumNativeFileSize</param-name>
<param-value>500</param-value>
</context-param>
7 Managing Transactions
These sections discuss transaction management and provide guidelines for configuring
and managing transactions through the Administration Console.
Configuring Transactions
Moving a Server
Abandoning Transactions
http://e-docs.bea.com/wls/docs70/adminguide/overview.html#start_a
dmin_console. The transaction configuration process involves specifying values for
attributes. These attributes define various aspects of the transaction environment:
Settings you make in the Administration Console, including configuration settings for
JTA, are persisted in the config.xml file for the domain. For information about
entries in this file, see the following sections of the Configuration Reference Guide:
JTA at http://e-docs.bea.com/wls/docs70/config_xml/JTA.html
JTAMigratableTarget at
http://e-docs.bea.com/wls/docs70/config_xml/JTAMigratableTarget
.html
JTARecoveryService at
http://e-docs.bea.com/wls/docs70/config_xml/JTARecoveryService.
html
JDBCTxDataSource at
http://e-docs.bea.com/wls/docs70/config_xml/JDBCTxDataSource.ht
ml
Before configuring your transaction environment, you should be familiar with the
J2EE components that can participate in transactions, such as EJBs, JDBC, and JMS.
JMS (Java Messaging Service) uses JTA to support transactions across multiple
data resources. WebLogic JMS is an XA-compliant resource manager. For more
information about programming with JMS and JTA, see Programming WebLogic
JMS.
For more information about configuring J2EE components, see the applicable sections
of this document and the Administration Console Online Help.
Configuring Transactions
Configuration settings for JTA are applicable at the domain level. This means that
configuration attribute settings apply to all servers within a domain. Monitoring and
logging tasks for JTA are performed at the server level.
You can configure any transaction attributes before starting the server (static
configuration) or, with one exception, while the server is running (dynamic
configuration). The TransactionLogFilePrefix attribute must be set before
starting the server.
2. Select the domain node in the left pane. The Configuration tab for the domain is
displayed by default.
4. For each attribute, change the value as desired or accept the default value.
For detailed information about the transaction attributes available with WebLogic
Server, including valid and default values, see the Domain topic in the Administration
Console Online Help.
You set these attributes directly in the config.xml file when the domain is inactive.
These attributes are not available in the Administration Console. The following
example shows an excerpt of a configuration file with these attributes:
...
<JTA
MaxUniqueNameStatistics="5"
TimeoutSeconds="300"
RecoveryThresholdMillis="150000"
MaxResourceUnavailableMillis="900000"
MaxResourceRequestOnServer="60"
MaxXACallMillis="180000"
/>
<JDBCConnectionPool
Name="XAPool"
Targets="myserver"
DriverName="weblogic.qa.tests.transaction.
testsupport.jdbc.XADataSource"
InitialCapacity="1"
MaxCapacity="10"
CapacityIncrement="2"
RefreshMinutes="5"
TestTableName="dual"
EnableResourceHealthMonitoring="true"
Properties="user=scott;password=tiger;server=dbserver1"
/>
<JDBCTxDataSource
Name="XADataSource"
Targets="myserver"
JNDIName="weblogic.jdbc.XADS"
PoolName="XAPool"
/>
...
The domains and all participating resources must have unique names. That is,
you cannot have a JDBC connection pool, a server, or a domain with the same
name as an object in another domain or the domain itself.
Only one data source with both of the following attribute conditions can
participate in a global transaction, regardless the domain in which the data
source is configured:
z Emulate Two-Phase Commit is selected (EnableTwoPhaseCommit=true in
config.xml).
z The Pool Name attribute in the data source specifies a connection pool that
uses a non-XA driver to create database connections.
Note: BEA recommends that you use an XA driver instead of a non-XA driver (with
Emulate Two-Phase Commit) in global transactions. There are risks involved
with using a non-XA driver in a global transaction. See Limitations and Risks
When Using a Non-XA Driver in Global Transactions in the Administration
Guide for more details about the risks.
1. In all participating WebLogic Server 6.x domains, change the password for the
system user to the same value in all participating domains on the Security→Users
tab in the Administration Console. See Changing the System Password at
http://e-docs.bea.com/wls/docs61/adminguide/cnfgsec.html#cnfgse
c003.
2. Establish domain trust by setting a security credential for all domains to the same
value in all participating domains. If you have participating 6.x domains, set the
security credential for all domains to the same value as the system password in
all participating WebLogic Server 6.x domains.
z For 7.x domains, see Enabling Trust Between WebLogic Domains in
Managing WebLogic Security.
9.x Set both do- Set both do- Set both do- Set the 9.x Set the 9.x Set the 9.x
mains to mains to mains to domain to domain to domain to
default perfor- perfor- compati- compati- compati-
or per- mance mance bility bility bility
formance
8.1 SP5 and Set both do- Set both do- Set both do- Set the 8.1 Set the 8.1 Set the 8.1
higher mains to mains to mains to SP5 and high- SP5 and high- SP5 and high-
perfor- perfor- perfor- er domain to er domain to er domain to
mance mance mance compati- compati- compati-
bility bility bility
7.0 SP7 and Set both do- Set both do- Set both do- Set the 7.0 Set the 7.0 Set the 7.0
higher mains to mains to mains to SP7 and high- SP7 and high- SP7 and high-
perfor- perfor- perfor- er domain to er domain to er domain to
mance mance mance compati- compati- compati-
bility bility bility
8.1 SP4 and Set the 9.x Set the 8.1 Set the 7.0 N/A N/A N/A
lower domain to SP5 and high- SP7 and high-
compati- er domain to er domain to
bility compati- compati-
bility bility
7.0 SP6 and Set the 9.x Set the 8.1 Set the 7.0 N/A N/A N/A
lower domain to SP5 and high- SP7 and high-
compati- er domain to er domain to
bility compati- compati-
bility bility
6.x Set the 9.x Set the 8.1 Set the 7.0 N/A N/A N/A
domain to SP5 and high- SP7 and high-
compati- er domain to er domain to
bility compati- compati-
bility bility
To display transaction statistics and to set the prefix for the transaction log files, do the
following:
5. Select the JTA tab. Totals for transaction statistics are displayed in the JTA
dialog. (You can also click the monitoring text links to monitor transactions by
resource or by name, or to monitor all active transactions.)
8. Enter a transaction log file prefix (storage location for transaction logs) then click
Apply to save the attribute setting. The new transaction log file prefix takes effect
after you restart the server.
The default transaction log file prefix is the server’s working directory.
For detailed information on monitoring and logging values and attributes, see the
following sections in the Administration Console Online Help:
Transaction Monitoring
You can monitor transactions in progress using the WebLogic Console. In addition to
displaying statistics, as described in Transaction Statistics in Programming WebLogic
JTA, you can display the following:
The transaction log consists of multiple files. Each file is subject to garbage collection.
That is, when none of the records in a transaction log file are needed, the system deletes
the file and returns the disk space to the file system. In addition, the system creates a
new transaction log file if the previous log file becomes too large or a checkpoint
occurs.
Caution: Do not manually delete transaction log files. Deleting transaction log files
may cause inconsistencies in your data.
Transaction log files are uniquely named using a pathname prefix, the server name, a
four-digit numeric suffix, and a file extension. The pathname prefix determines the
storage location for the file. You can specify a value for the
TransactionLogFilePrefix server attribute using the WebLogic Administration
Console. The default TransactionLogFilePrefix is the server’s working directory.
You should set the TransactionLogFilePrefix so that transaction log files are
created on a highly available file system, for example, on a RAID device. To take
advantage of the migration capability of the Transaction Recovery Service for servers
in a cluster, you must store the transaction log in a location that is available to a server
and its backup servers, preferably on a dual-ported SCSI disk or on a Storage Area
Network (SAN). See “Preparing to Migrate the Transaction Recovery Service” on
page 7-23 for more information.
C:\weblogic\logA\websvr0000.tlog
C:\weblogic\logA\websvr0001.tlog
C:\weblogic\logA\websvr0002.tlog
If you notice a large number of transaction log files on your system, this may be an
indication of multiple long-running transactions that have not completed. This can be
caused by resource manager failures or transactions with especially large timeout
values.
If the file system containing the transaction log runs out of space or is inaccessible,
commit() throws SystemException, and the transaction manager places a message
in the system error log. No transactions are committed until more space is available.
When migrating a server to another machine, move the transaction log files as well,
keeping all the log files for a server together. See “Moving a Server to Another
Machine” on page 7-17 for more information.
Warning: On Windows, the Direct-Write transaction log file write policy may leave
transaction data in the on-disk cache without immediately writing it to
disk. This is not transactionally safe because a power failure can cause
loss of on-disk cache data. To prevent cache data loss when using the
Direct-Write transaction log file write policy on Windows, disable all
write caching for the disk (enabled by default) or use a battery backup for
the system.
The transaction log file write policy can affect transaction performance. You should
test these options with your system to see which performs better. Direct-Write
typically performs as well or better than Cache-Flush, depending on operating system
and OS parameter settings, and is available on Windows, HP-UX, and Solaris.
Windows systems optimize serial writes to disk such that subsequent writes to a file
get faster after the first write to the file. Transaction log file entries are written serially,
so this could improve performance. On some UNIX systems, the Cache-Flush option
will flush all cached disk writes, not only those for the transaction log file, which could
degrade transaction performance.
To set the transaction log file write policy, follow these steps:
1. In the Administration Console, click the server node in the left pane and select a
server.
2. In the right pane, select the Logging tab and then the JTA tab.
3. Select a Transaction Log File Write Policy: Cache-Flush (the default) or Direct
Write.
4. Click Apply to save the attribute setting. The new transaction log file write policy
takes effect after you restart the server.
Heuristic log files are stored with transaction log files and look similar to transaction
log files with .heur before the .tlog extension. They use the following format:
<TLOG_file_prefix>\<server_name><4-digit number>.heur.tlog
On a UNIX system with a server name of websvr, you might see the following
heuristic log files:
/usr7/applog1/websvr0000.heur.tlog
/usr7/applog1/websvr0001.heur.tlog
/usr7/applog1/websvr0002.heur.tlog
Similarly, on a Windows system, you might see the following heuristic log files:
C:\weblogic\logA\websvr0000.heur.tlog
C:\weblogic\logA\websvr0001.heur.tlog
C:\weblogic\logA\websvr0002.heur.tlog
committed and some rolled back. But system or resource failures make it
impossible to know for sure whether a Heuristic Mixed outcome definitely
occurred. The underlying cause was most likely heuristic rollback or heuristic
commit decisions made by one or more of the participating resources.
When an heuristic completion occurs, a message is written to the server log. Refer to
your database vendor documentation for instructions on resolving heuristic
completions.
Some resource managers save context information for heuristic completions. This
information can be helpful in resolving resource manager data inconsistencies. If the
ForgetHeuristics attribute is selected (set to true) on the JTA panel of the
WebLogic Console, this information is removed after an heuristic completion. When
using a resource manager that saves context information, you may want to set the
ForgetHeuristics attribute to false.
Moving a Server
A server instance is identified by its URL (IP address or DNS name plus the listening
port number). Changing the URL by moving the server to a new machine or changing
the Listening Port of a server on the same machine effectively moves the server so the
server identity may no longer match the information stored in the transaction logs.
If the new server has the same URL as the old server, the Transaction Recovery
Service searches all transaction log files for incomplete transactions and
completes them as described in “Transaction Recovery Service Actions After a
Crash” on page 7-19.
If the new server does not have the same URL, any pending transactions stored
in the transaction log files are unrecoverable. If you wish, you can delete the
transaction log files. This step prevents the Transaction Recovery Service from
attempting to resolve these transactions until the value of the
AbandonTimeoutSeconds parameter is exceeded. See “Abandoning
Transactions” on page 7-17 for more information.
BEA recommends configuring server instances using DNS names rather than IP
addresses to promote portability.
When an application server is moved to another machine, it must be able to locate the
transaction log files on the new disk. If the pathname is different on the new machine,
update the TransactionLogFilePrefix attribute with the new path before starting
the server. For instructions on how to change the TransactionLogFilePrefix, see
Specifying the Transaction Log File Location in the Administration Console Online
Help.
Abandoning Transactions
You can choose to abandon incomplete transactions after a specified amount of time.
In the two-phase commit process for distributed transactions, the transaction manager
coordinates all resource managers involved in a transaction. After all resource
managers vote to commit or rollback, the transaction manager notifies the resource
managers to act—to either commit or rollback changes. During this second phase of
the two-phase commit process, the transaction manager will continue to try to
complete the transaction until all resource managers indicate that the transaction is
completed. Using the AbandonTimeoutSeconds attribute, you can set the maximum
time, in seconds, that a transaction manager will persist in attempting to complete a
transaction during the second phase of the commit protocol. The default value is 86400
seconds, or 24 hours. After the abandon transaction timer expires, no further attempt
is made to resolve the transaction with any resources that are unavailable or unable to
For more information about the two-phase commit process, see Distributed
Transactions and the Two-Phase Commit Protocol in Programming WebLogic
JTA.
If a server crashes and you do not expect to be able to restart it within a reasonable
period of time, you may need to take action. Procedures for recovering transactions
after a server failure differ based on your WebLogic Server environment. For a
non-clustered server, you can manually move the server (with transaction log files) to
another system (machine) to recover transactions. See “Recovering Transactions for a
Failed Non-Clustered Server” on page 7-20 for more information. For a server in a
cluster, you can manually migrate the Transaction Recovery Service to another server
in the same cluster. Migrating the Transaction Recovery Service involves selecting a
server with access to the transaction logs to recover transactions, and then migrating
the service using the Administration Console or the WebLogic command line
interface.
Note: For non-cluster servers, you can only move the entire server to a new system.
For clustered servers, you can temporarily migrate the Transaction Recovery
Service.
For more information about migrating the Transaction Recovery Service, see
“Recovering Transactions for a Failed Clustered Server” on page 7-21. For more
information about clusters, see Using WebLogic Server Clusters at
http://e-docs.bea.com/wls/docs70/cluster/index.html.
1. Move (or make available) all transaction log files from the failed server to a new
server.
3. Start the new server. The Transaction Recovery Service searches all transaction
log files for incomplete transactions and completes them as described in
“Transaction Recovery Service Actions After a Crash” on page 7-19.
When moving transaction logs after a server failure, make all transaction log files
available on the new machine before starting the server there. You can accomplish this
by storing transaction log files on a dual-ported disk available to both machines. As in
the case of a planned migration, update the TransactionLogFilePrefix attribute
with the new path before starting the server if the pathname is different on the new
machine. Ensure that all transaction log files are available on the new machine before
the server is started there. Otherwise, transactions in the process of being committed at
the time of a crash might not be resolved correctly, resulting in application data
inconsistencies.
1. The Transaction Recovery Service on the backup server takes ownership of the
transaction log from the crashed server.
2. The Transaction Recovery Service searches all transaction log files from the
failed server for incomplete transactions and completes them as described in
“Transaction Recovery Service Actions After a Crash” on page 7-19.
For instructions to migrate the Transaction Recovery Service using the Administration
Console, see Migrating the Transaction Recovery Service to a Server in the Same
Cluster in the Administration Console online help at
http://e-docs.bea.com/wls/docs70/ConsoleHelp/jta.html#jta_trs_mig
rate. For instructions to migrate the Transaction Recovery Service using the
command line interface, see MIGRATE in Appendix B, “WebLogic Server
Command-Line Interface Reference.”
A server can perform transaction recovery for more than one failed server. While
recovering transactions for other servers, the backup server continues to process and
recover its own transactions. If the backup server fails during recovery, you can
migrate the Transaction Recovery Service to yet another server, which will continue
the transaction recovery. You can also manually migrate the Transaction Recovery
Service back to the original failed server using the Administration Console or the
command line interface. See Manually Migrating the Transaction Recovery Service
Back to the Original Server in the Administration Console online help at
http://e-docs.bea.com/wls/docs70/ConsoleHelp/jta.html#jta_trs_mig
rate_back for more information.
If a backup server still owns the Transaction Recovery Service for a failed server and
the backup server is inactive when you attempt to restart the failed server, the failed
server will not start because the backup server cannot release ownership of the
Transaction Recovery Service. This is also true if the fail back mechanism fails or if
the backup server cannot communicate with the Administration Server. You can
manually migrate the Transaction Recovery using the Administration Console or the
command line interface.
You cannot migrate the Transaction Recovery Service to a backup server from a
server that is running. You must stop the server before migrating the
Transactions Recovery Service.
The backup server does not accept new transaction work for the failed server. It
only processes incomplete transactions.
The backup server only processes log records written by WebLogic Server. It
does not process log records written by gateway implementations, including
WebLogic Tuxedo Connector.
When migrating the Transaction Recovery Service from a server, you must stop the
failing or failed server before actually migrating the Transaction Recovery Service. If
the original server is still running, you cannot migrate the Transaction Recovery
Service from it.
For detailed instructions to migrate the Transaction Recovery Service, see Migrating
the Transaction Recovery Service to a Server in the Same Cluster in the Administration
Console Online Help at
http://e-docs.bea.com/wls/docs70/ConsoleHelp/jta.html#jta_trs_mig
rate.
You can also use the command line to migrate the Transaction Recovery Service. See
“MIGRATE” in Appendix B, “WebLogic Server Command-Line Interface
Reference.”
8 Managing JDBC
Connectivity
The following sections provide guidelines for configuring and managing database
connectivity through the JDBC components—Data Sources, connection pools and
MultiPools—for both local and distributed transactions:
Defining the attributes that govern JDBC connectivity between WebLogic Server
and your database management system
Related Information
The JDBC drivers, used locally and in distributed transactions, interface with many
WebLogic Server components and information appears in several documents. For
example, information about JDBC drivers is included in the documentation sets for
JDBC, JTA, and WebLogic jDrivers.
For a complete list of the JDBC attributes, see the WebLogic Server
Configuration Reference Guide at
http://e-docs.bea.com/wls/docs70/config_xml/index.html.
For information about using the command-line interface, see “WebLogic Server
Command-Line Interface Reference” on page B-1.
For information about the JDBC API, see Programming WebLogic JDBC. The
“Introduction to WebLogic JDBC” section provides a concise overview of JDBC
and JDBC drivers.
For information about using the WebLogic jDrivers, see Using WebLogic
jDriver for Oracle at http://e-docs.bea.com/wls/docs70/oracle/index.html or
Using WebLogic jDriver for Microsoft SQL Server at
http://e-docs.bea.com/wls/docs70/mssqlserver4/index.html.
Transactions (JTA)
For information about managing JTA, see “Managing Transactions” on page 7-1.
For information about using third-party drivers, see "Using Third-Party JDBC
XA Drivers with WebLogic Server" in Programming WebLogic JTA at
http://e-docs.bea.com/wls/docs70/jta/thirdpartytx.html.
For information about using the WebLogic jDriver for Oracle/XA, see "Using
WebLogic jDriver for Oracle/XA in Distributed Transactions" in Using
WebLogic jDriver for Oracle at
http://e-docs.bea.com/wls/docs70/oracle/trxjdbcx.html.
Connection Pools
A connection pool contains a group of JDBC connections that are created when the
connection pool is registered—when starting up WebLogic Server or when assigning
the connection pool to a target server or cluster. Connection pools use a type 2 or type
4 JDBC driver to create physical database connections. Your application borrows a
connection from the pool, uses it, then returns it to the pool by closing it. Read more
about Connection Pools in Programming WebLogic JDBC at
http://e-docs.bea.com/wls/docs70/jdbc/programming.html.
All of the settings you make with the Administration Console are static; that is, all
settings persist even after you stop and restart WebLogic Server. You can create
dynamic connection pools—those that you expect to use and delete while the server is
running—using the command line (see “WebLogic Server Command-Line Interface
Reference” on page B-1) or programmatically using the API (see Creating a
Connection pool settings are persisted in the config.xml file, including settings for
dynamically created connection pools (until you programmatically delete the
connection pool). For information about entries in the config.xml file, see the
JDBCConnectionPool section of the Configuration Reference Guide at
http://e-docs.bea.com/wls/docs70/config_xml/JDBCConnectionPool.ht
ml.
An instance of the connection pool is created with each instance of your application.
This means an instance of the pool is created with the application on each node that the
application is targeted to. It is important to keep this in mind when considering pool
sizing.
For more information about application scoping and application scoped resources, see:
MultiPools
A MultiPool is a pool of connection pools. Used in local (non-distributed) transactions
on single or multiple WebLogic Server configurations, MultiPools aid in either:
High Availability—connection pools are listed in the order that determines the
order in which connection pool switching occurs. That is, WebLogic Server
provides database connections from the first connection pool on the list. If that
connection pool fails, it attempts to use a database connection from the second,
and so forth.
Data Sources
A Data Source object enables JDBC applications to obtain a DBMS connection from
a connection pool. Each Data Source object binds to the JNDI tree and points to a
connection pool or MultiPool. Applications look up the Data Source to get a
connection. Data Source objects can be defined with JTA (Tx Data Sources in the
Administration Console) or without JTA (Data Sources in the Administration
Console). You use Tx Data Source for distributed transactions. See “JDBC
Configuration Guidelines for Connection Pools, MultiPools, and DataSources” on
page 8-19 for more information about using Data Sources and Tx Data Sources.
For details about creating and using a JDBC Data Source factory, see Resource
Factories in Programming WebLogic Enterprise JavaBeans at
http://e-docs.bea.com/wls/docs70/ejb/EJB_environment.html#resourc
efact.
The default security realm for WebLogic Server 6.1 was the File realm, which uses
ACLs in the fileRealm.properties file for authorization and authentication.
Connection pools are unprotected unless you define ACLs for connection pools (as a
resource type) or for individual connection pools. If you define an ACL for connection
pools, access is restricted to exactly what is defined in the ACL. For example, before
you have any ACLs for connection pools in your fileRealm.properties file,
everyone has unrestricted access to all connection pools in your domain. However, if
you add the following line to the file, access becomes very restricted:
acl.reset.weblogic.jdbc.connectionPool=Administrators
This line grants reset privileges to Administrators on all connection pools and it
prohibits all other actions by all other users. By adding an ACL, file realm protection
for connection pools is activated. WebLogic Server enforces the ACLs defined in
fileRealm.properties and only allows access specifically granted in the file. If
your intent in adding the ACL was to restrict resets only on connection pools, you must
specifically grant privileges for other actions to everyone or to specific roles or users.
For example:
acl.reserve.weblogic.jdbc.connectionPool=everyone
acl.shrink.weblogic.jdbc.connectionPool=everyone
acl.admin.weblogic.jdbc.connectionPool=everyone
Table 8-1 lists the ACLs that you can use in fileRealm.properties to secure
connection pools.
JDBCConnectionPool at
http://e-docs.bea.com/wls/docs70/config_xml/JDBCConnectionPool.
html
JDBCMultiPool at
http://e-docs.bea.com/wls/docs70/config_xml/JDBCMultiPool.html
JDBCDataSource at
http://e-docs.bea.com/wls/docs70/config_xml/JDBCDataSource.html
JDBCTxDataSource at
http://e-docs.bea.com/wls/docs70/config_xml/JDBCTxDataSource.ht
ml
JDBC Configuration
In this section, we define configuration as including these processes:
First you create the connection pools and optionally a MultiPool, then you create the
Data Source. When you create a Data Source object, you specify a connection pool or
MultiPool as one of the Data Source attributes. This associates that Data Source with
one specific connection pool or MultiPool ("pool").
In a single server configuration, assign each Data Source and its associated
connection pool to the server.
In a cluster, assign the Data Source and related connection pool to the cluster,
not to individual servers in the cluster.
If you are using a MultiPool, assign the connection pools to the MultiPool; then
assign the Data Source and all connection pools and the MultiPool to the same
targets: server(s) or cluster(s).
Refer to the following table for more information about association and assignment in
the configuration process.
You can assign these Data Source/connection pool combinations to more than one
server or cluster, but they must be assigned in combination. For example, you cannot
assign a Data Source to Managed Server A if its associated connection pool is assigned
only to Server B.
You can configure dynamic connection pools (after the server starts) using the
WebLogic API (see Creating a Dynamic Connection Pool in Programming WebLogic
JDBC) or the command-line interface (see “JDBC Configuration Tasks Using the
Command-Line Interface” on page 8-16). WebLogic Server also includes example
code for creating and configuring dynamic Data Sources and connection pools in the
server samples, if you opted to install samples during installation. See
SAMPLES_HOME\server\src\examples\jdbc, where SAMPLES_HOME is the location
of the top-level directory for all samples and examples for the WebLogic Platform
(c:\bea\weblogic700\samples, by default).
2. Locate the Services node in the left pane, then expand the JDBC node.
3. Select the node in the tree specific to the component you want to configure or
manage—connection pools, MultiPools, Data Source, or Tx Data Source.
4. Follow the instructions in the Online Help. For links to the Online Help, see
Table 8-3.
The following table shows the connectivity tasks, listed in typical order in which you
perform them. You may perform these tasks in a different order; but you must
configure an object before associating or assigning it.
Configure a Connection On the Configuration tabs in the right pane, you set the attributes
Pool for the connection pool, such as Name, URL, and database
Properties.
Clone a Connection Pool This task copies a connection pool. On the Configuration tabs,
(Optional) you change Name of pool to a unique name; and accept or change
the remaining attributes. This a useful feature when you want to
have identical pool configurations with different names. For
example, you may want to have each database administrator use
a certain pool to track individual changes to a database.
Assign a Connection Using the Target tab, you assign the connection pool to one or
Pool to the more Servers or Clusters. See Table 8-2 Association and
Servers/Clusters Assignment Scenarios.
Also, to assign several connection pools to a server, see Assigning
JDBC Connection Pools to a Server in the Online Help.
Configure a MultiPool On the MultiPool tabs, you set the attributes for the name and
(Optional) algorithm type, either High Availability or Load Balancing. On
the Pool tab, you assign the connection pools to this MultiPool.
Assign the MultiPool to Using the Target tab, you assign the configured MultiPool to
Servers or Clusters Servers or Clusters.
Configure a Data Source Using the Data Source tab, set the attributes for the Data Source,
(and Associate it with a including the Name, JNDI Name, and Pool Name (this associates,
Connection Pool) or assigns, the Data Source with a specific pool—connection pool
or MultiPool.)
Assign the Data Source Using the Target tab, you assign the configured Data Source to
to Servers or Clusters servers or clusters.
Configure a Tx Data Using the Tx Data Source tab, set the attributes for the Tx Data
Source (and Associate it Source, including the Name, JNDI Name, and Connection Pool
with a Connection Pool) Name (this associates, or assigns, the Data Source with a specific
pool).
Assign the Tx Data Using the Target tab, you assign the configured Tx Data Source
Source to Servers to servers.
Password. Use this field to set the database password. This value overrides any
password value defined in the Properties passed to the tier-2 JDBC Driver
when creating physical database connections. The value is encrypted in the
config.xml file (stored as the Password attribute in the JDBCConnectionPool
tag) and is hidden on the administration console.
Open String Password. Use this field to set the password in the open string
that the transaction manager in WebLogic Server uses to open a database
connection. This value overrides any password defined as part of the open string
in the Properties field. The value is encrypted in the config.xml file (stored
as the XAPassword attribute in the JDBCConnectionPool tag) and is hidden on
the Administration Console. At runtime, WebLogic Server reconstructs the open
string with the password you specify in this field. The open string in the
Properties field should follow this format:
openString=Oracle_XA+Acc=P/userName/+SesTm=177+DB=dbHost+Thread
s=true=Sqlnet=dvi0+logDir=.
Note that after the userName there is no password.
If you specify a password in the Properties field when you first configure the
connection pool, WebLogic Server removes the password from the Properties string
and sets the value as the Password value in an encrypted form the next time you start
WebLogic Server. If there is already a value for the Password attribute for the
connection pool, WebLogic Server does not change any values. However, the value for
the Password attribute overrides the password value in the Properties string. The
same behavior applies to any password that you define as part of an open string. For
example, if you include the following properties when you first configure a connection
pool:
user=scott;
password=tiger;
openString=Oracle_XA+Acc=p/scott/tiger+SesTm=177+db=dbHost+Thread
s=true+Sqlnet=lcs817+logDir=.+dbgFl=0x15;server=dbHost
The next time you start WebLogic Server, it moves the database password and the
password included in the open string to the Password and Open String Password
attributes, respectively, and the following value remains for the Properties field:
user=scott;
openString=Oracle_XA+Acc=p/scott/+SesTm=177+db=dbHost+Threads=tru
e+Sqlnet=lcs817+logDir=.+dbgFl=0x15;server=dbHost
After a value is established for the Password or Open String Password attributes,
the values in these attributes override the respective values in the Properties
attribute. That is, continuing with the previous example, if you specify tiger2 as the
database password in the Properties attribute, WebLogic Server ignores the value
and continues to use tiger as the database password, which is the current encrypted
value of the Password attribute. To change the database password, you must change
the Password attribute.
Note: The value for Password and Open String Password do not need to be the
same.
Reassign a Connection Pool Using the instructions in Assign a Connection Pool to the
to a Different Server or Servers/Clusters, on the Target tab deselect the target
Cluster (move target from Chosen to Available) and assign a new
target.
To assign several connection pools to a server, see
Assigning JDBC Connection Pools to a Server in the
Online Help.
Delete a Connection Pool See Deleting a Connection Pool in the Online Help.
Delete a Data Source See Deleting a Connection Pool in the Online Help.
Monitor a Connection Pool To monitor the connections for a single connection pool,
see Monitoring Connections in a JDBC Connection Pool in
the Online Help.
To monitor all active connection pools for a server, see
Monitoring All Active JDBC Connection Pools in the
Online Help.
For information on using the connection pool commands, see “WebLogic Server
Command-Line Interface Reference” on page B-1
Table 8-6 Managing Connection Pools with the Command Line Interface
If you want to . . . Then use this command . . .
Data Source Data Source object Requires Tx Data Requires Tx Data Source.
recommended. (If there Source. Select Emulate Two-Phase
is no Data Source, use Commit for non-XA
the JDBC API.) Driver (set enable
two-phase
commit=true) if more
than one resource is
involved. See
“Configuring Non-XA
JDBC Drivers for
Distributed Transactions”
on page 8-35.
Access multiple resources, such as a database and the Java Messaging Service
(JMS), during a transaction
With an EJB architecture, it is common for multiple EJBs that are doing database work
to be invoked as part of a single transaction. Without XA, the only way for this to work
is if all transaction participants use the exact same database connection. WebLogic
Server uses the JTS driver and a TxDataSource (with Emulate Two-Phase Commit for
non-XA Driver selected) to do this behind the scenes without requiring you to
explicitly pass the JDBC connection from EJB to EJB. With XA (requires an XA
driver), you can use a Tx Data Source in WebLogic Server for distributed transactions
with two-phase commit so that EJBs can use a different database connections for each
part of the transaction. In either case (with or without XA), you should use a
Tx Data Source.
Note: Do not create two Tx Data Sources that point to the same connection pool. If
a transaction uses two different Tx Data Sources which are both pointed to the
same connection pool, you will get an XA_PROTO error when you try to
access the second connection.
Specify the Driver Classname attribute as the name of the class supporting the
java.sql.Driver interface.
Specify the data properties. These properties are passed to the specific Driver
as driver properties. (Enter each on a separate line.)
For more information on WebLogic two-tier JDBC drivers, refer to the BEA
documentation for the specific driver you are using: Using WebLogic jDriver for
Oracle at http://e-docs.bea.com/wls/docs70/oracle/index.html and Using
WebLogic jDriver for Microsoft SQL Server at
http://e-docs.bea.com/wls/docs70/mssqlserver4/index.html. If you are
using a third-party driver, refer to Using Third-Party JDBC XA Drivers with
WebLogic Server in Programming WebLogic JTA at
http://e-docs.bea.com/wls/docs70/jta/thirdpartytx.html and the
vendor-specific documentation. The following tables show sample JDBC connection
pool and Data Source configurations using the WebLogic jDrivers.
The following table shows a sample connection pool configuration using the
WebLogic jDriver for Oracle.
Note: The following configuration examples use a Password attribute. The Password
attribute value overrides any password defined in Properties (as a name/value
pair). This attribute is passed to the 2-tier JDBC driver when creating physical
database connections. The value is stored in an encrypted form in the
config.xml file and can be used to avoid storing passwords in clear text in
that file.
General Tab
Name myConnectionPool
URL jdbc:weblogic:oracle
Properties user=scott
server=localdb
Connections Tab
Initial Capacity 1
Max Capacity 5
Capacity Increment 1
Shrink Period 15
Testing Tab
Targets Tab
Targets myserver
The following table shows a sample Data Source configuration using the WebLogic
jDriver for Oracle or Microsoft SQL Server.
Configuration Tab
Name myDataSource
Targets Tab
Targets myserver
The following table shows a sample connection pool configuration using the
WebLogic jDriver for Microsoft SQL Server.
Table 8-10 WebLogic jDriver for Microsoft SQL Server: Connection Pool
Configuration
Attribute Name Attribute Value
General Tab
Name myConnectionPool
URL jdbc:weblogic:mssqlserver4
Properties user=sa
db=pubs
server=myHost:1433
appname=MyApplication
hostname=myhostName
Connections Tab
Initial Capacity 1
Max Capacity 5
Capacity Increment 1
Shrink Period 15
Table 8-10 WebLogic jDriver for Microsoft SQL Server: Connection Pool
Configuration
Attribute Name Attribute Value
Testing Tab
Targets Tab
Targets myserver
The following table shows a sample connection pool configuration using the IBM
Informix JDBC Driver.
General Tab
Name myConnectionPool
URL jdbc:informix-sqli:ifxserver:1543
Properties informixserver=ifxserver
user=informix
Connections Tab
Initial Capacity 3
Max Capacity 10
Capacity Increment 1
Shrink Period 15
Targets Tab
Targets myserver
Specify the Driver Classname attribute as the name of the class supporting the
javax.sql.XADataSource interface.
Make sure that the database properties are specified. These properties are passed
to the specified XADataSource as data source properties. For more information
on data source properties for the WebLogic jDriver for Oracle, see “WebLogic
jDriver for Oracle/XA Data Source Properties.” For information about data
source properties for third-party drivers, see the vendor documentation.
The following table shows an example of a JDBC connection pool configuration using
the WebLogic jDriver for Oracle in XA mode.
General Tab
Name fundsXferAppPool
Properties user=scott
server=localdb
Connections Tab
Initial Capacity 1
Max Capacity 5
Capacity Increment 1
Shrink Period 15
Testing Tab
Targets Tab
Targets myserver
The following table shows an example of a Tx Data Source configuration using the
WebLogic jDriver for Oracle in XA mode.
Configuration Tab
Name fundsXferDataSource
Targets Tab
Targets myserver
You can also configure the JDBC connection pool to use a third-party vendor’s driver
in XA mode. In such cases, the data source properties are set via reflection on the
XADataSource instance using the JavaBeans design pattern. In other words, for
property abc, the XADataSource instance must support get and set methods with the
names getAbc and setAbc, respectively.
General Tab
Name jtaXAPool
URL jdbc:oracle:thin:@server:port:sid
Properties user=scott
Connections Tab
Initial Capacity 4
Max Capacity 20
Capacity Increment 2
Shrink Period 15
Testing Tab
Targets Tab
Targets myserver
The following table shows an example of a Tx Data Source configuration using the
Oracle Thin Driver.
Configuration Tab
Name jtaXADS
Targets Tab
Targets myserver
The following table shows an example of a JDBC connection pool configuration for
distributed transactions using the Pointbase JDBC driver.
General Tab
Name demoXAPool
URL jdbc:pointbase:server://localhost/demo
Properties user=public
DatabaseName=jdbc:pointbase:server://l
ocalhost/demo
Connections Tab
Initial Capacity 2
Max Capacity 10
Capacity Increment 2
Shrink Period 15
Testing Tab
Targets Tab
Targets myserver
Configure the Tx Data Source for use with a Pointbase driver as follows.
Configuration Tab
Name jtaXADS
Targets Tab
Targets myserver
The Optional column indicates whether a particular data source property is optional or
not. Properties marked with Y* are mapped to the corresponding fields of the Oracle
xa_open string (value of the openString property) as listed in Table 8-18. If they are
not specified, their default values are taken from the openString property. If they are
specified, their values should match those specified in the openString property. If the
properties do not match, a SQLException is thrown when you attempt to make an XA
connection.
Mandatory properties marked with N* are also mapped to the corresponding fields of
the Oracle xa_open string. Specify these properties when specifying the Oracle
xa_open string. If they are not specified or if they are specified but do not match, an
SQLException is thrown when you attempt to make an XA connection.
Property Names marked with ** are supported but not used by WebLogic Server.
Table 8-18 Data Source Properties for WebLogic jDriver for Oracle/XA
Property Name Type Description JDBC 2.0 Optional Default Value
standard/
extension
Table 8-19 lists the mapping between Oracle’s xa_open string fields and data source
properties.
Table 8-19 Mapping of xa_open String Names to JDBC Data Source Properties
Oracle xa_open String Field JDBC 2.0 Data Source Property Optional
Name
sqlnet ServerName
For a complete description of Oracle’s xa_open string fields, see your Oracle
documentation.
In many cases, WebLogic Server automatically sets the proper value for these
properties internally so that you do not have to set them manually.
KeepXAConnTillTxComplete
Some DBMSs require that you start and end a transaction in the same physical
database connection. In some cases, a transaction in WebLogic Server may start in one
physical database connection and end in another physical database connection. To
force a connection pool to reserve a physical connection and provide the same
connection to an application throughout transaction processing until the transaction is
complete, you set KeepXAConnTillTxComplete="true". For example:
<JDBCConnectionPool KeepXAConnTillTxComplete="true"
DriverName="com.sybase.jdbc2.jdbc.SybXADataSource"
CapacityIncrement="5" InitialCapacity="10" MaxCapacity="25"
Name="demoXAPool" Password="{3DES}vIF8diu4H0QmdfOipd4dWA=="
Properties="User=dbuser;DatabaseName=dbname;ServerName=server_nam
e_or_IP_address;PortNumber=serverPortNumber;NetworkProtocol=Tds;r
esourceManagerName=Lrm_name_in_xa_config;resourceManagerType=2" />
Note: This property is required to support distributed transactions with DB2 and
Sybase.
When the Emulate Two-Phase Commit for non-XA Driver option is selected
(EnableTwoPhaseCommit is set to true), the non-XA JDBC resource always returns
XA_OK during the XAResource.prepare() method call. The resource attempts to
commit or roll back its local transaction in response to subsequent
XAResource.commit() or XAResource.rollback() calls. If the resource commit
or rollback fails, a heuristic error results. Application data may be left in an
inconsistent state as a result of a heuristic failure.
When the Emulate Two-Phase Commit for non-XA Driver option is not selected in the
Console (EnableTwoPhaseCommit is set to false), the non-XA JDBC resource
causes XAResource.prepare() to fail. This mechanism ensures that there is only one
participant in the transaction, as commit() throws a SystemException in this case.
When there is only one resource participating in a transaction, the one phase
optimization bypasses XAResource.prepare(), and the transaction commits
successfully in most instances.
This non-XA JDBC driver support is often referred to as the "JTS driver" because
WebLogic Server uses the WebLogic JTS Driver internally to support the feature. For
more information about the WebLogic JTS Driver, see "Using the WebLogic JTS
Driver" in Programming WebLogic JDBC.
Because of the data integrity risks, the Emulate Two-Phase Commit option should only
be used in applications that can tolerate heuristic conditions.
General Tab
Name fundsXferAppPool
URL jdbc:weblogic:oracle
Properties user=scott
server=localdb
Connections Tab
Initial Capacity 0
Max Capacity 5
Capacity Increment 1
Shrink Period 15
Testing Tab
Targets Tab
Targets myserver
The following table shows configuration attributes for a sample Tx Data Source using
a non-XA JDBC driver.
Configuration Tab
Name fundsXferDataSource
Targets Tab
Targets myserver
Statements are cached per connection, not per connection pool. For example, if you set
the prepared statement cache size to 10, WebLogic Server will store 10 prepared
statements called by applications or EJBs that use that particular connection.
With the release of WebLogic Server 7.0 Service Pack 3, the prepared statement cache
feature was changed so that the cache behaves differently for connection pools that use
an XA (transaction aware) JDBC driver to create database connections instead of a
non-XA JDBC driver. You must set the appropriate cache size attribute depending on
the type of JDBC driver used to create database connections in the JDBC connection
pool: PreparedStatementCacheSize for connection pools that use a non-XA JDBC
driver and XAPreparedStatementCacheSize for connection pools that use an XA
JDBC driver. See “Non-XA Prepared Statement Cache” below and “XA Prepared
Statement Cache” on page 8-41 for more details.
Note: You can use the JMX API to clear the statement cache. See the
clearStatementCache() method in the Javadocs for WebLogic Classes at
http://e-docs.bea.com/wls/docs70/javadocs/weblogic/jdbc/ext
ensions/WLConnection.html.
This statement cache is used only for connection pools that use a non-XA JDBC driver
to create database connections. If the connection pool uses an XA JDBC driver for
database connections, the cache settings are ignored.
The default value for the non-XA prepared statement cache size is 5. You can use the
following methods to set the prepared statement cache size for a connection pool:
Use the Administration Console to set the Prepared Statement Cache Size
attribute for a connection pool. See Creating and Configuring a JDBC
Connection Pool in the Administration Console Online Help at
http://e-docs.bea.com/wls/docs70/ConsoleHelp/jdbc.html#jdbc_con
n_pool_create.
http://e-docs.bea.com/wls/docs70/javadocs/weblogic/management/c
onfiguration/JDBCConnectionPoolMBean.html.
Set the attribute directly in the configuration file (when Weblogic Server is not
running).
To set the non-XA prepared statement cache size for a connection pool using the
configuration file, before starting the server, open the config.xml file in an editor,
then add an entry for the PreparedStatementCacheSize attribute in the
JDBCConnectionPool tag. For example:
<JDBCConnectionPool CapacityIncrement="5"
DriverName="com.pointbase.jdbc.jdbcUniversalDriver"
InitialCapacity="5" MaxCapacity="20" Name="demoPool"
Password="{3DES}ANfMduXgaaGMeS8+CR1xoA=="
PreparedStatementCacheSize="20" Properties="user=examples"
RefreshMinutes="0" ShrinkPeriodMinutes="15"
ShrinkingEnabled="true" Targets="examplesServer"
TestConnectionsOnRelease="false"
TestConnectionsOnReserve="false"
URL="jdbc:pointbase:server://localhost/demo"/>
Note: You can use the JMX API to clear the statement cache. See the
clearStatementCache() method in the Javadocs for WebLogic Classes at
http://e-docs.bea.com/wls/docs70/javadocs/weblogic/jdbc/ext
ensions/WLConnection.html.
The XA prepared statement cache is used only for connection pools that use an XA
JDBC driver to create database connections. If the connection pool uses a non-XA
JDBC driver for database connections, the cache settings are ignored.
The default value for the XA prepared statement cache size is 5. You can use the
following methods to set the XA prepared statement cache size for a connection pool:
Use the Administration Console to set the XA Prepared Statement Cache Size
attribute for a connection pool. See Creating and Configuring a JDBC
Connection Pool in the Administration Console Online Help at
http://e-docs.bea.com/wls/docs70/ConsoleHelp/jdbc.html#jdbc_con
n_pool_create.
Set the attribute directly in the configuration file (when Weblogic Server is not
running).
To set the XA prepared statement cache size for a connection pool using the
configuration file, before starting the server, open the config.xml file in an editor,
then add an entry for the PreparedStatementCacheSize attribute in the
JDBCConnectionPool tag. For example:
<JDBCConnectionPool CapacityIncrement="5"
DriverName="com.pointbase.xa.xaDataSource"
InitialCapacity="5" MaxCapacity="20" Name="demoXAPool"
Password="{3DES}ANfMduXgaaGMeS8+CR1xoA=="
XAPreparedStatementCacheSize="20"
Properties="user=examples;
DatabaseName=jdbc:pointbase:server://localhost/demo"
RefreshMinutes="0" ShrinkPeriodMinutes="15"
ShrinkingEnabled="true" Targets="examplesServer"
TestConnectionsOnRelease="false"
TestConnectionsOnReserve="false"
URL="jdbc:pointbase:server://localhost/demo"/>
There may be other issues related to caching prepared statements that are not listed
here. If you see errors in your system related to prepared statements, you should set the
prepared statement cache size to 0, which turns off prepared statement caching, to test
if the problem is caused by caching prepared statements.
Likewise, prepared statements are bound to the data type for each column in a table in
the database at the time the prepared statement is cached. If you add, delete, or
rearrange columns in a table, prepared statements stored in the cache are likely to fail
when run again.
.
.
.
if (sal == null)
setNull(2,int)//This is incorrect
else
setLong(2,sal)
This issue occurs consistently when using the WebLogic jDriver for Oracle. It may
occur when using other JDBC drivers.
Note: Consider the usage restrictions for the prepared statement cache before you
decide to use it in your production environment. See “Usage Restrictions for
the Prepared Statement Cache” on page 8-43 for more information.
Even if the startup class fails, WebLogic Server loads and caches the statements for
future use.
Note that each connection has it’s own cache of statements. If you use a startup class
to cache statements, you must create the class in such a way that it gets each connection
from the pool and calls the prepared statements that you want to cache on each
statement.
If you enable the connection pool to grow as demand for connections increases, new
connections will cache statements as the statements are used. The startup class cannot
load the prepared statement cache for new connections. If you enable the connection
pool to shrink, the connection pool will close connections after the shrink period has
been met and connections are available. There is now way to specify which
connections to close first. Therefore, the connections for which you loaded the
prepared statement cache may close before non-loaded connections close.
Also note that when starting a server, EJBs are deployed before startup classes are run.
Prepared statements in CMP entity beans and prepared statements that EJBs use during
deployment will be stored in the cache before prepared statements in a startup class.
To work around this, you can clear the prepared statement cache for your connection
pool after all EJBs and applications are deployed, and then run cache-priming code.
See the Javadoc for the clearStatementCache method in the
weblogic.jdbc.extensions package at
http://e-docs.bea.com/wls/docs70/javadocs/weblogic/jdbc/extension
s/WLConnection.html.
Because the XA prepared statement cache uses a Least Recently Used algorithm to
replace statements in the cache, preloading the cache with a startup class will not be
effective.
9 Managing JMS
The following sections explain how to manage the Java Message Service (JMS) for
WebLogic Server:
Configuring JMS
Using the Administration Console, you define configuration attributes to:
Enable any desired JMS features, such as server clustering, concurrent message
processing, destination sort ordering, persistent messaging, paging, flow control,
and load balancing for distributed destinations.
WebLogic JMS provides default values for some configuration attributes; you must
provide values for all others. If you specify an invalid value for any configuration
attribute, or if you fail to specify a value for an attribute for which a default does not
exist, WebLogic Server will not boot JMS when you restart it. A sample
examplesJMSServer configuration is provided with the product in the Examples
Server. For more information about starting the Examples Server, see “Starting the
Default, Examples, and Pet Store Servers” in the Installation Guide. There are also
instructions for manually configuring a basic JMS implementation in “Starting
WebLogic Server and Configuring JMS” on page 9-5.
When you port WebLogic JMS applications from a previous release of Weblogic
Server, the configuration information is automatically converted, as described in
“Porting WebLogic JMS Applications” in Programming WebLogic JMS.
Once WebLogic JMS is configured, applications can send and receive messages using
the JMS API. For more information about developing WebLogic JMS applications,
refer to “Developing a WebLogic JMS Application” in Programming WebLogic JMS.
For more information on how JMS clustering works, refer to “Configuring WebLogic
JMS Clustering” in Programming WebLogic JMS
An exception to this unique naming rule within a domain, however, is for JMS queue
and topic destinations on different JMS servers in a domain, as follows:
Queue destinations can use the same name as other queues on different JMS
servers; topic destinations can also use the same name as other topics on
different JMS servers.
Queue destinations cannot use the same name as topic destinations, nor can
queues nor topics use the same name as any other configurable objects.
For example, you cannot create a WebLogic Server instance named myserver in a
version 7.0 domain named mydomain70 if there is already a server instance named
myserver in a version 6.1 domain named mydomain61. Similarly, on the JMS
subsystem level, you cannot have two JMS servers or stores with the same name, even
when they reside in separate domains.
Therefore, you must adhere to the following rules when interoperating between
WebLogic domains:
All WebLogic Server instance names must be unique within a domain and across
all interoperating domains.
All JMS server names must be unique within a domain and across all
interoperating domains.
If a JMS store (file or JDBC) is being used for persistent messages, all store
names must be unique within a domain and across all interoperating domains.
For complete information about starting the Administration Server, see “Starting an
Administration Server” on page 2-12.
For complete details about using the Administration Console to configure a WebLogic
Server, see “Starting and Using the Administration Console” on page 1-22.
1. Under the Services node in the left pane, click the JMS node to expand the list.
2. For storing persistent messages in a disk-based file, you must create a JMS file
store. If your are using the JMS Paging feature, you must also configure an
additional “paging” JMS file store for temporarily swapping message bodies out
to disk when memory is exhausted.
a. Create a directory on the file system where the JMS file store will be kept.
b. Click the Stores node in the left pane, and then click the Configure a new JMS
File Store link in the right pane.
c. On the General tab, give the store a name, specify a directory, and optionally,
select a Synchronous Write policy to determine how the file store writes data to
disk. Then click Create.
b. Click the Connection Pools node in the left pane, and then click the Configure
a new JDBC Connection Pool link in the right pane.
c. On the Configuration tabs, set the attributes for the connection pool, such as
Name, URL, and database Properties. Click Apply on each tab when you’re
done making changes.
e. Return to the JMS –> Stores node, and then click the Configure a new
JMSJDBCStore link in the right pane.
f. Give the JDBC Store a name, select a connection pool, and a prefix name. Then
click Create.
For more information on using JMS JDBC stores, see “About JMS JDBC
Stores” on page 9-16. For more information on configuring JDBC connection
pools, see “Configuring and Managing JDBC Connection Pools, MultiPools, and
DataSources Using the Administration Console” on page 8-10.
a. Click the Templates node in the left pane, and then click the Configure a new
JMS Template link in the right pane.
b. On the General tab, give the template a name, and then click Create.
c. Fill in the Thresholds & Quotas, Override, and Redelivery tabs, as appropriate.
Click Apply on each tab when you’re done making changes.
For more information on configuring a JMS Template, see “Configuring JMS
Templates” on page 9-13.
a. Click the Server node in the left pane, and then click the Configure a new
JMSServer link in the right pane.
b. On the General tab, give the server a name, select a Store if you created one,
select a Paging Store if you created one, and select a Template if you created
one. Then click Create.
c. Fill in the Thresholds & Quotas tab, as appropriate. Click Apply when you’re
done making changes.
a. Under the Servers node in the left pane, click your new JMS server instance to
expand the list, and then click the Destinations node.
b. Click either the Configure a new JMSQueue or Configure a new JMSTopic link
in the right pane.
c. On the General tab, give the destination a name and a JNDI name. Fill in the
other attributes, as appropriate, and then click Create.
d. Fill in the Thresholds & Quotas, Override, Redelivery, and Multicast (topics
only) tabs, as appropriate. Click Apply on each tab when you’re done making
changes.
For more information on configuring a Destinations, see “Configuring
Destinations” on page 9-12.
a. Click to the expand the Connection Factory node and in the left pane, and then
click the Configure a new JMS Connection Factory link in the right pane.
b. On the General tab, give the connection factory a name and a JNDI name. Fill
in the other attributes, as appropriate, and then click Create.
c. Fill in the Transactions and Flow Control tabs, as appropriate. Click Apply on
each tab when you’re done making changes.
8. Optionally, use the Destination Keys node to define the sort order for a specific
destination. For more information, see “Configuring Destination Keys” on page
9-14.
10. Optionally, create JMS Session Pools, which enable your applications to process
messages concurrently, and Connection Consumers (queues or topics) that
retrieve server sessions and process messages. For more information, see
“Configuring Session Pools” on page 9-19 and “Configuring Connection
Consumers” on page 9-20.
Thresholds and quotas for messages and bytes (maximum number, and high and
low thresholds), and whether or not bytes paging and/or messages paging is
enabled.
For instructions on creating and configuring a JMS server, see “JMS Server Tasks” in
the Administration Console Online Help.
You can establish cluster-wide, transparent access to destinations from any server in a
cluster either by enabling the default connection factory for each server instance, or by
configuring one or more connection factories and targeting them to one or more server
instances in the cluster. This way, each connection factory can be deployed on multiple
WebLogic Servers. For more information on configuring JMS clustering, see
“Managing JMS” in Programming WebLogic JMS.
Note: Using the default connection factory, you have no control over the WebLogic
Server on which the connection factory may be deployed. If you would like to
target a particular server, create a new connection factory and specify the
appropriate server target(s).
Configuring Destinations
A destination identifies a queue (Point-To-Point) or a topic (Pub/Sub) for a JMS server.
After defining a JMS server, configure one or more destination for each JMS server.
Note: You can also configure multiple physical destinations as members of a single
distributed destination set within a cluster. Therefore, if one instance within
the cluster fails, then other instances of the same destination will be able to
provide service to JMS producers and consumers. For more information, see
“Configuring Distributed Destinations” on page 9-44.
Thresholds and quotas for messages and bytes (maximum number, and high and
low thresholds), and whether or not bytes paging and/or messages paging is
enabled on the destination.
You do not need to re-enter every attribute setting each time you define a new
destination; you can use the JMS template and override any setting to which you
want to assign a new value.
You can modify shared attribute settings dynamically simply by modifying the
template.
To define the JMS template configuration attributes for destinations, use the Templates
node in the Administration Console. The configurable attributes for a JMS template are
the same as those configured for a destination. These configuration attributes are
inherited by the destinations that use them, with the following exceptions:
If the destination that is using a JMS template specifies an override value for an
attribute, the override value is used.
The Name attribute is not inherited by the destination. This name is valid for the
JMS template only. You must explicitly define a unique name for all
destinations.
Note: JMS templates must be uniquely named within a domain. For more
information, see “JMS Resource Naming Rules for Domain
Interoperability” on page 9-3.
The JNDI Name, Enable Store, and Template attributes are not defined for JMS
templates.
The Multicast attributes are not defined for JMS templates because they apply
only to topics.
Any attributes that are not explicitly defined for a destination are assigned default
values. If no default value exists, be sure to specify a value within the JMS template or
as a destination attribute override. If you do not do so, the configuration information
remains incomplete, the WebLogic JMS configuration fails, and the WebLogic JMS
does not boot.
For instructions on creating and configuring a JMS template, see “JMS Template
Tasks” in the Administration Console Online Help.
To create a destination key, use the Destination Keys node in the Administration
Console and define the following configuration attributes:
For instructions on creating and configuring a destination key, see “Destination Key
Tasks” in the Administration Console Online Help.
Configuring Stores
A persistent store consists of a file or database that is used for persistent messaging. To
create a file or database store, use the Stores node in the Administration Console and
define the following configuration attributes:
For a JMS file store—provide the path to the location where the messages will
be saved, and optionally select a disk write policy as explained in “Configuring a
Synchronous Write Policy for JMS File Stores” on page 9-24.
For a JMS JDBC database store—provide the JDBC connection pool and
database table name prefix for use with multiple instances, as explained in
“About JMS JDBC Store Table Prefixes” on page 9-18.
Note: JMS stores must be uniquely named within a domain. For more
information, see “JMS Resource Naming Rules for Domain
Interoperability” on page 9-3.
Warning: You cannot configure a transaction (XA) connection pool to be used with
a JDBC database store. For more information, see “JMS JDBC
Transactions” on page 9-16.
JMS persistent stores can increase the amount of memory required during initialization
of a WebLogic Server instance as the number of stored messages increases. If
initialization fails due to insufficient memory while rebooting WebLogic Server,
increase the heap size of the Java Virtual Machine (JVM) proportionally to the number
of messages that are currently stored in the JMS persistent store. Then, try rebooting
the server again. For more information on setting heap sizes, see “Tuning WebLogic
Server Applications” in the WebLogic Performance and Tuning Guide.
For instructions on creating and configuring a store, see “JMS File Store Tasks” and
“JMS JDBC Store Tasks” for information about file and JDBC database stores,
respectively, in the Administration Console Online Help.
Pointbase
Oracle
Sybase
Cloudscape
Informix
IBM DB2
Times Ten
The weblogic/jms/ddl directory within the weblogic.jar file contains JMS DDL
files for these databases, which are actually text files containing the SQL commands
that create the JMS database tables. To use a different database, simply copy and edit
any one of these .ddl files.
Note: The JMS samples provided with your WebLogic Server distribution are set up
to work with the Pointbase Java database. An evaluation version of Pointbase
is included with WebLogic Server and a demoPool database is provided.
If your existing JMS JDBC stores somehow become corrupted, you can regenerate
them using the utils.Schema utility. For more information see, “JDBC Database
Utility” in Programming WebLogic JMS.
This is because WebLogic JMS is its own resource manager. That is, JMS itself
implements the XAResource and handles the transactions without depending on the
database (even when the messages are stored in the database). This means that
whenever you are using JMS and a database (even if it is the same database where the
JMS messages are stored), then it is two-phase commit transaction. For more
information about using transactions with WebLogic JMS, see “Using Transactions
with WebLogic JMS” in Programming WebLogic JMS.
From a performance perspective, you may boost your performance if the JDBC
connection pool used for the database work exists on the same WebLogic Server as the
JMS queue—the transaction will still be two-phase, but it will be handled with less
network overhead. Another performance boost might be achieved by using JMS file
stores rather than JMS JDBC stores.
For cases where the JMSStore and JMSState tables already exist, then these tables
must be dropped and recreated to use a modified DDL file.
1. Use the JAR utility supplied with the JDK to extract the JMS Store DDL files to
the weblogic/jms/ddl directory, using the following command:
a. Locate the CREATE TABLE JMSSTORE entry, and then add PRIMARY KEY NOT
NULL, as follows:
CREATE TABLE JMSStore (recordHandle int PRIMARY KEY NOT NULL,
recordState int, record LONG RAW);
The prefix name uniquely identifies JMS tables in the persistent store. Specifying
unique prefixes allows multiple stores to exist in the same database. You configure the
prefix via the Administration Console when configuring a JMS JDBC store. A prefix
is prepended to table names when the DBMS requires fully qualified names, or when
you must differentiate between JMS tables for two WebLogic Servers, enabling
multiple tables to be stored on a single DBMS.
Warning: No two JMS JDBC stores should be allowed to use the same database
tables, as this will result in data corruption.
Specify the prefix using the following format, which will result in a valid table name
when prepended to the JMS table name:
[[[catalog.]schema.]prefix]JMSStore
where catalog identifies the set of system tables being referenced by the DBMS and
schema translates to the ID of the table owner. For example, in a production database
the JMS administrator could maintain a unique table for the Sales department, as
follows:
[[[Production.]JMSAdmin.]Sales]JMSStore
The resulting table will be created in the Production catalog, under the JMSAdmin
schema, and will be named SalesJMSStore.
Note: For some DBMS vendors, such as Oracle, there is no catalog to set or choose,
so this format simplifies to [[schema.]prefix]. For more information, refer
to your DBMS documentation for instructions on how to write and use a
fully-qualified table name.
For more information about JDBC default Test Table Names, see "Connection Testing
Options" in see “JDBC Connection Pool -> Configuration -> Testing” in the
Administration Console Online Help.
Use the Session Pools node in the Administration Console and define the following
configuration attributes:
Name of the server session pool. Session pools must be uniquely named within a
domain. For more information, see “JMS Resource Naming Rules for Domain
Interoperability” on page 9-3.
Connection factory with which the server session pool is associated and is used
to create sessions.
Transaction attributes (acknowledge mode and whether or not the session pool
creates transacted sessions).
For instructions on creating and configuring a session pool, see “Session Pool Tasks”
in the Administration Console Online Help.
Some session pool attributes are dynamically configurable, but the new values do not
take effect until the session pools are restarted.
To configure connection consumers, use the Session Pools node in the Administration
Console to define the following configuration attributes:
JMS selector expression used to filter messages. For information about defining
selectors, see Developing a WebLogic JMS Application” in Programming
WebLogic JMS.
To create and configure a connection consumer, and for detailed information about
each of the connection consumer configuration attributes, see “Connection Consumer”
in the Administration Console Online Help.
Monitoring JMS
Using the Administration Console, you can monitor statistics for the following JMS
objects: JMS servers, connections, sessions, destinations, message producers, message
consumers, server session pools, and durable subscribers.
JMS statistics continue to increment as long as the server is running. Statistics are reset
only when the server is rebooted.
2. Select the JMS node under Services, in the left pane, to expand the list of JMS
servers.
4. Select the JMS server that you want to monitor from the list or, from the JMS
servers displayed in the right pane.
6. Click the appropriate text link to view monitoring data for that JMS object.
Note: When monitoring distributed destinations, you may see proxy topic members
or system subscriptions for the topic or queue members. For more information
see, “Monitoring Distributed Destination System Subscriptions and Proxy
Topic Members” on page 9-22.
2. Select the Destinations node under Servers in the left pane, to expand the list of
JMS topic and queue destinations.
The JMS destination information is displayed in a table format in the right pane,
with the Durable Subscriber Runtimes column listing the number of durable
subscribers running (if any) for the destination topics listed in the table.
3. To view durable subscriber information for a specific topic, click the icon (or
actual number) in the Durable Subscriber Runtimes column for the desired topic.
The following points describe the behavior of system subscriptions and proxy topic
members:
local distributed topic member for a remote distributed topic, may automatically
create and host a local proxy topic member for the remote distributed topic. This
occurs when the first non-durable subscription for the distributed topic is created
on the server's connection factory. The dynamically-created proxy topic member
resides within a dynamically-created JMS server. Each of the
manually-configured distributed topic members will create a system subscription
for each dynamically-created proxy topic member. The non-durable consumers
are then created on the proxy topic member.
Tuning JMS
The following sections explain how to get the most out of your applications by
implementing the administrative performance tuning features available with
WebLogic JMS.
Persistent Stores
Persistent Stores
The following sections describe the tuning options available when using persistent
stores with WebLogic Server JMS.
Note: The Synchronous Write Policy is ignored if the file store is used exclusively
for paging non-persistent messages to disk.
Table 9-1 explains the options available when configuring a Synchronous Write Policy
for all JMS file stores running on WebLogic Server.
Disabled File store writes are allowed to use both the operating
system’s cache as well as the file system’s on-disk
cache. This policy is the fastest but the least reliable.
It can be more than 100 times faster than the other
policies, but power outages or operating system
failures can cause lost and/or duplicate messages.
Warning: Unlike Sun Solaris, use of the Direct-Write policy on Windows may leave
transaction data in the on-disk cache without writing it to disk
immediately. This is not transactionally safe, as a power failure can cause
loss of on-disk cache data, resulting in lost and/or duplicate messages. For
reliable writes using Direct-Write on Windows, either disable all write
caching for the disk (enabled by default), or use a disk with a battery
backed cache.
drive name -> Disk Properties tab -> clear the Write Caching Enabled
check box. Some file systems, however, do not allow this value to be
changed (for example, a RAID system that has a reliable cache).
Off ** * * High
Cache-Flush On * ** ***
Off * ** ***
Direct-Write On * ** ***
Off * * *
JMS message paging saves memory for both persistent and non-persistent messages,
as even persistent messages cache their data in memory. Paged persistent messages
continue to be written to the regular backing store (file or database); and paged
non-persistent messages are written to the JMS server’s message paging store, which
is configured separately.
A paged-out message does not free all of the memory that it consumes. The message
header and message properties remain in memory for use with searching, sorting, and
filtering.
Note: Messages sent in a transacted session are only eligible for paging after the
session is committed. Prior to that, the message will only be held in memory;
therefore, the heap size of the Java Virtual Machine (JVM) should be
appropriately tuned to accommodate the projected peak amount of client load
from all active sessions until they are committed. For more information on
tuning your heap size, see “Tuning Java Virtual Machines (JVMs)” in
WebLogic Performance and Tuning.
Configuring Paging
Unless paging is configured and enabled, all messages (even persistent ones) are held
in memory. You can configure paging for a new or existing JMS server and/or its
destinations through the Administration Console. Using the attributes on the JMS
Server node you can specify a paging store for a JMS server, enable bytes and/or
messages paging, and configure bytes/messages high and low thresholds to start and
stop paging.
Similarly, using the attributes on the Destinations node, you can configure
bytes/messages paging for all topics and queues configured on a JMS server. The
destinations use the paging store that is configured for the JMS server.
Also, if you use JMS templates to configure multiple destinations, you can use the
attributes on the Templates node to configure paging quickly on all your destinations.
To override a template’s paging configuration for specific destinations, you can enable
or disable paging on any destination.
For instructions on configuring a new JMS server, templates, and destinations (Topics
or Queues), see “JMS Server,” “JMS Destination,” and “JMS Template” in the
Administration Console Online Help.
Note: For performance tuning purposes, you can modify the paging thresholds to any
legal value at any time. Once paging is enabled, however, you cannot
dynamically disable it by resetting a byte or message threshold back to -1. To
prevent paging from occurring, set the byte/message high threshold to a very
large number (maximum is 263 -1), so that paging is not triggered.
2. Click the JMS Store node. The right pane shows all the JMS stores.
3. Click the Create a new JMS File Store text link. The right pane shows the tabs
associated with configuring a new file store.
5. Click Create to create a file store instance with the name you specified in the
Name field. The new instance is added under the JMS Stores node in the left
pane.
6. If you have multiple JMS servers in your domain, repeat steps 3-5 for each server
instance.
1. Click the JMS Servers node. The right pane shows all the servers defined in your
domain.
2. Click the server that you want to configure for paging. The right pane shows the
tabs associated with configuring the server.
3. On the General tab, use the Paging Store list box to select the store that you
configured to store the paged messages. Click Apply to save your changes.
For instructions on configuring a paging store, refer to “Configuring a Paging
Store for a JMS Server” on page 9-28.
z In the Messages Threshold Low field, enter an amount that will stop
messages paging once the number of messages on the JMS server falls below
this threshold.
6. Click Apply to save the new bytes and/or messages paging values.
7. Repeat steps 2–6 to configure paging for additional JMS servers in the domain.
Note: Each JMS server must have its own paging store.
8. After you configure your JMS server (or servers) for paging, do one of the
following:
z If you are not configuring a JMS server’s destinations for paging, reboot
WebLogic Server to activate paging.
z If you want to configure a server’s destinations for paging, follow refer to
either “Configuring Paging on a JMS Template” on page 9-30 or
“Configuring Paging on Destinations” on page 9-31.
2. Click the JMS Templates node. The right pane shows all the templates defined in
the domain.
3. Click the template that you want to configure for paging. The right pane shows
the tabs associated with configuring the template.
6. Click Apply to save the new bytes and/or messages paging values.
8. After configuring all of your JMS templates for paging, reboot WebLogic Server
to activate paging.
1. Under JMS Servers, expand a server instance that is already configured for paging.
2. Click the Destinations node. The right pane shows all of the server's topics and
queues.
3. Click the topic or queue that you want to configure for paging. The right pane
shows the tabs associated with configuring the topic or queue.
z In the Messages Threshold High field, enter an amount that will start
messages paging when the number of messages on the JMS server exceeds
this threshold.
z In the Messages Threshold Low field, enter an amount that will stop
messages paging once the number of messages on the JMS server falls below
this threshold.
6. Click Apply to save the new bytes and/or messages paging values.
8. After you configure all your destinations for paging, reboot WebLogic Server to
activate paging.
1. Under JMS Servers, expand a server instance that is already configured for paging.
2. Click the Destinations node. The right pane shows all of the server's topics and
queues.
3. Click the topic or queue that you want to configure for paging. The right pane
shows the topics or queues associated with the server instance.
4. On the Thresholds & Quotas tab, configure the Bytes Paging Enabled and/or
Messages Paging Enabled attributes on the destination according to how you
want to override the JMS template for the destination.
z To disable paging for the destination, select False in the Bytes Paging
Enabled and/or the Messages Paging Enabled list boxes.
z To enable paging for the destination, select True in the Bytes Paging Enabled
and/or the Messages Paging Enabled list boxes.
5. Click Apply to save the new bytes and/or messages paging values.
6. Repeat steps 2–5 to configure paging for additional JMS destinations on the same
server instance.
7. Once all of your destinations are configured for paging, then reboot WebLogic
Server to activate paging.
Bytes Paging Enabled If the Bytes Paging Enabled check box is not
selected (False), then server bytes paging is
explicitly disabled.
If the Bytes Paging Enabled check box is
selected (True), a paging store has been
configured, and both the Bytes Threshold Low
and Bytes Threshold High attributes are greater
than -1, then server bytes paging is enabled.
If either the Bytes Threshold Low or Bytes
Threshold High attribute is undefined, or defined
as -1, then server bytes paging is implicitly
disabled—even though the Bytes Paging
Enabled check box is selected (True).
Messages Paging Enabled If the Messages Paging Enabled check box is not
selected (False), then server messages paging is
explicitly disabled.
If the Messages Paging Enabled check box is
selected (True), a paging store has been
configured, and both the Messages Threshold
Low and Messages Threshold High attributes are
greater than -1, then server messages paging is
enabled.
If either the Messages Threshold Low or
Messages Threshold High attribute is undefined,
or defined as -1, then server paging is implicitly
disabled—even though the Messages Paging
Enabled check box is selected (True).
Bytes Paging Enabled If the Bytes Paging Enabled check box is not
selected (False), then destination-level bytes
paging is disabled for the JMS template’s
destinations—unless the destination setting
overrides the template.
If the Bytes Paging Enabled check box is
selected (True), a paging store has been
configured for the JMS Server, and both the
Bytes Threshold Low and Bytes Threshold High
attributes are greater than -1, then
destination-level bytes paging is enabled for the
JMS template’s destinations—unless the
destination setting overrides the template.
If no value is defined in the JMS Template
MBean, then the value defaults to False and
bytes paging is disabled for the JMS template’s
destinations.
Messages Paging Enabled If the Messages Paging Enabled check box is not
selected (False), then destination-level messages
paging is disabled for the template’s
destination—unless the destination setting
overrides the template.
If the Messages Paging Enabled check box is
selected (True), a paging store has been
configured for the JMS Server, and both the
Messages Threshold Low and Messages
Threshold High attributes are greater than -1,
then destination-level messages paging is
enabled for this destination—unless the
destination setting overrides the template.
If no value is defined in the JMS Template
MBean, then the value defaults to False and
messages paging is disabled for the template’s
destinations.
Note: If server paging is enabled, and destination-level paging is disabled for a given
destination, than messages on the destination can still be paged if server
paging is triggered. However, when destination-level paging is disabled for a
given destination, then the destination’s high thresholds will not force the
destination to page out messages when they are exceeded.
Bytes Threshold High Start paging when the number of bytes exceeds this
threshold.
Bytes Threshold Low Stop paging when the number of bytes falls back
below this threshold.
Messages Threshold High Start paging when the number of messages exceeds
this threshold.
Messages Threshold Low Stop paging when the number of messages falls back
below this threshold.
The thresholds are defined for servers, templates, and destinations as follows:
If either bytes high/low threshold value is not defined (or is defined as -1), then
the number of bytes is not used to determine when and what to page.
If either messages high/low threshold value is not defined (or is defined as -1),
then the number of messages is not used to determine when and what to page.
Producers limit their production rate based on a set of flow control attributes
configured for producers via the JMS connection factory. Starting at a specified flow
maximum number of messages, a producer evaluates whether the server/destination is
still armed at prescribed intervals (for example, every 10 seconds for 60 seconds). If at
each interval, the server/destination is still armed, then the producer continues to move
its rate down to its prescribed flow minimum amount.
As producers slow themselves down, the threshold condition gradually corrects itself
until the server/destination is unarmed. At this point, a producer is allowed to increase
its production rate, but not necessarily to the maximum possible rate. In fact, its
message flow continues to be controlled (even though the server/destination is no
longer armed) until it reaches its prescribed flow maximum, at which point it is no
longer flow controlled.
These attributes allow the producer to adjust its message flow. Specifically, the
producer receives attributes that limit its flow within a minimum and maximum range.
As conditions worsen, the producer moves toward the minimum; as conditions
improve; the producer moves toward the maximum. Movement toward the minimum
and maximum are defined by two additional attributes that specify the rate of
movement toward the minimum and maximum. Also, the need for movement toward
the minimum and maximum is evaluated at a configured interval.
2. Click the Connection Factories node. The JMS Connection Factories table
displays in the right pane showing all the connection factories defined in your
domain.
3. Click the connection factory you want to establish message flow control for. A
dialog displays in the right pane showing the tabs associated with modifying a
connection factory.
4. On the Flow Control tab, define the attributes as described in following table:
Flow Control Enabled Determines whether a producer can be flow controlled by the
JMS server.
Flow Maximum The maximum number of messages per second for a producer
that is experiencing a threshold condition.
If a producer is not currently limiting its flow when a threshold
condition is reached, the initial flow limit for that producer is
set to Flow Maximum. If a producer is already limiting its flow
when a threshold condition is reached (the flow limit is less
than Flow Maximum), then the producer will continue at its
current flow limit until the next time the flow is evaluated.
Once a threshold condition has subsided, the producer is not
permitted to ignore its flow limit. If its flow limit is less than
the Flow Maximum, then the producer must gradually increase
its flow to the Flow Maximum each time the flow is evaluated.
When the producer finally reaches the Flow Maximum, it can
then ignore its flow limit and send without limiting its flow.
Flow Minimum The minimum number of messages per second for a producer
that is experiencing a threshold condition. This is the lower
boundary of a producer’s flow limit. That is, WebLogic JMS
will not further slow down a producer whose message flow
limit is at its Flow Minimum.
Flow Steps The number of steps used when a producer is adjusting its flow
from the Flow Minimum amount of messages to the Flow
Maximum amount, or vice versa. Specifically, the Flow
Interval adjustment period is divided into the number of Flow
Steps (for example, 60 seconds divided by 6 steps is 10 seconds
per step).
Also, the movement (that is, the rate of adjustment) is
calculated by dividing the difference between the Flow
Maximum and the Flow Minimum into steps. At each Flow
Step, the flow is adjusted upward or downward, as necessary,
based on the current conditions, as follows:
The downward movement (the decay) is geometric over the
specified period of time (Flow Interval) and according to
the specified number of Flow Steps. (For example, 100, 50,
25, 12.5).
The movement upward is linear. The difference is simply
divided by the number of steps.
For detailed information about other connection factory attributes, and the valid and
default values for them, see “JMS Connection Factory” in the Administration Console
Online Help.
Bytes/Messages Threshold Low When the number of bytes/messages falls below this
threshold, the JMS server/destination becomes unarmed
and instructs producers to begin increasing their
message flow.
Flow control is still in effect for producers that are below
their message flow maximum. Producers can move their
rate upward until they reach their flow maximum, at
which point they are no longer flow controlled.
For detailed information about other JMS server and JMS destination attributes, and
the valid and default values for them, see “JMS Server” and “JMS Destination” in the
Administration Console Online Help.
To ensure a fair distribution of the messaging load among a distributed destination, the
initial physical destination (queue or topic) used by producers is always chosen at
random from among the distributed destination members.
2. Click the Connection Factories node. The JMS Connection Factories table
displays in the right pane showing all the connection factories defined in your
domain.
3. Click the connection factory on which you want to establish message load
balancing. A dialog displays in the right pane showing the tabs associated with
modifying a connection factory.
For more information about how message load balancing takes place among the
members of a distributed destination, see “Load Balancing Messages Across a
Distributed Destination” in Programming WebLogic JMS.
Note: The Server Affinity Enabled attribute does not affect queue browsers.
Therefore, a queue browser created on a distributed queue can be pinned to a
remote distributed queue member even when Server Affinity is enabled.
2. Click the Connection Factories node. The JMS Connection Factories table
displays in the right pane showing all the connection factories defined in your
domain.
3. Click the connection factory on which you want to disable server affinity. A
dialog displays in the right pane showing the tabs associated with modifying a
connection factory.
For more information about how the Server Affinity Enabled setting affects the load
balancing among the members of a distributed destination, see “How Distributed
Destination Load Balancing Is Affected When Using the Server Affinity Enabled
Attribute” in Programming WebLogic JMS.
2. Click the Configure a new Distributed Topic link in the right pane. A
Configuration dialog shows the tabs associated with configuring a new
distributed topic.
3. Define the attributes in the General tab according to the following table.
JNDI Name Enter the name used to bind the distributed topic into the JNDI
namespace. Applications use the JNDI Name to look up the
distributed topic.
A distributed topic that does not have a JNDI Name can be
referenced by passing the Name of the distributed destination
to: javax.jms.TopicSession.createTopic().
Load Balancing Policy Define how producers will distribute their messages across the
members of a distributed topic. The valid values are
Round-Robin and Random as defined in “Configuring
Message Load Balancing for a Distributed Destination” on
page 9-41.
5. On the Thresholds & Quotas tab, define the following attributes for all of the
distributed topic members:
z Thresholds and quotas for messages and bytes (maximum number and
high/low thresholds).
z Whether or not bytes paging and/or messages paging is enabled on the
distributed topic.
For more information about these attributes, see “JMS Distributed Topic ->
Configuration -> Thresholds & Quotas” in the Administration Console Online
Help.
7. On the Auto Deploy tab, indicate the WebLogic Server instances where you want
the distributed topic members to be automatically created.
8. Click the Create members on the selected Servers (and JMS Servers) text link.
An auto deploy dialog prompts you to select one of the following options:
z Select a cluster at which to target the distributed topic, and then click Next.
or
z Accept the None option to bypass this dialog so you can select an individual
server or servers that are part of the cluster. (In this case, skip to Step 10).
a. All WebLogic Server instances that are members of the cluster and that are not
already hosting a distributed topic are listed and are selected by default. To
exclude a server instance from hosting the distributed topic, clear the
corresponding check box.
c. Skip to Step 11 to select the JMS servers that are available on the selected
WebLogic Servers for creating distributed topic members.
10. If you selected None on the Cluster dialog in Step 8, select a single WebLogic
Server instance in the domain:
a. From the list box, select an individual server where you want to create a
distributed topic member.
11. All JMS servers that are deployed on the selected WebLogic Server instances,
and that are not already hosting a distributed topic, are listed and are selected by
default. To exclude a JMS server from hosting the distributed topic member, clear
the corresponding check box.
If there are no existing distributed topic members on the selected JMS servers,
one new JMS Topic will be created on each JMS server and added as a member
of the distributed topic.
14. Click the Configuration --> Members tab to view the topic members that were
automatically created for the new distributed topic.
15. Expand the JMS →Templates node to view the JMS template that was
automatically created with the same name as the distributed topic.
2. Click the Configure a new Distributed Topic link in the right pane. A
Configuration dialog shows the tabs associated with configuring a new
distributed topic.
3. Define the attributes in the General tab according to the following table.
JNDI Name Enter the name used to bind the distributed topic into the JNDI
namespace. Applications use the JNDI Name to look up the
distributed topic.
A distributed topic that does not have a JNDI Name can be
referenced by passing the Name of the distributed destination
to: javax.jms.TopicSession.createTopic().
Load Balancing Policy Define how producers will distribute their messages across the
members of a distributed topic. The valid values are
Round-Robin and Random as defined in “Configuring
Message Load Balancing for a Distributed Destination” on
page 9-41.
5. On the Thresholds & Quotas tab, define the following attributes for all of the
distributed topic members:
z Thresholds and quotas for messages and bytes (maximum number and
high/low thresholds).
z Whether or not bytes paging and/or messages paging is enabled on the
distributed topic.
If a distributed topic member’s underlying physical topic already has a JMS
Template with configured thresholds and quotas, these attributes do not apply to
that topic member. For more information about these attributes, see “JMS
Distributed Topic -> Configuration -> Thresholds & Quotas” in the
Administration Console Online Help.
7. On the Configuration -->Members tab, create distributed topic members for your
existing physical topics.
8. Click the Configure a new Distributed Topic Member link in the right pane. A
Configuration dialog shows the tabs associated with configuring a new
distributed topic member.
9. Define the attributes in the General tab according to the following table.
JMSTopic Select the underlying physical topic that is associated with the
distributed topic member.
10. Click Create to create the new distributed topic member. The new member is
added to the Distributed Topic table.
11. If necessary, repeat steps 8–10 to continue adding topic members to the
distributed topic.
2. Click the Configure a new Distributed Queue link in the right pane. A
Configuration dialog shows the tabs associated with configuring a new
distributed queue.
3. Define the attributes in the General tab according to the following table.
JNDI Name Enter the name used to bind the distributed queue into the JNDI
namespace. Applications use the JNDI Name to look up the
distributed queue.
A distributed queue that does not have a JNDI Name can be
referenced by passing the Name of the distributed destination
to javax.jms.QueueSession.createQueue().
Load Balancing Policy Define how producers will distribute their messages across the
members of a distributed queue. The valid values are
Round-Robin and Random as defined in “Configuring
Message Load Balancing for a Distributed Destination” on
page 9-41.
Forward Delay Define the amount of time, in seconds, that a distributed queue
member with messages, but which has no consumers, will wait
before forwarding its messages to other queue members that do
have consumers.
5. On the Thresholds & Quotas tab, define the following attributes for all of the
distributed queue members:
z Thresholds and quotas for messages and bytes (maximum number and
high/low thresholds).
z Whether or not bytes paging and/or messages paging is enabled on the
distributed queue.
For more information about these attributes, see “JMS Distributed Queue ->
Configuration -> Thresholds & Quotas” in the Administration Console Online
Help.
7. On the Auto Deploy tab, indicate the WebLogic Server instances where you want
the distributed queue members to be automatically created.
8. Click the Create members on the selected Servers (and JMS Servers) text link. A
dialog prompts you to select one of the following options:
z Select a cluster at which to target the distributed queue, and then click Next.
or
z Accept the None option to bypass this dialog so you can select an individual
server that is not in a cluster. (In this case, skip to Step 10).
a. All servers that are members of the cluster, and which are not already hosting a
distributed queue, are listed and are selected by default. To exclude a server
from hosting the distributed queue, clear the corresponding check box.
c. Skip to Step 11 to select the JMS servers that are available on the selected
WebLogic Servers for creating distributed queue members.
10. If you selected None on the Cluster dialog in Step 8, select a single WebLogic
Server instance in the domain:
a. From the list box, select an individual server where you want to create the
distributed queue member.
11. All JMS servers that are deployed on the selected WebLogic Servers, and which
are not already hosting a distributed queue, are listed and are selected by default.
To exclude a JMS server from hosting the distributed queue member, clear the
corresponding check box.
If there are no existing distributed queue members on the selected JMS servers,
one new JMS Queue will be created on each JMS server and added as a member
of the distributed queue.
14. Click the Configuration --> Members tab to view the queue members that were
automatically created for the new distributed queue.
15. Expand the JMS →Templates node to view the JMS template that was
automatically created with the same name as the distributed queue.
2. Click the Configure a new Distributed Queue link in the right pane. A
Configuration dialog shows the tabs associated with configuring a new
distributed queue.
3. Define the attributes in the General tab according to the following table.
JNDI Name Enter the name used to bind the distributed queue into the JNDI
namespace. Applications use the JNDI Name to look up the
distributed queue.
A distributed queue that does not have a JNDI Name can be
referenced by passing the Name of the distributed destination
to javax.jms.QueueSession.createQueue().
Load Balancing Policy Define how producers will distribute their messages across the
members of a distributed queue. The valid values are
Round-Robin and Random as defined in “Configuring
Message Load Balancing for a Distributed Destination” on
page 9-41.
Forward Delay Define the amount of time, in seconds, that a distributed queue
member with messages, but which has no consumers, will wait
before forwarding its messages to other queue members that do
have consumers.
5. On the Thresholds & Quotas tab, define the following attributes for all of the
distributed queue members:
z Thresholds and quotas for messages and bytes (maximum number and
high/low thresholds).
z Whether or not bytes paging and/or messages paging is enabled on the
distributed queue.
If a distributed queue member’s underlying physical queue already has a JMS
Template with configured thresholds and quotas, these attributes will not apply
to that queue member. For more information about these attributes, see “JMS
Distributed Queue -> Configuration -> Thresholds & Quotas” in the
Administration Console Online Help.
7. Click the Configuration --> Members tab to define the queue members for the
distributed queue.
8. Click the Configure a new Distributed Queue Member text link in the right pane.
A Configuration dialog shows the tabs associated with configuring a new
distributed queue member.
9. Define the attributes on the General tab according to the following table.
JMSQueue Select the underlying physical queue that is associated with the
distributed queue member.
10. Click Create to create the new distributed queue member. The new member is
added to the Distributed Queue table.
11. Repeat steps 8–10 to continue adding members to the distributed queue.
2. Click the distributed queue that you want to add a member to. The Distributed
Queue table shows all the distributed queue members that belong to the
distributed queue.
3. Click the Configure a new Distributed Queue Member text link. A dialog shows
the Configuration tab for configuring a new distributed queue member.
5. Click Create to create a distributed queue member with the name you specified in
the Name field. The new member is added to the Distributed Queue Member
table in the right pane.
Note: If you need to delete the entire distributed queue, then follow the directions for
“Deleting a Distributed Destination” on page 9-59.
2. Click the distributed queue that you want to delete a member from. The
Distributed Queue table shows all the distributed queue members that belong to
the distributed queue.
3. Click the Delete icon in the row of the distributed queue member that you want to
delete. A dialog prompts you to confirm your deletion request.
4. If you want to also remove the underlying physical queue, select the Also Delete
check box.
5. Click Remove to delete the distributed queue member (and the underlying
physical queue if selected).
6. The Distributed Queue table redisplays in the right pane. The distributed queue
member is deleted from the Distributed Queue table.
2. Click the distributed topic that you want to add a member to. The Distributed
Topic table shows all the distributed topic members that belong to the distributed
topic.
3. Click the Configure a new Distributed Topic Member text link. A dialog shows
the Configuration tab for configuring a new distributed topic member.
5. Click Create to create a distributed topic member with the name you specified in
the Name field. The new member is added to the Distributed Topic table in the
right pane.
Note: If you need to delete the entire distributed topic, then follow the directions for
“Deleting a Distributed Destination” on page 9-59.
3. Click the distributed topic that you want to delete a member from. The
Distributed Topic table shows all the distributed topic members that belong to the
distributed topic.
4. Click the Delete icon in the row of the distributed topic member that you want to
delete. A dialog prompts you to confirm your deletion request.
5. If you want to also remove the underlying physical queue, select the Also Delete
check box.
6. Click Remove to delete the distributed topic member (and the underlying
physical topic if selected).
7. The Distributed Topic table redisplays in the right pane. The distributed topic
member is deleted from the Distributed Topic table.
1. Delete all the members of the distributed queue or distributed topic, as explained
in the following sections:
3. You can delete the JMS template that is associated with the distributed
destination. However, make sure that this template is not being used by other
JMS servers or destinations. To delete a JMS Template, expand the JMS →
Templates node, and then click the trash icon in the row of the JMS template that
you want to delete.
Programming Considerations
You may want to program your JMS application to terminate gracefully in the event
of a WebLogic Server failure. For example:
You are connected to the failed A JMSException is delivered to the connection exception listener. You
WebLogic Server instance must restart the application once the server is restarted or replaced.
You are not connected to the failed You must re-establish everything once the server is restarted or replaced.
WebLogic Server instance
A JMS Server is targeted on the failed A ConsumerClosedException is delivered to the session exception
WebLogic Server instance listener. You must re-establish any message consumers that have been
lost.
Once properly configured, a JMS server and all of its destination members can migrate
to another WebLogic Server within a cluster.
You can recover JMS data from a failed WebLogic Server by starting a new server and
doing one or more of the tasks in the following table:
Persistent messaging—JDBC Store If the JDBC database store physically exists on the failed server,
migrate the database to a new server and ensure that the JDBC
connection pool URL attribute reflects the appropriate location
reference.
If the JDBC database does not physically exist on the failed server,
access to the database has not been impacted, and no changes are
required.
Persistent messaging—File Store Migrate the file to the new server, ensuring that the pathname within the
WebLogic Server home directory is the same as it was on the original
server.
Transactions Migrate the transaction log to the new server by copying all files named
<servername>*.tlog. This can be accomplished by storing the
transaction log files on a dual-ported disk that can be mounted on either
machine, or by manually copying the files.
If the files are located in a different directory on the new server, update
that server’s TransactionLogFilePrefix server configuration
attribute before starting the new server.
Note: JMS persistent stores can increase the amount of memory required during
initialization of WebLogic Server as the number of stored messages increases.
When rebooting WebLogic Server, if initialization fails due to insufficient
memory, increase the heap size of the Java Virtual Machine (JVM)
proportionally to the number of messages that are currently stored in the JMS
persistent store and try the reboot again.
For information about starting a new WebLogic Server, refer to “Starting and Stopping
WebLogic Servers” on page 2-1. For information about recovering a failed server,
refer to Recovering Failed Servers in the Configuring and Managing WebLogic
Domains guide.
The following sections explain how to configure and manage a WebLogic Messaging
Bridge:
A messaging bridge consists of two destinations that are being bridged: a source
destination from which messages are received, and a target destination to which
messages are forwarded. For WebLogic JMS and third-party JMS products, a
messaging bridge communicates with source and target destinations using the resource
adapters provided with WebLogic Server. For non-JMS messaging products, a custom
adapter must be obtained from a third-party OEM vendor or by contacting BEA
Professional Services in order to access non-JMS source or target destinations.
Source and target bridge destinations can be either queues or topics. You can also
specify a quality of service (QOS), as well as message filters, transaction semantics,
and connection retry policies. Once a messaging bridge is configured, it is easily
managed from the Administration Console, including temporarily suspending bridge
traffic whenever necessary, tuning the execute thread pool size to suit your
implementation, and monitoring the status of all your configured bridges.
The supported adapters are located in the WL_HOME\server\lib directory and are
described in the following table.
You will specify the appropriate adapter by its JNDI name when you configure each
source and target bridge destination on the Administration Console.
Using the Auto Deployment feature — This method is used for quickly
deploying an application on the administration server. By copying the adapters to
the local \applications directory of the administration server, they will be
automatically deployed if the server is already running. Otherwise, they will be
deployed the next time you start WebLogic Server. The auto deployment method
is used only in a single-server development environment for testing an
application, and is not recommended for use in production mode.
Before starting the procedure in this section, refer to the “Using the Messaging Bridge
to Interoperate with Different WebLogic Server Releases and Domains” on page 10-17
for specific configuration requirements and guidelines.
You need to configure a JMSBridgeDestination instance for each actual source and
target JMS destination to be mapped to a messaging bridge. Therefore, when you finish
defining attributes for a source JMS bridge destination, repeat these steps to configure
a target JMS bridge destination, or vice versa. You will designate the source and target
JMS Bridge Destinations in “Configuring a Messaging Bridge Instance” on page
10-11.
2. Click the JMS Bridge Destinations node to open the Bridge Destinations tab in
the right pane.
3. In the right pane, click the Configure a new JMS Bridge Destination link. A
Configuration dialog shows the tabs associated with configuring a new JMS
bridge destination.
Name A JMS bridge destination name for the actual JMS destination
being mapped to the bridge. This name must be unique across
a WebLogic domain.
For example, if you are bridging between WebLogic Server
releases 6.1 and 7.0, for the source destination you could
change the default bridge destination name to
“70to61SourceDestination”. Then, when you create the
corresponding target destination, you could name it as
“70to61TargetDestination”. Once the bridge destinations are
configured, these names are listed as options in the Source
Destination and Target Destination attributes on the Bridges →
General tab.
Adapter JNDI Name The JNDI name of the adapter used to communicate with the
bridge destinations. For more information on which adapter
name to enter, see “Messaging Bridge Adapters and JNDI
Names” on page 10-3.
Connection URL The URL of the JNDI provider used to look up the connection
factory and destination.
Initial Context Factory The factory used to get the JNDI context.
Connection Factory The JMS connection factory used to create a connection for the
JNDI Name actual JMS destination being mapped to the JMS bridge
destination.
Destination JNDI Name The JNDI name of the actual JMS destination being mapped to
the JMS bridge destination.
User Name and The user name and password that the messaging bridge will
Password give to the bridge adapter.
Note: All operations done to the specified destination are
done using that user name and password. Therefore,
the User Name/Password for the source and target
destinations must have permission to access the
underlying JMS destinations in order for the
messaging bridge to work.
6. When you finish defining attributes for a source JMS bridge destination, repeat
these steps to configure a target JMS bridge destination, or vice versa.
You need to configure a BridgeDestination instance for each actual source and
target destination to be mapped to a messaging bridge. You will designate the source
and target general bridge destinations in “Configuring a Messaging Bridge Instance”
on page 10-11.
2. Click the General Bridge Destinations node to open the Bridge Destinations tab
in the right pane.
3. In the right pane, click the Configure a new General Bridge Destination link. A
Configuration dialog shows the tabs associated with configuring a new general
bridge destination.
Adapter JNDI Name A bridge destination must supply the JNDI name of the adapter
used to communicate with the bridge destinations.
WebLogic Server does not provide adapters for non-JMS
messaging products. Therefore, you must use a specialized
adapter from a third-party OEM vendor, or contact BEA
Professional Services to obtain a custom adapter.
User Name and The user name that the messaging bridge will give to the bridge
Password adapter.
6. When you finish defining attributes for a source general bridge destination, repeat
these steps to configure a target general bridge destination, or vice versa.
Before starting the procedure in this section, refer to the “Using the Messaging Bridge
to Interoperate with Different WebLogic Server Releases and Domains” on page 10-17
or “Using the Messaging Bridge to Access a Third-Party Messaging Provider” on page
10-22 for specific configuration requirements and guidelines.
2. Click the Bridges node to open the Bridges tab in the right pane.
3. Click the Configure a new Messaging Bridge link in the right pane. A
Configuration dialog shows the tabs associated with configuring a new
messaging bridge.
Name Enter a name for the messaging bridge that is unique across a
WebLogic domain.
Source Destination Select the source destination from which messages are received
by the messaging bridge. For example, for a JMS messaging
bridge, you should select the “JMS Source Bridge Destination”
name that you created on the JMS Bridge Destination →
Configuration tab.
Target Destination Select the target destination to which messages are sent from
the messaging bridge. For example, for a JMS messaging
bridge, you should select the “JMS Target Bridge Destination”
name that you created on the JMS Bridge Destination →
Configuration tab.
Selector Allows you to filter the messages that are sent across the
messaging bridge. Only messages that match the selection
criteria are sent across the messaging bridge. For queues,
messages that do not match the selection criteria are left behind
and accumulate in the queue. For topics, messages that do not
match the connection criteria are dropped.
For more information on using selectors to filter messages, see
“Developing a WebLogic JMS Application” in Programming
WebLogic JMS.
Quality Of Service (QOS) Select a QOS guarantee for forwarding a message across a
messaging bridge. The valid qualities of service are:
Exactly-once—Each message will be sent exactly once. This is
the highest quality of service. In order to use this QOS:
Any WebLogic Server implementation must be release 6.1
or later.
The source and target JMS connection factories must be
configured to use the XAConnectionFactory.
The transaction jms-xa-adp.rar adapter must be
deployed and identified in the Adapter JNDI Name
attribute as
“eis.jms.WLSConnectionFactoryJNDIXA” for
both the source and target destinations.
Atmost-once—Each message is sent at most one time. Some
messages may not be delivered to the target destination.
Duplicate-okay—Each message is sent at least one time.
Duplicate messages can be delivered to the target destination.
QOS Degradation Allowed When selected, the messaging bridge automatically degrades
the requested QOS when the configured one is not available. If
this occurs, a message is delivered to the WebLogic startup
window (or log file). If this option is not selected (false), and
the messaging bridge cannot satisfy the requested QOS, it will
result in an error and the messaging bridge will not start.
Maximum Idle Time For bridges running in asynchronous mode, this is the
(seconds) maximum amount of time, in seconds, the messaging bridge
sits idle before checking the health of its connections. For
bridges running in synchronous mode, this dictates the amount
of time the messaging bridge can block on a receive call if no
transaction is involved.
Durability Enabled This attribute is used only for JMS topics or for destinations
with similar characteristics as a JMS topic. By enabling
durability, a messaging bridge creates a durable subscription
for the source destination. This allows the source JMS
implementation to save messages that are sent to it when the
bridge is not running. The bridge will then forward these
messages to the target destination once it is restarted. If this
attribute is not selected, messages that are sent to the source
JMS topic while the bridge is down cannot be forwarded to the
target destination.
6. On the Connection Retry tab, define the bridge’s reconnection time intervals
according to the following table.
The source and target destinations for a messaging bridge will not always be
available. As such, the messaging bridge must be able to reconnect to the
destination at some periodic interval. These attributes govern the time between
reconnection attempts.
8. On the Transactions tab, define the transaction attributes for the messaging bridge
according to the following table.
Transaction Timeout Defines the number of seconds the transaction manager waits
for each transaction before timing it out. Transaction timeouts
are used when a bridge’s quality of service requires two-phase
transactions.
Batch Size Defines the number of messages that the messaging bridge
transfers within one transaction. Batch Size only applies to
bridges that work in synchronous mode and whose quality of
service require two-phase transactions.
Batch Interval Defines the maximum time, in milliseconds, that the bridge
(milliseconds) waits before sending a batch of messages in one transaction,
regardless of whether the Batch Size amount has been reached
or not. The default value of -1 indicates that the bridge will wait
until the number of messages reaches the Batch Size before it
completes a transaction.
Batch Interval only applies to bridges that work in synchronous
mode and whose quality of service require two-phase
transactions.
10. On the Targets tab, assign WebLogic Server instances to associate with the
messaging bridge according to the following table.
Servers Defines the WebLogic Servers where the messaging bridge will
be deployed. The messaging bridge will be available on all the
selected WebLogic Servers.
Note: When the messaging bridge is used to communicate between two domains
running different releases of Weblogic Server, a best-practice
recommendation is for the messaging bridge to be configured to run on the
domain using the latest release of Weblogic Server.
All JMS connection factories targeted to servers in a cluster are uniquely named.
If a JMS file store is being used for persistent messages, the JMS file store name
must be unique across domains.
Message Properties
Message properties are inherited from the Default Delivery Mode attribute on the
connection factory used when a message is forwarded to its target destination. If the
Default Delivery Mode is Persistent, a non-persistent message is forwarded as
a persistent message resulting in a significant performance loss.
If you configure a bridge instance to forward non-persistent messages, configure and
use a connection factory that has the Default Delivery Mode set to
Non-Persistent.
However, you must follow these steps when a bridge running on release 7.0 domain must handle
transactional messages (using the Exactly-once QOS) between two release 6.1 or later domains
a. In all participating WebLogic Server 6.x domains, change the password for the
system user to the same value in all participating domains on the
Security→Users tab in the Administration Console. See Changing the System
Password at
http://e-docs.bea.com/wls/docs61/adminguide/cnfgsec.html#cnf
gsec003.
b. Establish domain trust by setting a security credential for all domains to the
same value in all participating domains. If you have participating 6.x domains,
set the security credential for all domains to the same value as the system
password in all participating WebLogic Server 6.x domains.
z For 7.x domains, see Enabling Trust Between WebLogic Domains in
Managing WebLogic Security.
z For 8.x domains, see Enabling Trust Between WebLogic Domains in
Managing WebLogic Security.
z For 9.x domains, see Enable trust between domains in Administration
Console Online Help.
If a JMS file store is being used for persistent messages, the JMS file store name
must be unique across WebLogic domains, as described in “Naming Guidelines
for WebLogic Servers and Domains” on page 10-17.
Make sure that the transaction connection factory is enabled for both domains by
selecting the XAConnection Factory Enabled check box on the Services →JMS
→Connection Factories →Configuration →Transactions tab.
Deploy the transaction resource adapter, jms-xa-adp.rar, on the 7.0 bridge domain,
as described in “Deploying the Bridge’s Resource Adapters” on page 10-4.
Note: The Exactly-once QOS for transactions is not supported for WebLogic Server
6.0. For more information on the bridge QOS options, see “Messaging Bridge
Attributes on the General Tab” on page 10-11.
z For the 6.0 destination, indicate the location of the classes for the WebLogic Server
6.0 release.
Note: The Exactly-once QOS for transactions is not supported for WebLogic Server
5.1. For more information on the bridge QOS options, see “Messaging Bridge
Attributes on the General Tab” on page 10-11.
z For the 7.0 destination, specify the non-transaction adapter’s JNDI name as
eis.jms.WLSConnectionFactoryJNDINoTX.
z For the 5.1 destination, specify the 5.1 adapter’s JNDI name as
eis.jms.WLS51ConnectionFactoryJNDINoTX.
Note: The messaging bridge cannot provide the “Exactly-once” quality of service
when the source and target bridge destinations are located on the same
resource manager (that is, when the bridge is forwarding a global transaction
that is using the XA resource of the resource manager). For example, when
using MQ Series, it is not possible to use the same Queue Manager for the
source and target bridge destinations.
For more information on configuring the remaining attributes for a JMS Bridge
Destination, see “Configuring a JMS Bridge Destination” on page 10-6.
3. On the Configuration General tab, clear the Started check box to stop the bridge.
1. Expand the Servers node and select the server instance where the messaging
bridges are configured.
2. A dialog displays in the right pane showing the tabs associated with the selected
server instance.
5. Click the Monitoring all Messaging Bridge Runtimes text link to display the
monitoring data.
6. A table displays showing all the messaging bridge instances for the server and
their status (either as running or not running).
2. Select the server instance where the messaging bridge is configured. A dialog
displays in the right pane showing the tabs associated with the selected server
instance.
5. Enter a new value in the Messaging Bridge Thread Pool Size field.
For more information about tuning execute threads, see “Tuning WebLogic Server
Applications” in the Performance and Tuning Guide.
11 Managing JNDI
The following sections describe how to manage JNDI:
1. Right-click the server node in the left pane. This displays a pop-up menu.
2. Select JNDI Tree. The JNDI tree for this server displays in the right pane.
To load an object in the JNDI tree, choose a name under which you want the object to
appear in the JNDI tree. Then enter that name in the JNDI Name attribute field when
you create the object. When the object is loaded, JNDI provides a path to the object.
To verify if an object has been loaded, see “Viewing the JNDI Tree”.
For more information on configuring objects, see Table 11-1 Objects in JNDI Tree.
JDBC DataSource JDBC Data Source and JDBC Transaction (Tx) Data
Source
Mail MailSession
12 Managing the
WebLogic J2EE
Connector Architecture
Based on the Sun Microsystems J2EE Connector Specification, Version 1.0, Proposed
Final Draft 2, the WebLogic J2EE Connector Architecture integrates the J2EE
Platform with one or more heterogeneous Enterprise Information Systems (EIS). The
following sections explain how to manage and administer the WebLogic J2EE
Connector Architecture:
Monitoring Connections
Deleting a Connector
An application server vendor (BEA WebLogic Server) extends its system only once to
support the J2EE Connector Architecture and is then assured of connectivity to
multiple EISes. Likewise, an EIS vendor provides one standard resource adapter and
it has the capability to plug in to any application server that supports the J2EE
Connector Architecture.
4. In the left pane of the Console, click Connectors. A table is displayed in the right
pane of the Console showing all the deployed Connectors.
7. Click [select] to the left of a directory or file to choose it and proceed to the next
step.
10. Click Configure and Deploy. The Console will display the Deploy panel, which
lists deployment status and deployment activities for the Connector.
1. After you deploy the Connector, in the left pane of the Administration Console,
right click the Connector and choose Edit Connector Descriptor.
2. In the left pane, expand WebLogic RA and click Map Config Properties.
4. On the Configure a new Map Config Property, in the Description box, enter a
description such as "Connection Profiling".
5. Click [select] to the left of a directory or file to choose it and proceed to the next
step.
8. Click Configure and Deploy. The Console will display the Deploy panel, which
lists deployment status and deployment activities for the Connector.
9. Use the Deploy button to deploy the Connector to all or selected targets or
undeploy it from all or selected targets.
10. Test your Connector by accessing a resource through a Web browser. Access
resources with a URL constructed as follows:
http://myServerr:myPort/myConnector/resource
Where:
z myServer is the name of the machine hosting WebLogic Server.
z myPort is the port number where WebLogic Server is listening for requests.
z myConnector is the name of theConnector archive file (myConnector.rar, for
instance) or the name of a directory containing the Connector.
z resource is the name of a resource such as a JSP, HTTP servlet, or HTML
page.
3. In the displayed table, click the name of the connector you wish to undeploy.
4. Click Apply.
2. In the displayed table, click the name of the connector you wish to update.
4. Click Apply.
Monitoring Connections
The BEA J2EE Connector Architecture provides you with monitoring capabilities in
the WebLogic Server Console that show detected leaks and provides a method for
looking up stacks to determine which application(s) is causing the leak. Delete buttons
in the Console allow you to dynamically close leaked connections that are identified;
the option to delete connections is only available for connections that have exceeded
their specified idle time and are safe to delete (in other words, the connection is not
involved in a transaction).
Getting Started
There are two methods for accessing monitoring tools using the Console:
Method One
1. In the left pane of the Console, select Deployments > Connectors to display a list
of connectors.
Method Two
3. In the Monitoring tab, select Monitor all Connector Connection Pool Runtimes.
Connection pool run-time information is provided in the right pane for the
selected connector.
A key difference between these two columns is the Connection Leak Profiles column
is controlled by use of the connection-profiling-enabled setting in the
weblogic-ra.xml file. By default, this setting is false, so normally the Connection
Leak Profiles column will be zero (disabled). However, the Leaked Connections
Detected column is always enabled and will always display the number of leaked
connections.
There are two methods for viewing leaked connections using the Console:
Method One
1. In the left pane of the Console, select Deployments > Connectors to display a list
of connectors.
2. Right-click a connector, and select View Leaked Connections from the pop-up
menu.
Connection pool run-time information for the selected connector is provided in
the right pane.
3. Under the Connection Leak Profiles column, click the number of leaked
connections pertaining to the selected connector.
Leaked connection information is displayed in the right pane.
Method Two
2. Under the Name column, click the name of the connector to monitor.
3. In the Monitoring tab, select Monitor all Connector Connection Pool Runtimes.
Connection pool run-time information for the selected connector is provided in
the right pane.
4. Under the Connection Leak Profiles column, click the number of leaked
connections pertaining to the selected connector.
Leaked connection information is displayed in the right pane.
A key difference between these two columns is the Connection Idle Profiles column is
controlled by use of the connection-profiling-enabled setting in the
weblogic-ra.xml file. By default, this setting is false, so normally the Connection
Idle Profiles column will be zero (disabled). However, the Idle Connections Detected
column is always enabled and will always display the number of idle connections.
There are two methods for idle connections using the Console:
Method One
1. In the left pane of the Console, select Deployments > Connectors to display a list
of connectors.
2. Right-click a connector, and select View Idle Connections from the pop-up menu.
Connection pool run-time information for the selected connector is provided in
the right pane.
3. Under the Connection Idle Profiles column, click the number of idle connections
pertaining to the selected connector.
Idle connection information is displayed in the right pane.
Method Two
2. Under the Name column, click the name of the connector to monitor.
3. In the Monitoring tab, select Monitor all Connector Connection Pool Runtimes.
Connection pool run-time information for the selected connector is provided in
the right pane.
4. Under the Connection Idle Profiles column, click the number of idle connections
pertaining to the selected connector.
Idle connection information is displayed in the right pane.
Deleting Connections
This functionality is not currently implemented in the WebLogic Server
Administration Console.
Deleting a Connector
To delete a connector, proceed as follows:
1. Select a connector to delete in the left pane of the Console under Deployments >
Connectors > Connector Name.
2. In the table of connectors located in the right pane, select the Trash Can icon.
The following message is displayed in the right pane:
Are you sure you want to permanently delete <Connector Name> from the
domain configuration?
ra.xml
weblogic-ra.xml
For detailed information about the elements in the resource adapter deployment
descriptors, refer to Programming WebLogic J2EE Connectors.
1. Invoke the Administration Console in your browser using the following URL:
http://host:port/console
where host refers to the name of the computer upon which WebLogic Server is
running and port refers to the port number to which it is listening.
4. Right-click the name of the resource adapter whose deployment descriptors you
want to edit and choose Edit Connector Descriptor from the drop-down menu.
The Administration Console window appears in a new browser. The left pane
contains a tree structure that lists all the elements in the two resource adapter
deployment descriptors and the right pane contains a form for the descriptive
elements of the ra.xml file.
a. Navigate the tree in the left pane, clicking on parent elements until you find the
element you want to edit.
b. Click the element. A form appears in the right pane that lists either its attributes
or subelements.
d. Click Apply.
a. Navigate the tree in the left pane, clicking on parent elements until you find the
name of the element you want to create.
b. Right-click the element and chose Configure a New Element from the
drop-down menu.
c. Enter the element information in the form that appears in the right pane.
d. Click Create.
a. Navigate the tree in the left pane, clicking on parent elements until you find the
name of the element you want to delete.
b. Right-click the element and chose Delete Element from the drop-down menu.
9. Once you have made all your changes to the resource adapter deployment
descriptors, click the root element of the tree in the left pane. The root element is
the either the name of the resource adapter *.rar archive file or the display
name of the resource adapter.
10. Click Validate if you want to ensure that the entries in the resource adapter
deployment descriptors are valid.
11. Click Persist to write your edits of the deployment descriptor files to disk in
addition to WebLogic Server's memory.
13 Managing WebLogic
Server Licenses
Your WebLogic Server requires a valid license to run. The following sections explain
how to install and update WebLogic licenses:
Updating a License
If you downloaded WebLogic Server from the BEA Web site, your evaluation license
is included with the distribution. The WebLogic Server installation program allows
you to specify the location of the BEA home directory, and installs a BEA license file,
license.bea, in that directory.
Updating a License
You will need to update the BEA license file if one of the following is true:
You have applied for and received an extension of your 60-day evaluation
license.
In any of these cases, you will receive a license update file by email as an attachment.
To update your BEA license file, do the following:
1. Save the license update file under a name other than license.bea in the BEA
home directory.
2. Make sure that the JDK (Java 2) is in your path. To add the JDK to your path,
enter one of the following commands:
z set PATH=.\jdk131\bin;%PATH% (Windows systems)
3. In a command shell, enter the following command in the BEA home directory:
UpdateLicense license_update_file
where license_update_file is the name under which you saved the license
update file that you received via email. Running this command updates the
license.bea file.
4. Save a copy of your license.bea file in a safe place outside the WebLogic
distribution. Although no one else can use your license file, you should save this
information in a place protected from either malicious or innocent tampering.
WebLogic provides several Java programs that simplify installation and configuration
tasks, provide services, and offer convenient shortcuts. The following sections
describe each Java utility provided with WebLogic Server. The command-line syntax
is specified for all utilities and, for some, examples are provided.
AppletArchiver
CertGen
Conversion
der2pem
dbping
Deployer
EJBGen
getProperty
ImportPrivateKey
logToZip
MulticastTest
myip
pem2der
Schema
showLicenses
system
verboseToZip
version
writeLicense
To use these utilities you must correctly set your CLASSPATH. For more information,
see “Setting the Classpath.”
Syntax
$ java utils.applet.archiver.AppletArchiver URL filename
Argument Definition
filename Local filename that is the destination for the .jar/.cab archive.
CertGen
The CertGen utility generates certificates that should only be used for demonstration
or testing purposes and not in a production environment.
Syntax
$ java utils.CertGen password certfile keyfile [export]
Argument Definition
certfile Defines the directory in which to copy the generated certificate file.
keyfile Defines the directory in which to copy the generated private key file.
Example
To generate a certificate:
1. Copy the following files to the directory in which you run the CertGen tool:
z WL_HOME/server/lib/CertgenCA.der—The certificate for a certificate
authority trusted by WebLogic Server.
z WL_HOME/server/lib/CertGenCAKey.der—The private key for a
certificate authority trusted by WebLogic Server.
2. Enter the following command to generate certificate files named testcert with
private key files named testkey:
$ java utils.CertGen mykeypass testcert testkey
Creating Domestic Key Strength - 1024
Encoding
................................................................
................................................................
................................................................
Created Private Key files - testkey.der and testkey.pem
ClientDeployer
You use weblogic.ClientDeployer to extract the client-side JAR file from a J2EE EAR
file, creating a deployable JAR file. The weblogic.ClientDeployer class is executed
on the Java command line with the following syntax:
java weblogic.ClientDeployer ear-file client
The ear-file argument is an expanded directory (or Java archive file with a .ear
extension) that contains one or more client application JAR files.
For example:
java weblogic.ClientDeployer app.ear myclient
where app.ear is the EAR file that contains a J2EE client packaged in
myclient.jar.
Once the client-side JAR file is extracted from the EAR file, use the
weblogic.j2eeclient.Main utility to bootstrap the client-side application and point
it to a WebLogic Server instance as follows:
java weblogic.j2eeclient.Main clientjar URL [application args]
For example
java weblogic.j2eeclient.Main helloWorld.jar
t3://localhost:7001 Greetings
Conversion
If you have used an earlier version of WebLogic, you must convert your
weblogic.properties files. Instructions for converting your files using a
conversion script are available in the Administration Console Online Help section
called “Conversion.”
Syntax
$ java utils.der2pem derFile [headerFile] [footerFile]
Argument Description
derFile The name of the file to convert. The filename must end with a .der
extension, and must contain a valid certificate in .der format.
headerFile The header to place in the PEM file. The default header is “-----BEGIN
CERTIFICATE-----”.
Use a header file if the DER file being converted is a private key file, and
create the header file containing one of the following:
“-----BEGIN RSA PRIVATE KEY-----” for an unencrypted private
key.
“-----BEGIN ENCRYPTED PRIVATE KEY-----” for an encrypted
private key.
Note: There must be a new line at the end of the header line in the file.
footerFile The header to place in the PEM file. The default header is “-----END
CERTIFICATE-----”.
Use a footer file if the DER file being converted is a private key file, and
create the footer file containing one of the following in the header:
“-----END RSA PRIVATE KEY-----” for an unencrypted private
key.
“-----END ENCRYPTED PRIVATE KEY-----” for an encrypted
private key.
Note: There must be a new line at the end of the header line in the file.
Example
$ java utils.der2pem graceland_org.der
Decoding
................................................................
dbping
The dbping command-line utility tests the connection between a DBMS and your
client machine via a JDBC driver. You must complete the installation of the driver
before attempting to use this utility. For more information on how to install a driver,
see WebLogic jDrivers at http://e-docs.bea.com/wls/docs70/jdrivers.html.
Syntax
$ java -Dbea.home=license_location utils.dbping DBMS user password DB
Argument Definition
user Valid username for login. Use the same values you use with isql
or sqlplus.
password Valid password for the user. Use the same values you use with
isql or sqlplus.
Where:
HOST is the name of the machine hosting the DBMS,
PORT is port on the database host where the DBMS is
listening for connections, and
DBNAME is the name of a database on the DBMS. (For Oracle,
this is the name of a DBMS defined in the tnsnames.ora
file.)
Example
$ C:\bea\weblogic700b\samples\server\config\examples>java
utils.dbping ORACLE_THIN scott tiger lcdbsol1:1561:lcs901
java.sql.Driver d =
(java.sql.Driver)Class.forName("oracle.jdbc.driver.OracleD
river").newInstance();
java.sql.Connection conn =
d.connect("jdbc:oracle:thin:@lcdbsol1:1561:lcs901",
props);
**** or ****
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
java.sql.Connection conn =
Driver.connect("jdbc:oracle:thin:@lcdbsol1:1561:lcs901", "scott",
"tiger");
**** or ****
The weblogic.Deployer utility is new in WebLogic Server 7.0, and replaces the
earlier weblogic.deploy utility, which has been deprecated. For more
information about the deprecated weblogic.deploy utility, see "Deploying
Applications" in the WebLogic Server Administration Guide.
Syntax
% java weblogic.Deployer [options]
[-activate|-deactivate|-remove|-cancel|-list] [files]
Action Description
delete_files Removes files specified in the file list and leaves the application
activated. This is valid only for unarchived applications. You must
specify target servers.
Action Description
remove Physically removes the application and any staged data from the target
servers. The components are deactivated and the targets are removed
from the applications configuration. If you remove the application
entirely, the associated MBeans are also deleted from the system
configuration. This command only works with the two-phase deployment
model.
upload Transfers the specified source file(s) to the administration server. Use this
option when you are on a remote system and want to deploy an
application that resides on the remote system. The application files are
uploaded to the WebLogic Server administration server prior to
distribution to named target servers.
Options
Option Description
nowait Once the action is initiated, the tool prints the task id and
exits. This is used to initiate multiple tasks and then monitor
them later using the -list action.
password Specifies the password on the command line. If you do not provide
a password, you will be prompted for one.
Option Description
Examples
Examples of weblogic.Deployer commands:
Redeploying an Application
Deactivating an Application
Undeploying an Application
Redeploying an Application
java weblogic.Deployer -adminurl http://admin:7001 -name app
-activate
Deactivating an Application
java weblogic.Deployer -adminurl http://admin:7001 -name app
-targets server1 -deactivate
Undeploying an Application
java weblogic.Deployer -adminurl http://admin:7001 -name app
-targets server -remove -id tag
EJBGen
EJBGen is an Enterprise JavaBeans 2.0 code generator. You can annotate your Bean
class file with javadoc tags and then use EJBGen to generate the Remote and Home
classes and the deployment descriptor files for an EJB application, reducing to one the
number of EJB files you need to edit and maintain.
For complete documentation of this tool, see EJBGen in WebLogic Server EJB
Utilities at http://e-docs.bea.com/wls/docs70/ejb/EJB_utilities.html#1079050.
Syntax
$ java utils.getProperty
Example
$ java utils.getProperty
-- listing properties --
user.language=en
java.home=c:\java11\bin\..
awt.toolkit=sun.awt.windows.WToolkit
file.encoding.pkg=sun.io
java.version=1.1_Final
file.separator=\
line.separator=
user.region=US
file.encoding=8859_1
java.vendor=Sun Microsystems Inc.
user.timezone=PST
user.name=mary
os.arch=x86
os.name=Windows NT
java.vendor.url=http://www.sun.com/
user.dir=C:\weblogic
java.class.path=c:\weblogic\classes;c:\java\lib\cla...
java.class.version=45.3
os.version=4.0
path.separator=;
user.home=C:\
ImportPrivateKey
The ImportPrivateKey utility is used to load a private key into a private keystore
file.
Syntax
$ java utils.ImportPrivateKey keystore keystorepass alias keypass
certfile keyfile
Argument Definition
keystore Defines the name of the keystore file. A new keystore is created if one
does not exist.
alias Defines the name that is used to look up certificates and keys in the
keystore.
keypass Defines the password used to unlock the private key file and to protect
the private key in the keystore.
certfile The name of the certificate associated with the private key.
keyfile The name of the file holding the protected private key.
Example
Use the following steps to:
Create a keystore and store a private key using the ImportPrivateKey utility
2. Use the utils.CertGen utility to generate a certificate and private key. See
Using the CertGen Tool at
http://e-docs.bea.com/wls/docs70/secmanage/ssl.html#1165276.
Encoding
................................................................
................................................................
................................................................
Created Private Key files - testkey.der and testkey.pem
Encoding
................................................................
................................................................
................................................................
Created Certificate files - testcert.der and testcert.pem
................................................................
5. Create a new keystore named mykeystore and load the private key located in
the testkey.pem file.
D:\bea2\weblogic700\samples\server\src>java utils.ImportPrivateKey
mykeystore mypasswd mykey mykeypass newcerts.pem testkey.pem
Keystore file not found, creating it
logToZip
The logToZip utility searches an HTTP server log file in common log format, finds
the Java classes loaded into it by the server, and creates an uncompressed .zip file that
contains those Java classes. It is executed from the document root directory of your
HTTP server.
To use this utility, you must have access to the log files created by the HTTP server.
Syntax
$ java utils.logToZip logfile codebase zipfile
Argument Definition
codebase Required. Code base for the applet, or "" if there is no code base. By
concatenating the code base with the full package name of the applet, you
get the full pathname of the applet (relative to the HTTP document root).
zipfile Required. Name of the .zip file to create. The resulting .zip file is
created in the directory in which you run the program. The pathname for
the specified file can be relative or absolute. In the examples, a relative
pathname is given, so the .zip file is created in the current directory.
Examples
The following example shows how a .zip file is created for an applet that resides in
the document root itself, that is, with no code base:
$ cd /HTTP/Serv/docs
$ java utils.logToZip /HTTP/Serv/logs/access "" app2.zip
The following example shows how a .zip file is created for an applet that resides in a
subdirectory of the document root:
C:\>cd \HTTP\Serv
C:\HTTP\Serv>java utils.logToZip \logs\applets\classes app3.zip
1. A confirmation and sequence ID for each message sent out by this server.
2. The sequence and sender ID of each message received from any clustered server,
including this server.
To use MulticastTest, start one copy of the utility on each node on which you want
to test multicast traffic.
Warning: Do NOT run the MulticastTest utility by specifying the same multicast
address (the -a parameter) as that of a currently running WebLogic
Cluster. The utility is intended to verify that multicast is functioning
properly before starting your clustered WebLogic Servers.
For information about setting up multicast, see the configuration documentation for the
operating system/hardware of the WebLogic Server host. For more information about
configuring a cluster, see Using WebLogic Server Clusters.
Syntax
$ java utils.MulticastTest -n name -a address [-p portnumber]
[-t timeout] [-s send]
Argument Definition
-n name Required. A name that identifies the sender of the sequenced
messages. Use a different name for each test process you start.
Argument Definition
-p portnumber Optional. The multicast port on which all the servers in the cluster
are communicating. (The multicast port is the same as the listen port
set for WebLogic Server, which defaults to 7001 if unset.)
Example
$ java utils.MulticastTest -N server100 -A 237.155.155.1
Set up to send and receive on Multicast on Address 237.155.155.1 on
port 7001
Will send a sequenced message under the name server100 every 2
seconds.
Received message 506 from server100
Received message 533 from server200
I (server100) sent message num 507
Received message 507 from server100
Received message 534 from server200
I (server100) sent message num 508
Received message 508 from server100
Received message 535 from server200
I (server100) sent message num 509
Received message 509 from server100
Received message 536 from server200
I (server100) sent message num 510
Received message 510 from server100
Received message 537 from server200
I (server100) sent message num 511
Received message 511 from server100
Received message 538 from server200
I (server100) sent message num 512
Received message 512 from server100
Received message 539 from server200
I (server100) sent message num 513
Received message 513 from server100
Syntax
$ java utils.myip
Example
$ java utils.myip
Host toyboat.toybox.com is assigned IP address: 192.0.0.1
pem2der
The pem2der utility converts an X509 certificate from PEM format to DER format.
The .der file is written in the same directory as the source .pem file.
Syntax
$ java utils.pem2der pemFile
Argument Description
pemFile The name of the file to be converted. The filename must end with a
.pem extension, and it must contain a valid certificate in .pem
format.
Example
$ java utils.pem2der graceland_org.pem
Decoding
................................................................
................................................................
................................................................
................................................................
................................................................
Syntax
$ java utils.Schema driverURL driverClass [-u username]
[-p password] [-verbose] SQLfile
Argument Definition
Example
The following code shows a Schema command line for the examples.utils package:
D:\bea\weblogic700\samples\server\src>java utils.Schema
"jdbc:pointbase:server://localhost/demo"
"com.pointbase.jdbc.jdbcUniversalDriver" -u "examples"
-p "examples" examples/utils/ddl/demo.ddl
url: jdbc:pointbase:server://localhost/demo
driver: com.pointbase.jdbc.jdbcUniversalDriver
dbserver: null
user: examples
password: examples
SQL file: examples/utils/ddl/demo.ddl
showLicenses
The showLicenses utility displays license information about BEA products installed
in this machine.
Syntax
$ java -Dbea.home=license_location utils.showLicenses
Argument Description
Example
$ java -Dbea.home=d:\bea utils.showLicense
Syntax
$ java utils.system
Example
$ java utils.system
* * * * * * * java.version * * * * * * *
1.1.6
* * * * * * * java.vendor * * * * * * *
Sun Microsystems Inc.
* * * * * * * java.class.path * * * * * * *
\java\lib\classes.zip;\weblogic\classes;
\weblogic\lib\weblogicaux.jar;\weblogic\license
...
* * * * * * * os.name * * * * * * *
Windows NT
* * * * * * * os.arch * * * * * * *
x86
* * * * * * * os.version * * * * * * *
4.0
verboseToZip
When executed from the document root directory of your HTTP server,
verboseToZip takes the standard output from a Java application run in verbose mode,
finds the Java classes referenced, and creates an uncompressed.zip file that contains
those Java classes.
Syntax
$ java utils.verboseToZip inputFile zipFileToCreate
Argument Definition
inputFile Required. Temporary file that contains the output of the application
running in verbose mode.
zipFileToCreate Required. Name of the .zip file to be created. The resulting .zip
file is be created in the directory in which you run the program.
UNIX Example
$ java -verbose myapplication > & classList.tmp
$ java utils.verboseToZip classList.tmp app2.zip
NT Example
$ java -verbose myapplication > classList.tmp
$ java utils.verboseToZip classList.tmp app3.zip
Syntax
$ java weblogic.Admin -url host:port -username username -password
password VERSION
Example
$ java weblogic.Admin
-url localhost:7001 -username system -password foo VERSION
writeLicense
The writeLicense utility writes information about all your WebLogic licenses in a
file called writeLicense.txt, located in the current directory. This file can then be
emailed, for example, to WebLogic technical support.
Syntax
$ java utils.writeLicense -nowrite -Dweblogic.system.home=path
Argument Definition
-nowrite Required. Sends the output to stdout instead of
writeLicense.txt.
Examples
$ java utils.writeLicense -nowrite
* * * * * * * java.version * * * * * * *
1.1.7
* * * * * * * java.vendor * * * * * * *
Sun Microsystems Inc.
* * * * * * * java.class.path * * * * * * *
c:\weblogic\classes;c:\weblogic\lib\weblogicaux.jar;
c:\java117\lib\classes.zip;c:\weblogic\license
...
* * * * * * * os.arch * * * * * * *
x86
* * * * * * * os.version * * * * * * *
4.0
* * * * * * IP * * * * * *
Host myserver is assigned IP address: 192.1.1.0
* * * * * * WebLogic version * * * * * *
WebLogic Build: 4.0.x xx/xx/1999 10:34:35 #xxxxx
B WebLogic Server
Command-Line
Interface Reference
The following sections discuss the WebLogic Server command-line interface syntax,
and describe each WebLogic Server administration, connection pool administration,
and MBean management command:
You prefer using the command-line interface over a graphical user interface.
1. Install and configure the WebLogic Server software, as described in the WebLogic
Server Installation Guide. See
http://e-docs.bea.com/wls/docs70/install/index.html.
3. If you want the weblogic.Admin utility to use a listen port that is reserved for
administration traffic, you must configure a domain-wide administration port as
described in "Configuring a Domain-Wide Administration Port" at
http://e-docs.bea.com/wls/docs70/admin_domain/network.html#1126818.
Syntax
java weblogic.Admin [–url URL]
[ { -username username [-password password] } |
{ [-userconfigfile config-file] [-userkeyfile admin-key] }
]
COMMAND arguments
-username username Username that has permission to invoke the command you specify.
If you do not specify this argument, weblogic.Admin uses a
user-configuration file and key file.
For information about permissions for system administration tasks, refer to
“Protecting System Administration Operations” on page 3-1.
-userkeyfile admin-key Specifies the name and location of the key file that is associated with the
user-configuration file you specify.
When you create a user-configuration file, the STOREUSERCONFIG
command uses a key file to encrypt the username and password. Only the key
file that encrypts a user-configuration file can decrypt the username and
password.
If you do not specify -userkeyfile admin-key, weblogic.Admin
searches for a key file at the default path name. (See
“STOREUSERCONFIG” on page B-30.)
Note: The exit code for all commands is 1 if the Administration client cannot connect
to the server.
In a development environment in which security is not a top priority, you can use the
-username and -password arguments when invoking the weblogic.Admin utility
directly on the command line or in scripts. With these arguments, the username and
password are not encrypted. If you store the values in a script, the user credentials can
be used by anyone who has read access to the script.
the plain text user credentials to those with read privileges for the script. For
information about creating a user-configuration and key file, see
“STOREUSERCONFIG” on page B-30.
The following list summarizes the order of precedence for the weblogic.Admin
user-credentials arguments:
If you specify -username username, the utility prompts for a password. Then
it passes the unencrypted values to the server instance you specify in the -url
argument.
The following command uses a user-configuration file and key file that are located at
the default pathname:
java weblogic.Admin COMMAND
Cancel shutting down CANCEL_SHU (Deprecated) Cancels the SHUTDOWN command for the WebLogic
a WebLogic Server TDOWN Server that is specified in the URL.
See “CANCEL_SHUTDOWN” on page B-10.
Connect to WebLogic CONNECT Makes the specified number of connections to the WebLogic Server
Server and returns two numbers representing the total time for each round
trip and the average amount of time (in milliseconds) that each
connection is maintained.
See “CONNECT” on page B-11.
Determine the current GETSTATE Returns the current state of the WebLogic Server.
state of a server See “GETSTATE” on page B-14.
Get Help for one or HELP Provides syntax and usage information for all WebLogic Server
more commands commands (by default) or for a single command if a command value
is specified on the HELP command line.
See “HELP” on page B-15.
View WebLogic LICENSES Lists the licenses for all the WebLogic Server instances installed on
Server licenses a specific server.
See “LICENSES” on page B-16.
List JNDI naming tree LIST Lists the bindings of a node in the JNDI naming tree.
node bindings See “LIST” on page B-17.
Migrate Services MIGRATE Migrates a JMS service or a JTA service to a targeted server within
the cluster.
See “MIGRATE” on page B-19
Verify WebLogic PING Sends a message to verify that a WebLogic Server is listening on a
Server listening ports port, and is ready to accept WebLogic client requests.
See “PING” on page B-21.
Move a server from RESUME Makes a server available to receive requests from external clients.
the STANDBY state to See “RESUME” on page B-22.
RUNNING
Viewing server log SERVERLOG Displays the server log file generated on a specific server.
files See “SERVERLOG” on page B-23.
Start a remote START Uses a configured Node Manager to start a Managed Server in the
managed WebLogic RUNNING state.
Server See “START” on page B-26.
Start a remote STARTINSTAN Uses a configured Node Manager to start a Managed Server and
managed WebLogic DBY place it in the STANDBY state.
Server and place it in See “STARTINSTANDBY” on page B-28.
the STANDBY state
Encrypt user STOREUSERC Creates an encrypted user-configuration file and its associated key
credentials in a file ONFIG file. You can pass the encrypted values to a server instance instead
of entering a username and password on the command line.
See “STOREUSERCONFIG” on page B-30.
View threads THREAD_DUM Provides a real-time snapshot of the WebLogic Server threads that
P are currently running.
See “THREAD_DUMP” on page B-36.
Unlock a WebLogic UNLOCK (Deprecated) Unlocks the specified WebLogic Server after a LOCK
Server operation.
See “UNLOCK” on page B-37.
View WebLogic VERSION Displays the version of the WebLogic Server software that is
Server version running on the machine specified by the value of URL.
See “VERSION” on page B-38.
Note: The exit code for all commands is 1 if the Administration client cannot connect
to the server.
CANCEL_SHUTDOWN
(Deprecated) The CANCEL_SHUTDOWN command cancels the SHUTDOWN
command for a specified WebLogic Server.
When you use the SHUT_DOWN command, you can specify a delay (in seconds). An
administrator may cancel the shutdown command during the delay period. Be aware
that the SHUTDOWN command disables logins, and they remain disabled even after
cancelling the shutdown. Use the UNLOCK command to re-enable logins.
This command is deprecated because the ability to specify a delay in the SHUTDOWN
command is also deprecated. Instead of specifying a delay in the SHUTDOWN command,
you can now set attributes to control how a server shuts down. For more information,
refer to "Setting the Timeout Period for Forced Shutdown Operations" in the
Administration Console Online Help.
Syntax
java weblogic.Admin [Connection and User Credentials Arguments]
CANCEL_SHUTDOWN
Example
In the following example, a system user named weblogic with a password of
weblogic requests to cancel the shutdown of the WebLogic Server listening on port
7001 on machine localhost:
java weblogic.Admin -url t3://localhost:7001 -username weblogic
-password weblogic CANCEL_SHUTDOWN
CONNECT
Makes the specified number of connections to the WebLogic Server and returns two
numbers representing the total time for each round trip and the average amount of time
(in milliseconds) that each connection is maintained.
Syntax
java weblogic.Admin [Connection and User Credentials Arguments]
CONNECT count
Argument Definition
Example
In the following example, a user with the name adminuser and the password
gumby1234 runs the CONNECT command to establish 25 connections to a server named
localhost and return information about those connections:
FORCESHUTDOWN
Immediately terminates a server process.
When you issue this command, the server notifies all applications and subsystems to
drop all current work and release all resources. A forceful shutdown could result in
rolled back transactions and session loss for some clients. You can shut down a server
forcefully from any state.
If you use this command for a Managed Server and it fails to respond, and if you started
the server with the Node Manager, the Node Manager kills the server process.
For information on performing this task from the Administration Console, refer to
Forcing Shutdown of a Server in the Administration Console Online Help.
This command is affected by the timeout period for LifeCycle operations. For more
information, refer to Timeout Period for LifeCycle Operations in the WebLogic
Administration Guide and Setting the Timeout Period for LifeCycle Operations in the
Administration Console Online Help.
Syntax
java weblogic.Admin [Connection and User Credentials Arguments]
FORCESHUTDOWN [targetserver]
Argument Definition
targetserv Optional. The name of the server to shut down. If you do not specify a
er value, the command shuts down the server that you specified in the -url
argument.
Example
In the following example, a user with the username adminuser and password
gumby1234 forces a server named MyServer to shut down via the Administration
Server:
java weblogic.Admin -url myAdminServer:7001 -username adminuser
-password gumby1234 FORCESHUTDOWN MyServer
In the following example, the Administration Server is not available. The same user
logs on to a Managed Server’s host machine and issues the following command:
GETSTATE
Returns the current state of a server.
For more information about server states, refer to The Server Lifecycle.
Syntax
java weblogic.Admin [Connection and User Credentials Arguments]
GETSTATE targetserver
Argument Definition
targetserver Optional. The name of the server to shut down. If you do not specify a
value, the command returns the state of the server that you specified in
the -url argument.
Example
In the following example, a user with the adminuser username and password
gumby1234 attempts to determine the state of a server named MyServer via the
Administration Server:
HELP
Provides syntax and usage information for all WebLogic Server commands (by
default) or for a single command if a command value is specified on the HELP
command line.
Syntax
java weblogic.Admin HELP [COMMAND]
Example
In the following example, information about using the PING command is requested:
java weblogic.Admin HELP PING
LICENSES
Lists the licenses for all WebLogic Server instances installed on the specified server.
Syntax
java weblogic.Admin [Connection and User Credentials Arguments]
LICENSES
Example
In the following example, an administrator using the default username
(installadministrator) and default password (installadministrator)
requests the license information for a WebLogic Server running on port 7001 of
machine localhost:
java weblogic.Admin -url localhost:7001 -username
installadministrator
-password installadministrator LICENSES
LIST
Lists the bindings of a node in the JNDI naming tree.
Syntax
java weblogic.Admin [Connection and User Credentials Arguments]
LIST context
Argument Definition
context Required. The JNDI context for lookup, for example, weblogic,
weblogic.ejb, javax.
Example
In this example, user adminuser, who has a password of gumby1234, requests a list
of the node bindings in weblogic.ejb:
java weblogic.Admin -url localhost:7001 -username adminuser
-password gumby1234 LIST weblogic.ejb
LOCK
(Deprecated) Locks a WebLogic Server against non-privileged logins. Any subsequent
login attempt initiates a security exception which may contain an optional string
message.
Note: This command is privileged. It requires the password for the WebLogic Server
administrative user.
Instead of using the LOCK command, start a server in the STANDBY state. In this state, a
server instance responds only to administrative requests over the domain-wide
administration port. For more information, refer to “STARTINSTANDBY” on page
B-28.
Syntax
java weblogic.Admin [Connection and User Credentials Arguments]
LOCK “string_message”
Argument Definition
Example
In the following example, a WebLogic Server is locked.
java weblogic.Admin -url localhost:7001 -username adminuser
-password gumby1234
LOCK "Sorry, WebLogic Server is temporarily out of service."
Any application that subsequently tries to log into the locked server with a
non-privileged username and password receives the specified message: Sorry,
WebLogic Server is temporarily out of service.
MIGRATE
Migrates a JMS service or a JTA Transaction Recovery service to a targeted server
within a server cluster.
Syntax
To migrate JMS resources:
java weblogic.Admin [Connection and User Credentials Arguments]
MIGRATE -migratabletarget "serverName (migratable)"
-destination serverName [-sourcedown] [-destinationdown]
Argument Definition
{-url Specify the listen address and listen port of the Administration Server.
[protocol://]listen-ad If you specify a secure listen port, you must also specify a secure protocol.
dress:listen-port}
If you do not specify a value, the command assumes
t3://localhost:7001.
-migratabletarget Names the server from which the service will migrate. The syntax for the
server name varies depending on the type of service you are migrating:
For JMS, specify "servername (migratable)"
For example, "myserver (migratable)"
For JTA, specify servername
For example, myserver
Argument Definition
-sourcedown Specifies that the source server is down. This switch should be used very
carefully. If the source server is not in fact down, but only unavailable because
of network problems, the service will be activated on the destination server
without being removed from the source server, resulting in two simultaneous
running versions of the same service, which could cause corruption of the
transaction log or of JMS messages.
-destinationdown Specifies that the destination server is down. A JMS service migrated to a
non-running server will be lost. When migrating the JTA Transaction
Recovery Service to a non-running server, the target server will assume
recovery services when it is started.
Examples
In the following example, a JMS service is migrated from myserver2 to myserver3.
java weblogic.Admin -url AdminHost:7001 -username adminuser
-password gumby1234 MIGRATE
-migratabletarget "myserver2 (migratable)"
-destination myserver3
PING
Sends a message to verify that a WebLogic Server is listening on a port, and is ready
to accept WebLogic client requests.
Syntax
java weblogic.Admin [Connection and User Credentials Arguments]
PING [round_trips] [message_length]
Argument Definition
message_length Optional. Size of the packet to be sent in each ping. Requests for
pings with packets larger than 10 MB throw exceptions.
Example
In the following example, the command checks a WebLogic Server running on port
7001 of machine localhost ten (10) times.
java weblogic.Admin -url localhost:7001 -username adminuser
-password gumby1234 PING 10
RESUME
Moves a server from the STANDBY state to the RUNNING state.
For information on performing this task from the Administration Console, refer to
Resuming a Server in the Administration Console Online Help. For more information
about server states, refer to The Server Lifecycle.
Syntax
java weblogic.Admin [Connection and User Credentials Arguments]
RESUME [targetserver]
Argument Definition
targetserver Optional. The name of the server to shut down. If you do not specify a
value, the command resumes the server that you specified in the -url
argument.
Example
In the following example, a user with the adminuser username and password
gumby1234 attempts to resume a server named MyServer via the Administration
Server:
java weblogic.Admin -url myAdminServer:7001 -username adminuser
-password gumby1234 RESUME MyServer
SERVERLOG
Displays the log file generated on a specific server.
If you do not specify a URL, the server log for the Administration Server is
displayed by default.
If you specify a server URL, you can retrieve a log for a non-Administration
Server.
If you omit the starttime and endtime arguments, a running display of the
entire server log is started.
Syntax
java.weblogic.Admin [Connection and User Credentials Arguments]
SERVERLOG [[starttime]|[endtime]]
Argument Definition
starttime Optional. Earliest time at which messages are to be displayed. If not
specified, messages display starts, by default, when the SERVERLOG
command is executed. The date format is yyyy/mm/dd. Time is
indicated using a 24-hour clock. The start date and time are entered inside
quotation marks, in the following format: “yyyy/mm/dd hh:mm”
Example
In the following example, a request is made for a running display of the log for the
server listening on port 7001 on machine localhost.
java weblogic.Admin -url localhost:7001 -username adminuser
-password gumby1234 SERVERLOG “2001/12/01 14:00” “2001/12/01 16:00”
The request specifies that the running display should begin at 2:00 p.m. on December
1, 2001, and end at 4:00 p.m. on December 1, 2001.
SHUTDOWN
Shuts down the specified WebLogic Server.
When you issue this command, the server invokes any shutdown classes that you have
configured. It then notifies all applications and subsystems to stop receiving new
requests from external clients and to complete all current work. You can shut down a
server gracefully only from the RUNNING or STANDBY states.
In release 6.x, this command included an option to specify a number of seconds to wait
before starting the shutdown process. This option is now deprecated. To support this
deprecated option, this command must assume that any numerical value that you
supply in the field immediately after the SHUTDOWN command is intended to express
seconds. You cannot use this command to gracefully shut down a server whose name
is made up entirely of numbers. Instead, you must use the Administration Console. For
information, refer to Shutting Down a Server in the Administration Console Online
Help.
Instead of specifying a delay in the SHUTDOWN command, you can now set attributes to
control how a server shuts down. For more information, refer to Timeout Period for
LifeCycle Operations in the WebLogic Administration Guide and Setting the Timeout
Period for LifeCycle Operations in the Administration Console Online Help.
Syntax
java weblogic.Admin [Connection and User Credentials Arguments]
SHUTDOWN [targetserver]
Argument Definition
targetserver The name of the server to shut down.
If you do not specify a value, the command shuts down the server that
you specified in the -url argument.
Argument Definition
“lockMessage” (Deprecated) Optional. Message, in double quotes, to be supplied in the
message that is sent if a user tries to log in while the WebLogic Server
is locked.
Example
In the following example, a user with the adminuser username and password
gumby1234 shuts down a server named MyServer via the Administration Server:
START
Starts a remote Managed Server using Node Manager.
The Node Manager must be running on the Managed Server’s host machine.
The Managed Server’s startup items and Node Manager settings must be set up
as described in Managing Server Availability with Node Manager.
For information on performing this task from the Administration Console, refer to
Starting a Server in the Administration Console Online Help.
Syntax
java weblogic.Admin [Connection and User Credentials Arguments]
START targetserver
Argument Definition
-url URL Must specify the listen address of the domain’s Administration Server.
The default is localhost:7001.
targetserver The name of the Managed Server to start in a RUNNING state.
Example
In the following example, a user with the adminuser username and password
gumby1234 attempts to start a server named MyServer via the Administration Server:
STARTINSTANDBY
Starts a remote Managed Server using Node Manager and places it in a STANDBY state.
In this state, a server is not accessible to requests from external clients.
The Node Manager must be running on the Managed Server’s host machine.
The Managed Server’s startup items and Node Manager settings must be set up
as described in Managing Server Availability with Node Manager.
For information on performing this task from the Administration Console, refer to
Starting a Server in the STANDBY State in the Administration Console Online Help.
For more information about server states, refer to The Server Lifecycle.
Syntax
java weblogic.Admin [Connection and User Credentials Arguments]
STARTINSTANDBY [targetserver]
Argument Definition
Argument Definition
targetserver Optional. The name of the WebLogic Server to start in the STANDBY
state. If you do not specify a value, the command starts the server that
you specified in the -url argument.
Example
In the following example, a user with the adminuser username and password
gumby1234 attempts to start a server named MyServer via the Administration Server:
java weblogic.Admin -url myAdminServer:7001 -username adminuser
-password gumby1234 STARTINSTANDBY MyServer
STOREUSERCONFIG
Creates a user-configuration file and an associated key file. The user-configuration file
contains an encrypted username and password. The key file contains a secret key that
is used to encrypt and decrypt the username and password.
Only the key file that originally encrypted the username and password can decyrpt the
values. If you lose the key file, you must create a new user-configuration and key file
pair.
Caution: You must ensure that only authorized users can access the key file. Any
user who accesses a valid user-configuration and key file pair gains the
privileges of the encrypted username. To secure access to the key file, you
can store the key file in a directory that provides read and write access only
to authorized users, such as WebLogic Server administrators.
Alternatively, you can write the key file to a removable medium, such as a
floppy or CD, and lock the medium in a drawer when it is not being used.
Syntax
java weblogic.Admin
-username username [-password password]
[ -userconfigfile config-file ] [ -userkeyfile keyfile ]
STOREUSERCONFIG
Argument Definition
-userconfigfi Specifies a file pathname at which the STOREUSERCONFIG command
le creates a user-configuration file. The pathname can be absolute or
config-file relative to the directory from which you enter the command.
If a file already exists at the specified pathname, the command
overwrites the file with a new file that contains the newly encrypted
username and password.
If you do not specify this option, STOREUSERCONFIG does the
following:
To determine the directory in which to create the user-configuration
file, it uses the JVM user-home directory. The default value varies
depending on the SDK and type of operating system. See
“Configuring the Default Path Name” on page B-32.
To determine the file name, it prepends your operating-system
username to the string -WebLogicConfig.properties. For
example, username-WebLogicConfig.properties. You
can use Java options to specify a different username. See
“Configuring the Default Path Name” on page B-32.
user-home-directory\username-WebLogicConfig.properties
user-home-directory\username-WebLogicKey.properties
You can use the following Java options to specify values for user-home-directory
and username:
2. Specify the name and location of the user-configuration and key files by doing
one of the following:
z Use the -userconfigfile config-file and -userkeyfile key-file
arguments:
java weblogic.Admin -username username -password password
-userconfigfile config-file -userkeyfile key-file
STOREUSERCONFIG
You can change the name and location of a user-configuration file or a key file after
you create them, as long as you use the two files as a pair.
2. When you create an additional user-configuration file, specify the existing key
file.
For example, enter the following command:
java weblogic.Admin -username username -password password
-userconfigfile c:\anotherConfigFile -userkeyfile e:\myKeyFile
STOREUSERCONFIG
Examples
In the following example, a user who is logged in to a UNIX operating system as joe
encrypts the username wlAdmin and password wlPass:
java weblogic.Admin -username wlAdmin -password wlPass
STOREUSERCONFIG
In the following example, the user joe is a System Administrator who wants to create
a user-configuration file for an operating-system account named pat. For the sake of
convenience, joe wants to create the user-configuration file in pat’s home directory,
which will simplify the syntax of the weblogic.Admin commands that pat invokes.
For added security, only one key file exists at joe’s organization, and it is located on
a removable hard drive.
To create a user configuration file in pat’s home directory that is encrypted and
decrypted by a key file name e:\myKeyFile:
java -Duser.name=pat -Duser.home="C:\Documents and Settings\pat"
weblogic.Admin -username wlOperatorPat -password wlOperator1
-userkeyfile e:\myKeyFile
STOREUSERCONFIG
A user who logs in to pat’s account can use the following syntax to invoke
weblogic.Admin commands:
java weblogic.Admin -userkeyfile e:\myKeyFile COMMAND
For information on using user-configuration and key files, see “Summary of User
Credentials Arguments” on page B-5.
THREAD_DUMP
Prints a snapshot of the WebLogic Server threads that are currently running for a
specific server instance. The server instance prints the snapshot to its standard out.
Note: The THREAD_DUMP command is supported only on Sun JVM and JRockit.
Syntax
java weblogic.Admin [Connection and User Credentials Arguments]
THREAD_DUMP
Example
The following example causes a server instance that is running on a host named
ManagedHost to print a thread dump to standard out:
java weblogic.Admin -url ManagedHost:8001 -username weblogic
-password weblogic THREAD_DUMP
The server instance prints a thread dump to its standard out, which, by default, is the
shell (command prompt) within which the server instance is running.
UNLOCK
(Deprecated) Unlocks the specified WebLogic Server after a LOCK operation.
Syntax
java weblogic.Admin [Connection and User Credentials Arguments]
UNLOCK
Argument Definition
username Required. A valid administrative username must be supplied to use this
command.
Example
In the following example, an administrator named adminuser with a password of
gumby1234 requests the unlocking of the WebLogic Server listening on port 7001 on
machine localhost:
java weblogic.Admin -url localhost:7001 -username adminuser
-password gumby1234 UNLOCK
VERSION
Displays the version of the WebLogic Server software that is running on the machine
specified by the value of URL.
Syntax
java weblogic.Admin [Connection and User Credentials Arguments]
VERSION
Example
In the following example, a user requests the version of the WebLogic Server running
on port 7001 on machine localhost:
java weblogic.Admin -url localhost:7001 -username
installadministrator
-password installadministrator VERSION
Note: In this example, the default value of both the username and password
arguments, installadministrator, is used.
For additional information about connection pools see Programming WebLogic JDBC
at http://e-docs.bea.com/wls/docs70/jdbc/index.html and Managing
JDBC Connectivity in the Administration Guide at
http://e-docs.bea.com/wls/docs70/adminguide/jdbc.html.
Create a Dynamic CREATE_POO Allows creation of connection pool while WebLogic Server is
Connection Pool L running. Note that dynamically created connection pools cannot be
used with DataSources or TxDataSources.
See “CREATE_POOL” on page B-41
Destroy a Connection DESTROY_PO Connections are closed and removed from the pool and the pool dies
Pool OL when it has no remaining connections.
See “DESTROY_POOL” on page B-44.
Disable a Connection DISABLE_POO You can temporarily disable a connection pool, preventing any
Pool L clients from obtaining a connection from the pool.
See “DISABLE_POOL” on page B-45.
Enable a Connection ENABLE_POO When a pool is enabled after it has been disabled, the JDBC
Pool L connection states for each in-use connection are exactly as they were
when the connection pool was disabled; clients can continue JDBC
operations exactly where they left off.
See “ENABLE_POOL” on page B-46.
Determine if a EXISTS_POOL Tests whether a connection pool with a specified name exists in the
Connection Pool WebLogic Server. You can use this command to determine whether
Exists a dynamic connection pool has already been created or to ensure that
you select a unique name for a dynamic connection pool you want
to create.
See “EXISTS_POOL” on page B-47.
Resets a Connection RESET_POOL Closes and reopens all allocated connections in a connection pool.
Pool This may be necessary after the DBMS has been restarted, for
example. Often when one connection in a connection pool has
failed, all of the connections in the pool are bad.
See “RESET_POOL” on page B-48.
CREATE_POOL
Allows creation of connection pool while WebLogic Server is running. For more information,
see “Creating a Connection Pool Dynamically” in Programming WebLogic JDBC at
http://e-docs.bea.com/wls/docs70/jdbc/programming.html#programmin
g004.
Syntax
java weblogic.Admin [Connection and User Credentials Arguments]
CREATE_POOL poolName aclName=aclX,
props=myProps,initialCapacity=1,maxCapacity=1,
capacityIncrement=1,allowShrinking=true,shrinkPeriodMins=15,
driver=myDriver,url=myURL
Argument Definition
allowShrinking Indicates whether or not the pool can shrink when connections
are detected to not be in use.
Default = true.
Argument Definition
Example
In the following example, a user with the name weblogic and the password weblogic
runs the CREATE_POOL command to create a dynamic connection pool:
java weblogic.Admin -url localhost:7001 -username weblogic
-password weblogic CREATE_POOL MyPool
initialCapacity=2,maxCapacity=8,
props=user=SCOTT;password=tiger;server=bay816"
DESTROY_POOL
Connections are closed and removed from the pool and the pool dies when it has no
remaining connections.
Syntax
java weblogic.Admin [Connection and User Credentials Arguments]
DESTROY_POOL poolName [true|false]
Argument Definition
Example
In the following example, a user with the name adminuser and the password
gumby1234 runs the DESTROY_POOL command temporarily freeze the active pool
connections:
java weblogic.Admin -url localhost:7001 -username adminuser
-password gumby1234 DESTROY_POOL MyPool false
DISABLE_POOL
You can temporarily disable a connection pool, preventing any clients from obtaining
a connection from the pool.
You have to options for disabling a pool. 1) Freezing the connections in a pool that you
later plan to enable, and 2) destroy the connections.
Syntax
java weblogic.Admin [Connection and User Credentials Arguments]
DISABLE_POOL poolName [true|false]
Argument Definition
false Disables the connection pool, and suspends clients that currently
(disables and have a connection. Attempts to communicate with the database
suspends) server throw an exception. Clients can, however, close their
connections while the connection pool is disabled; the connections
are then returned to the pool and cannot be reserved by another client
until the pool is enabled.
true Disables the connection pool, and destroys the client’s JDBC
(default— connection to the pool. Any transaction on the connection is rolled
disables and back and the connection is returned to the connection pool.
destroys)
Example
In the following example, a user with the name adminuser and the password
gumby1234 runs the DISABLE_POOL command to freeze a connection that is to be
enabled later:
java weblogic.Admin -url localhost:7001 -username adminuser
-password gumby1234 DISABLE_POOL MyPool false
ENABLE_POOL
When a pool is enabled, the JDBC connection states for each in-use connection are
exactly as they were when the connection pool was disabled; clients can continue
JDBC operations exactly where they left off.
Syntax
java weblogic.Admin [Connection and User Credentials Arguments]
ENABLE_POOL poolName
Argument Definition
Example
In the following example, a user with the name adminuser and the password
gumby1234 runs the ENABLE_POOL command to reestablish connections that have
been disabled (frozen):
java weblogic.Admin -url localhost:7001 -username adminuser
-password gumby1234 ENABLE_POOL MyPool
EXISTS_POOL
Tests whether a connection pool with a specified name exists in the WebLogic Server.
You can use this method to determine whether a dynamic connection pool has already
been created or to ensure that you select a unique name for a dynamic connection pool
you want to create.
Syntax
java weblogic.Admin [Connection and User Credentials Arguments]
EXISTS_POOL poolName
Argument Definition
Example
In the following example, a user with the name adminuser and the password
gumby1234 runs the EXISTS_POOL command to determine wether or not a pool with a
specific name exists:
java weblogic.Admin -url localhost:7001 -username adminuser
-password gumby1234 EXISTS_POOL MyPool
RESET_POOL
This command resets the connections in a registered connection pool.
This is a privileged command. You must supply the username and password for the
WebLogic Server administrative user to use this command. You must know the name
of the connection pool, which is an entry in the config.xml file.
Syntax
java weblogic.Admin [Connection and User Credentials Arguments]
RESET_POOL poolName
Argument Definition
URL The URL of the WebLogic Server host and port number of the TCP port at
which WebLogic is listening for client requests; use
"t3://host:port."
Example
This command refreshes the connection pool registered as "demoPool" for the
WebLogic Server instance listening on port 7001 of the host xyz.com.
java weblogic.Admin -url t3://xyz.com:7001 -username system
-password gumby RESET_POOL demoPool
Invoke MBean INVOKE Invokes management operations that an MBean exposes for its
operations underlying resource.
See “INVOKE” on page B-59.
Set property values for SET Sets the specified property values for the named MBean. Returns OK
Administration on stdout when successful. This command cannot be used for
MBeans or Local Runtime MBeans.
Configuration See “SET” on page B-61.
MBeans
weblogic.management.configuration or weblogic.management.runtime
packages. For configuration MBeans, type also refers to whether an instance is an
Administration MBean or a Local Configuration MBean. For a complete list of all
WebLogic Server MBean interface classes, refer to the WebLogic Server Javadoc for
the weblogic.management.configuration or weblogic.management.runtime
packages.
To determine the value that you provide for the -type argument, do the following:
1. Find the MBean’s interface class and remove the MBean suffix from the class name.
For an MBean that is an instance of the
weblogic.management.runtime.JDBCConnectionPoolRuntimeMBean, use
JDBCConnectionPoolRuntime.
2. For a Local Configuration MBean, append Config to the name. For example, for
a Local Configuration MBean that is an instance of the
weblogic.management.configuration.JDBCConnectionPoolMBean
interface class, use JDBCConnectionPoolConfig. For the corresponding
Administration MBean instance, use JDBCConnectionPool.
Specifying Servers
All of the MBean management commands include a -url argument that you use to
specify the WebLogic Server instance that hosts the MBean.
To work with Administration MBeans, you must use the -url argument to specify the
Administration Server. To work with Local Configuration MBeans or Runtime
MBeans, you must use the -url argument to specify the WebLogic Server instance
that hosts the MBeans.
If all of the following conditions are true, you can use weblogic.Admin to access any
MBean in the entire domain:
For example, if all of the above conditions are true, then you can determine the state
of all servers in the domain by issuing the following command:
CREATE
Creates an instance of a WebLogic Server Administration MBean. Returns OK to stdout
when successful. This command cannot be used for Runtime MBeans and we
recommend that you do not use it to create Local Configuration MBeans.
When you use this command to create an Administration MBean instance, WebLogic
Server populates the MBean with default values and saves the MBean’s configuration
in the domain’s config.xml file. WebLogic Server does not create the corresponding
Local Configuration MBean replica until you restart the server instance that hosts the
underlying managed resource. For example, if you create a JDBCConnectionPool
Administration MBean to manage a JDBC connection pool on a Managed Server
named MyServer, you must restart MyServer so that it can create its local replica of
the JDBCConnectionPool Administration MBean that you created. For more
information on MBean replication and the lifecycle of MBeans, refer to "MBeans for
Configuring Managed Resources" in the Programming WebLogic Management
Services with JMX guide.
Syntax
java weblogic.Admin [Connection and User Credentials Arguments]
CREATE –name name –type mbean_type
[–domain domain_name]
Argument Definition
URL The WebLogic Server instance that is the target of the command. For
more information, refer to “Specifying Servers” on page B-50.
name The name you choose for the MBean that you are creating.
mbean_type The type of MBean that you are creating. For more information, refer
to “Specifying MBean Types” on page B-49.
Argument Definition
domain_name Name of the domain in which you want to create the MBean instance.
If domain_name is not specified, the command assumes the domain
to which the target server belongs.
Example
The following example uses the -name and -type arguments to create a
JDBCConnectionPool Administration MBean named MyPool on an Administration
Server:
java weblogic.Admin -url AdminHost:7001 -username weblogic
-password weblogic CREATE -name MyPool -type JDBCConnectionPool
DELETE
Deletes an MBean. If you delete an Administration MBean, WebLogic Server removes
the corresponding entry from the domain’s config.xml file. Returns OK in stdout
when successful.
Note: When you delete an Administration MBean, a WebLogic Server instance does
not delete the corresponding Configuration MBean until you restart the server
instance.
Syntax
java weblogic.Admin [Connection and User Credentials Arguments]
{–type mbean_type|–mbean mbean_name}
Arguments Definition
URL The WebLogic Server instance that is the target of the command. For
more information, refer to “Specifying Servers” on page B-50.
mbean_type Deletes all MBeans of the specified type. For more information, refer to
“Specifying MBean Types” on page B-49.
Example
The following example deletes the JDBCConnectionPool Administration MBean
named MyPool:
java weblogic.Admin -url AdminHost:7001 -username weblogic
-password weblogic DELETE -mbean
MyDomain:Name=MyPool,Type=JDBCConnectionPool
GET
Displays MBean properties (attributes) and JMX object names (in the
WebLogicObjectName format).
Note that the properties and values are expressed as name-value pairs, each of which
is returned within curly brackets. This format facilitates parsing of the output by a
script.
If -pretty is specified, each property-value pair is displayed on a new line and curly
brackets are not used to separate the pairs:
MBeanName: object-name
property1: value
property2: value
.
.
.
MBeanName: object-name
property1: value
abbribute2: value
Syntax
java weblogic.Admin [Connection and User Credentials Arguments]
GET [-pretty] {–type mbean_type|–mbean mbean_name}
[–property property1] [–property property2]...
Argument Definition
URL The WebLogic Server instance that is the target of the command. For
more information, refer to “Specifying Servers” on page B-50.
mbean_type Returns information for all MBeans of the specified type. For more
information, refer to “Specifying MBean Types” on page B-49.
Argument Definition
Example
The following example displays all properties of the JDBCConnectionPool
Administration MBean for a connection pool named MyPool. Note that the command
must connect to the Administration Server to retrieve information from an
Administration MBean:
java weblogic.Admin -url AdminHost:7001 -username weblogic
-password weblogic GET -pretty -mbean
MyDomain:Name=MyPool,Type=JDBCConnectionPool
If the command succeeds, it returns output similar to the following truncated example:
---------------------------
MBeanName: "MyDomain:Name=MyPool,Type=JDBCConnectionPool"
ACLName:
CachingDisabled: true
CapacityIncrement: 1
ConnLeakProfilingEnabled: false
ConnectionCreationRetryFrequencySeconds: 0
ConnectionReserveTimeoutSeconds: 10
...
INVOKE
Invokes a management operation for one or more MBeans. For WebLogic Server
MBeans, you usually use this command to invoke operations other than the
getAttribute and setAttribute that most WebLogic Server MBeans provide.
Syntax
java weblogic.Admin [Connection and User Credentials Arguments]
INVOKE {–type mbean_type|–mbean mbean_name} –method
methodname [argument . . .]
Arguments Definition
URL The WebLogic Server instance that is the target of the command. For more information, refer
to “Specifying Servers” on page B-50.
mbean_type Invokes the operation on all MBeans of a specific type. For more information, refer to
“Specifying MBean Types” on page B-49.
Example
The following example enables a JDBC connection pool by invoking the enable
method of the JDBCConnectionPoolRuntime MBean:
java weblogic.Admin -url AdminHost:7001 -username weblogic
-password weblogic INVOKE
-mbean MyDomain:Location=MyServer,Name=MyPool,
ServerRuntime=MyServer,Type=JDBCConnectionPoolRuntime
-method enable
{MBeanName="MyDomain:Location=MyServer,Name=MyPool,ServerRuntime=
MyServer,Type=JDBCConnectionPoolRuntime"}
Ok
The following example enables all JDBC connection pools in the domain by invoking
the enable method of all the JDBCConnectionPoolRuntime MBeans:
java weblogic.Admin -adminurl AdminHost:7001 -username weblogic
-password weblogic INVOKE
-type JDBCConnectionPoolRuntime -method enable
SET
Sets the specified property (attribute) values for a configuration MBean. Returns OK on
stdout when successful. This command cannot be used for runtime MBeans.
If you use this command for an Administration MBean, the new values are saved to the
config.xml file or the security realm, depending on where the new values have been
defined.
Syntax
java weblogic.Admin [Connection and User Credentials Arguments]
SET {–type mbean_type|–mbean mbean_name}
–property property1 property1_value
[-property property2 property2_value] . . .
Argument Definition
URL The WebLogic Server instance that is the target of the command. For more information,
refer to “Specifying Servers” on page B-50.
mbean_type Sets the properties for all MBeans of a specific type. For more information, refer to
“Specifying MBean Types” on page B-49.
mbean_name Fully qualified object name of an MBean in the WebLogicObjectName format. For
example:
“domain:Type=type,Name=name”
For more information, refer to the Javadoc for WebLogicObjectName.
Argument Definition
Example
The following example sets to 64 the StdoutSeverityLevel property of the local
configuration instance of the ServerMBean for a server named MyServer:
java weblogic.Admin -url http://ManagedHost:8001
-username weblogic -password weblogic
SET -mbean
MyDomain:Location=MyServer,Name=MyServer,Type=ServerConfig
-property StdoutSeverityLevel 64
If the command succeeds, the server instance writes a log message similar to the
following:
<Sep 16, 2001 12:11:27 PM EDT> <Info> <Logging> <000000> <Log
messages of every severity will be displayed in the shell console.>
1. To determine the object name of the MS1 WebLogic Server instance, enter the
following command:
java weblogic.Admin -url http://AdminHost:7001
-username weblogic -password weblogic
GET -type Server
Because the -url argument specifies the Administration Server, the command
returns a Server Administration MBean for all server instances in the domain.
The output includes the object name for ServerMBean that represents MS1:
MBeanName: "examples:Name=MS1,Type=Server"
AcceptBacklog: 50
AdministrationPort: 0
AutoKillIfFailed: false
.
.
.
2. To determine the object name of the JDBC Connection Pool that you want to
target, enter the following command:
java weblogic.Admin -url http://AdminHost:7001
-username weblogic -password weblogic
GET -type JDBCConnectionPool
You can use the weblogic.Admin utility to invoke operations on the following types
of Authentication providers:
By default, all security realms use this Authentication provider to manage users
and groups.
The following sections describe basic tasks for managing users and groups with the
weblogic.Admin utility:
For information about additional tasks that the AuthenticationProvider and the
optional MBeans support, refer to the Javadoc for the
weblogic.management.security.authentication package.
BEA recommends that you follow a similar convention when you create your own
Authentication providers:
Security:Name=realmNameAuthenticatorName
If you use the Administration Console to add an Authentication provider to the realm,
your AuthenticationProviderMBean name will follow the recommended naming
convention.
Creating a User
To create a user, invoke the UserEditorMBean.createUser method, which is
extended by the security realm’s AuthenticationProvider MBean. See the Javadoc
for the createUser method.
Separate the parameters with a space. If any parameter contains a space, surround it
with quotes.
where boolean specifies whether the command searches within child groups. If you
specify true, the command returns true if the member belongs to the group that you
specify or to any of the groups contained within that group.
If the user is a member of the group, the command prints true to standard out.
where limited specifies whether the command searches within one or more levels of
a nested group hierarchy. If you specify a limited search, the
MaxGroupMembershipSearchLevel attribute must be specified. The default is an
unlimited search.
For example, when searching for membership in Group A, 0 indicates that only direct
members of Group A will be found. If Group B is a member of Group A, the members
of Group B will not be found by this search. If the attribute is set to 1, a search for
membership in Group A will return direct members of Group A and any members of
groups which are direct members of Group A. If Group B is a member of Group A, the
members of Group B will also be found by this search. However, if Group C is a
member of Group B, the members of Group C will not be found by this search.
The following sections describe how to start and stop WebLogic Server instances and
configure WebLogic Server domains using WebLogic Ant tasks:
“Overview of Configuring and Starting Domains Using Ant Tasks” on page C-1
“Starting Servers and Creating Domains Using the wlserver Ant Task” on page
C-2
“Configuring a WebLogic Server Domain Using the wlconfig Ant Task” on page
C-7
Notes: The WebLogic Server Ant tasks are incompatible with Ant versions prior to
1.5. Also, if you use a version of Ant that is not included with WebLogic
Server, you must specify the appropriate task definition in your build.xml
file, as described in the sections that follow.
When combined with other WebLogic Ant tasks, you can create powerful build scripts
for demonstrating or testing your application with custom domains. For example, a
single Ant build script can:
Create a new single-server domain and start the Administration Server using the
wlserver Ant task.
Configure the new domain with required application resources using the
wlconfig Ant task.
The sections that follow describe how to use the configuration Ant tasks, wlserver
and wlconfig. For more information about the wldeploy task, see wldeploy Ant Task
in Developing WebLogic Server Applications.
When you use the wlserver task in an Ant script, the task does not return control until
the specified server is available and listening for connections. If you start up a server
instance using wlserver, the server process automatically terminates after the Ant VM
terminates. If you only connect to a currently-running server using the wlserver task,
the server process keeps running after Ant completes.
2. Add a call to the wlserver task in the build script to start, shutdown, restart, or
connect to a server. See “wlserver Ant Task Reference” on page C-5 for
information about wlserver attributes and default behavior.
3. Execute the Ant task or tasks specified in the build.xml file by typing ant in
the staging directory, optionally passing the command a target argument:
prompt> ant
Use ant -verbose to obtain more detailed messages from the wlserver task.
This target connects to an existing, running server using the indicated connection
parameters and username/password combination:
<target name="connect-server">
<wlserver host="127.0.0.1" port="7001" username="weblogic"
password="weblogic" action="connect"/>
</target>
This target starts a WebLogic Server instance configured in the config subdirectory:
<target name="start-server">
<wlserver dir="./config" host="127.0.0.1" port="7001"
action="start"/>
</target>
This target creates a new single-server domain in an empty directory, and starts the
domain’s server instance:
<target name="new-server">
<delete dir="./tmp"/>
<mkdir dir="./tmp"/>
<wlserver dir="./tmp" host="127.0.0.1" port="7001"
generateConfig="true" username="weblogic" password="weblogic"
action="start"/>
</target>
policy The path to the security policy file for the WebLogic File No
Server domain. This attribute is used only for starting
server instances.
dir The path that holds the domain configuration (for File No
example, c:\bea\user_projects\mydomain). By
default, wlserver uses the current directory.
beahome The path to the BEA home directory (for example, File No
c:\bea).
servername The name of the server to start, reboot, or connect to. String No
domainname The name of the WebLogic Server domain in which the String No
server is configured.
adminserverurl The URL to access the Administration Server in the String Required for
domain. This attribute is required if you are starting up a starting
Managed Server in the domain. Managed
Servers.
pkpassword The private key password for decrypting the SSL private String No
key file.
timeout The maximum time, in seconds, that wlserver waits for long No
a server to boot. This also specifies the maximum amount
of time to wait when connecting to a running server.
host The DNS name or IP address on which the server instance String No
is listening.
port The TCP port number on which the server instance is int No
listening.
Create new MBeans, optionally storing the new MBean Object Names in Ant
properties.
Create MBeans and set their attributes in one step by nesting set attribute
commands within create MBean commands.
Query MBeans, optionally storing the query results in an Ant property reference.
3. Add an initial call to the wlconfig task to connect to the Administration Server
for a domain. For example:
<target name=”doconfig”>
<wlconfig url="t3://localhost:7001" username="weblogic"
password="weblogic">
</target>
4. Add nested create, delete, get, set, and query elements to configure the
domain.
5. Execute the Ant task or tasks specified in the build.xml file by typing ant in
the staging directory, optionally passing the command a target argument:
prompt> ant doconfig
Use ant -verbose to obtain more detailed messages from the wlconfig task.
The script then starts the wlconfig task by accessing the newly-created server:
<wlconfig url="t3://localhost:7000" username="a" password="a">
Within the wlconfig task, the query element runs a query to obtain the Server MBean
object name, and stores this MBean in the ${sampleserver} Ant property:
<query domain="sample" type="Server" name="SampleServer"
property="sampleserver"/>
The script the uses a create element to create a new JDBC connection pool in the
domain, storing the object name in the ${samplepool} Ant property. Nested set
elements in the create operation set attributes on the newly-created MBean. The new
pool is target to the server using the ${sampleserver} Ant property set in the query
above:
<create type="JDBCConnectionPool" name="SamplePool"
property="samplepool">
<set attribute="CapacityIncrement" value="1"/>
<set attribute="DriverName"
value="com.pointbase.jdbc.jdbcUniversalDriver"/>
<set attribute="InitialCapacity" value="1"/>
<set attribute="MaxCapacity" value="10"/>
<set attribute="Password" value="samplename"/>
<set attribute="Properties" value="user=samplepwd"/>
<set attribute="RefreshMinutes" value="0"/>
<set attribute="ShrinkPeriodMinutes" value="15"/>
<set attribute="ShrinkingEnabled" value="true"/>
<set attribute="TestConnectionsOnRelease" value="false"/>
<set attribute="TestConnectionsOnReserve" value="false"/>
<set attribute="URL"
value="jdbc:pointbase:server://localhost/demo"/>
<set attribute="Targets" value="${sampleserver}"/>
</create>
Next, the script creates a JDBC TX DataSource using the JDBC connection pool
created above:
<create type="JDBCTxDataSource" name="Medical Records Tx
DataSource">
<set attribute="JNDIName" value="SampleTxDataSource"/>
<set attribute="PoolName" value="SamplePool"/>
<set attribute="Targets" value="${sampleserver}"/>
</create>
The script creates a new JMS connection factory using nested set elements:
<create type="JMSConnectionFactory" name="Queue">
<set attribute="JNDIName"
value="jms/QueueConnectionFactory"/>
<set attribute="XAServerEnabled" value="true"/>
When creating a new JMS server, the script uses a nested create element to create a
JMS queue, which is the child of the JMS server:
<create type="JMSServer" name="SampleJMSServer">
<set attribute="Store" value="${samplejdbcstore}"/>
<set attribute="Targets" value="${sampleserver}"/>
<create type="JMSQueue" name="Registration Queue">
<set attribute="JNDIName"
value="jms/REGISTRATION_MDB_QUEUE"/>
</create>
</create>
</create>
Finally, the script obtains the WebServer MBean and sets the log filename using a
nested set element:
<query domain="sample" type="WebServer" name="SampleServer">
<set attribute="LogFileName" value="logs/access.log"/>
</query>
</wlconfig>
</target>
<target name="queryDelete">
<wlconfig url="${adminurl}" username="${user}"
password="${pass}"
failonerror="false">
<query query="${wlsdomain}:Name=MyNewServer2,*"
property="deleteQuery">
<delete/>
</query>
</wlconfig>
</target>
Note: Separate multiple values with a comma (,) not a semi-colon (;) .
userkeyfile Specifies the location of a user key file to use for File No
encrypting and decrypting the username and password
information stored in a user configuration file (the
userconfigfile attribute). Before specifying the
userkeyfile attribute, you must first generate the key
file using the weblogic.Admin STOREUSERCONFIG
command.
Nested Elements
wlconfig also has several elements that can be nested to specify configuration
options:
create
delete
set
get
query
create
The create element creates a new MBean in the WebLogic Server domain. The
wlconfig task can have any number of create elements.
A create element can have any number of nested set elements, which set attributes
on the newly-created MBean. A create element may also have additional, nested
create elements that create child MBeans.
delete
The delete element removes an existing MBean from the WebLogic Server domain.
delete takes a single attribute:
mbean The object name of the MBean to String Required when the
delete. delete element is a direct
child of the wlconfig
task. Not required when
nested within a query
element.
set
The set element sets MBean attributes on a named MBean, a newly-created MBean,
or on MBeans retrieved as part of a query. You can include the set element as a direct
child of the wlconfig task, or nested within a create or query element.
value The value to set for the specified MBean attribute. String Yes
You can specify multiple object names (stored in
Ant properties) as a value by delimiting the entire
value list with quotes and separating the object
names with a semicolon. See “Example of Setting
Multiple Attribute Values” on page C-11.
mbean The object name of the MBean whose values are String Required
being set. This attribute is required only when the only when
set element is included as a direct child of the the set
main wlconfig task; it is not required when the element is a
set element is nested within the context of a direct child
create or query element. of the
wlconfig
task.
domain This attribute specifies the JMX domain name for String No
Security MBeans and third-party SPI MBeans. It
is not required for administration MBeans, as the
domain corresponds to the WebLogic Server
domain.
get
The get element retrieves attribute values from an MBean in the WebLogic Server
domain. The wlconfig task can have any number of get elements.
attribute The name of the MBean attribute whose value you String Yes
want to retrieve.
property The name of an Ant property that will hold the String Yes
retrieved MBean attribute value.
mbean The object name of the MBean you want to String Yes
retrieve attribute values from.
query
The query elements finds MBean that match a search pattern. query can be used with
nested set elements or a nested delete element to perform set or delete operations on
all MBeans in the result set.
domain This attribute specifies the JMX domain name for String No
Security MBeans and third-party SPI MBeans. It
is not required for administration MBeans, as the
domain corresponds to the WebLogic Server
domain.
The WebLogic SNMP agent provides a command-line interface that enables you to:
Retrieve the value of WebLogic Server attributes that are exposed as managed
objects in the WebLogic Server MIB.
The following sections describe working with the WebLogic SNMP agent through its
command-line interface:
For more information about using SNMP with WebLogic Server, refer to the
WebLogic SNMP Management Guide.
Environment
To set up your environment for the WebLogic SNMP agent’s command-line interface:
1. Install and configure the WebLogic Server software, as described in the WebLogic
Server Installation Guide. See
http://e-docs.bea.com/wls/docs70/install/index.html.
Note: The snmpv1trap and snmptrapd commands do not require the SNMP
agent to be enabled.
Common Arguments
All WebLogic SNMP agent commands take the following form:
Table D-1 describes arguments that are common to most WebLogic SNMP agent
commands.
-c snmpCommunity Specifies the community name that the WebLogic SNMP agent uses to secure
[@server_name | SNMP data and specifies the server instance that hosts the objects with which
@domain_name ] you want to interact.
To request the value of an object on the Administration Server, specify:
snmpCommunity
where snmpCommunity is the SNMP community name that you set in the
Community Prefix field when you configured the SNMP agent (as described
in "Setting Up the WebLogic SNMP Agent" in the Administration Console
Online Help).
To request the value of an object on a Managed Server, specify:
snmpCommunity@server_name
where server_name is the name of the Managed Server.
To request the value of an object for all server instances in a domain, send a
community string with the following form:
snmpCommunity@domain_name
If you do not specify a value, the command assumes -c public, which
attempts to retrieve the value of an object that is on the Administration Server.
-p snmpPort Specifies the port number on which the WebLogic SNMP agent listens for
requests.
If you do not specify a value, the command assumes -p 161.
-r retries Specifies the number of times the command retries unsuccessful attempts to
connect to the SNMP agent.
If you do not specify a value, the command exits on the first unsuccessful
attempt.
host Specifies the DNS name or IP address of the computer that hosts the
WebLogic Server Administration Server, which is where the WebLogic
SNMP agent runs.
Table D-2 Overview of Commands for Retrieving the Value of WebLogic Server Attributes
Command Description
snmpwalk Returns a recursive list of all managed objects that are below a specified node in the
MIB tree.
See “snmpwalk” on page D-5.
snmpgetnext Returns a description of the managed object that immediately follows an OID that
you specify.
See “snmpgetnext” on page D-7.
snmpwalk
Returns a recursive list of all managed objects that are below a specified node in the
MIB tree.
If you specify the OID for an object type, the command returns a list of all instances
of that type along with all instances of any child object types.
For example, if you specify the OID for an object type that corresponds to an MBean,
this command returns a description of all instances of the MBean and all instances of
the attributes within the MBeans.
To see the WebLogic Server MIB tree, refer to the WebLogic Server SNMP MIB
Reference. For more information about the structure of the MIB and its object
identifiers (OIDs), refer to “SNMP MIB for WebLogic” in WebLogic SNMP
Management Guide.
Syntax
java snmpwalk [-d] [-c snmpCommunity] [-p snmpPort]
[-t timeout] [-r retries] host OID
Argument Definition
OID Specifies the object ID of the node from which you want to retrieve a recursive
list of object values.
Start the value with '.'; otherwise, references are assumed to be relative to the
standard MIB ( .1.3.6.1.2.1), not the WebLogic Server MIB.
For information about the command arguments that are not listed in the above table,
refer to Table D-1, “Common Command Line Arguments,” on page D-3.
Example
The following example returns all attributes of the ServerRuntimeMBean instance
that is hosted on the Administration Server. Note that the OID
.1.3.6.1.4.1.140.625.360 refers to the serverRuntimeTable object type in the
WebLogic MIB.
If you invoke this command from a computer that is running the Examples Server, the
command returns output similar to the following truncated output. Note that the output
includes the full OID for each attribute instance below the serverRuntimeTable
object.
Object ID:
.1.3.6.1.4.1.140.625.360.1.1.32.101.98.52.50.55.97.53.101.55.101.
56.97.51.98.97.52.99.97.57.53.100.51.51.98.102.51.98.57.48.98.51.
55
STRING: eb427a5e7e8a3ba4ca95d33bf3b90b37
Object ID:
.1.3.6.1.4.1.140.625.360.1.5.32.101.98.52.50.55.97.53.101.55.101.
56.97.51.98.97.52.99.97.57.53.100.51.51.98.102.51.98.57.48.98.51.
55
STRING: ServerRuntime:examplesServer
Object ID:
.1.3.6.1.4.1.140.625.360.1.10.32.101.98.52.50.55.97.53.101.55.101
.56.97.51.98.97.52.99.97.57.53.100.51.51.98.102.51.98.57.48.98.51
.55
STRING: ServerRuntime
Object ID:
.1.3.6.1.4.1.140.625.360.1.15.32.101.98.52.50.55.97.53.101.55.101
.56.97.51.98.97.52.99.97.57.53.100.51.51.98.102.51.98.57.48.98.51
.55
STRING: examplesServer
...
The following example retrieves the name of all servers in the examples domain. The
OID specified in the example command is the numerical value that the WebLogic
Server MIB assigns to the serverRuntimeName object type.
java snmpwalk -c public@examples localhost
.1.3.6.1.4.1.140.625.360.1.15
snmpgetnext
Returns a description of the managed object that immediately follows one or more
OIDs that you specify.
Instead of the recursive listing that the snmpwalk command provides, this command
returns the description of only the one managed object whose OID is the next in
sequence. You could string together a series of snmpgetnext commands to achieve
the same result as the snmpwalk command.
If you specify an object type, this command returns the first instance of the object type,
regardless of how many instances of the type exist.
To see the WebLogic Server MIB tree, refer to the WebLogic Server SNMP MIB
Reference. For information about the structure of the MIB and its object identifiers
(OIDs), refer to “SNMP MIB for WebLogic” in WebLogic SNMP Management Guide.
Syntax
java snmpgetnext [-d] [-c snmpCommunity] [-p snmpPort]
[-t timeout] [-r retries] host OID [OID]...
Argument Definition
OID [OID]... Specifies one or more object IDs. You can specify an OID for an object type
or an object instance.
Start the values with '.'; otherwise, references are assumed to be relative to the
standard MIB ( .1.3.6.1.2.1), not the WebLogic Server MIB.
For information about the command arguments that are not listed in the above table,
refer to Table D-1, “Common Command Line Arguments,” on page D-3.
Example
The following example retrieves the name of an application that has been deployed on
the Administration Server. The OID in the example command is for the
applicationRuntimeName object type, which represents the Name attribute of the
applicationRuntime MBean.
The following example specifies two OIDs to retrieve the name of an application that
has been deployed on the Administration Server and the name of a JDBC connection
pool. The OIDs in the example command are for the applicationRuntimeName
object type, which represents the Name attribute of the ApplicationRuntime MBean,
and jdbcConnectionPoolRuntimeName, which represents the Name attribute of the
JDBCConnectionPoolRuntimeMBean.
99
STRING: MyPool
snmpget
Retrieves the value of one or more object instances. This command does not accept
OIDs for object types.
Syntax
java snmpget [-d] [-c snmpCommunity] [-p snmpPort]
[-t timeout] [-r retries] host object-instance-OID
[object-instance-OID]...
Argument Definition
object-instance-OID The object ID of an object instance. This command does not accept OIDs for
[object-instance-OID]... object types.
Start the value with '.'; otherwise, references are assumed to be relative to the
standard MIB, not the WebLogic Server MIB.
Example
The following example retrieves the value of the serverRuntimeState and
serverRuntimeListenPort attribute instances for the Administration Server.
Table D-3 Overview of Commands for Retrieving Information about WebLogic Server
Command Description
snmpv1trap Constructs an SNMPv1 trap and distributes it to the SNMP manager or trap
daemon that is running on the specified host and listening on the specified
port number.
See “snmpv1trap” on page D-12.
snmptrapd Starts a daemon that receives traps and prints information about the trap.
See “snmptrapd” on page D-15.
snmpv1trap
Constructs an SNMPv1 trap and distributes it to the SNMP manager or trap daemon
that is running on the specified host and listening on the specified port number. For
more information about the trap daemon, refer to “snmptrapd” on page D-15.
As part of invoking this command, you specify the value for fields within the trap
packet that you want to send. The values that you specify must resolve to traps that are
defined in the WebLogic Server MIB. For information about WebLogic Server traps
and the fields that trap packets require, refer to “Format of WebLogic Trap
Notifications” in the WebLogic SNMP Management Guide.
Syntax
java snmpv1trap [-d] [-c snmpCommunity] [-p TrapDestinationPort]
TrapDestinationHost .1.3.6.1.4.140.625
agent-addr generic-trap specific-trap timestamp
[OID {INTEGER | STRING | GAUGE | TIMETICKS | OPAQUE |
IPADDRESS | COUNTER} value] ...
Argument Definition
-c snmpCommunity Specifies a password (community name) that secures the data in the trap.
If you do not specify a value, the command assumes -c public.
-p TrapDestinationPort Specifies the port number on which the SNMP manager or trap daemon is
listening.
If you do not specify a value, the command assumes -p 162.
TrapDestinationHost Specifies the DNS name or IP address of the computer that hosts the SNMP
manager or trap daemon.
.1.3.6.1.4.140.625 Specifies the value of the trap’s enterprise field, which contains the
beginning portion of the OID for all WebLogic Server traps.
Argument Definition
generic-trap Specifies the value of the trap’s generic trap type field.
For a list of valid values, refer to “Format of WebLogic Trap Notifications” in
the WebLogic SNMP Management Guide.
specific-trap Specifies the value of the trap’s specific trap type field.
For a list of valid values, refer to “Format of WebLogic Trap Notifications” in
the WebLogic SNMP Management Guide.
OID {INTEGER | STRING | (Optional) Specifies the value of the trap’s variable bindings field,
GAUGE | TIMETICKS | which consists of name/value pairs that further describe the trap notification.
OPAQUE | IPADDRESS | For each name/value pair, specify an OID, a value type, and a value.
COUNTER} value
For example, a log message trap includes a trapTime binding to indicate the
time at which the trap is generated. To include this variable binding in the test
trap that you generate, specify the OID for the trapTime variable binding,
the STRING keyword, and a string that represents the time:
.1.3.6.1.4.1.140.625.100.5 STRING “2:00 pm”
Example
The following example generates a log message trap that contains the trapTime and
trapServerName variable bindings. It broadcasts the trap through port 165. In the
example:
6 is the generic trap value that specifies “other WebLogic Server traps.”
60 is the specific trap value that WebLogic Server uses to identify log message
traps.
The SNMP manager (or trap daemon) that is listening at port number 165 receives the
trap. If the trap daemon is listening on 165, it returns the following:
Trap received from: /127.0.0.1, community: public
Enterprise: .1.3.6.1.4.140.625
Agent: /127.0.0.1
TRAP_TYPE: 6
SPECIFIC NUMBER: 60
Time: 1000
VARBINDS:
Object ID: .1.3.6.1.4.1.140.625.100.5
STRING: 2:00 pm
Object ID: .1.3.6.1.4.1.140.625.100.10
STRING: localhost
snmptrapd
Starts a daemon that receives traps and prints information about the trap.
Syntax
java snmpv1trap [-d] [-c snmpCommunity] [-p TrapDestinationPort]
Argument Definition
-c snmpCommunity Specifies that community name that the SNMP agent (or snmpv1trap
command) used to generate the trap.
If you do not specify a value, the command assumes -c public.
-p TrapDestinationPort Specifies the port number on which the trap daemon receives traps.
If you do not specify a value, the command assumes -p 162.
Example
The following command starts a trap daemon and instructs it to listen for requests on
port 165. The daemon runs in the shell until you kill the process or exit the shell:
If the command succeeds, the trap daemon returns a blank line with a cursor. The trap
daemon waits in this state until it receives a trap, at which point it prints the trap.
In the shell in which the trap daemon is running, the daemon prints the following:
Trap received from: /127.0.0.1, community: public
Enterprise: .1.3.6.1.4.140.625
Agent: /127.0.0.1
TRAP_TYPE: 6
SPECIFIC NUMBER: 60
Time: 1000
VARBINDS: