bea.com | products | dev2dev | support | askBEA
 Download Docs   Site Map   Glossary 
Search

WebLogic Server Command Reference

 Previous Next Contents Index View as PDF  

weblogic.Admin Command-Line Reference

The weblogic.Admin utility is a command-line interface that you can use to administer, configure, and monitor WebLogic Server.

Like the Administration Console, this utility assumes the role of client that invokes administrative operations on the Administration Server, which is the central management point for all servers in a domain. (All Managed Servers retrieve configuration data from the Administration Server, and the Administration Server can access runtime data from all Managed Servers.) While the Administration Console interacts only with the Administration Server, the weblogic.Admin utility can access the Administration Server as well as all active server instances directly. If the Administration Server is down, you can still use the weblogic.Admin utility to retrieve runtime information from Managed Servers and invoke some administrative commands. However, you can save configuration changes to the domain's config.xml file only when you access the Administration Server.

To automate administrative tasks, you can invoke the weblogic.Admin utility from shell scripts. If you plan to invoke this utility multiple from a shell script, consider using the BATCHUPDATE command, which is described in Running Commands in Batch Mode.

The following sections describe using the weblogic.Admin utility:

 


Required Environment and Syntax for the weblogic.Admin Utility

Before you use the weblogic.Admin utility, set up your environment and note command syntax information as described in the following sections.

Environment

To set up your environment for the weblogic.Admin utility:

  1. Install and configure the WebLogic Server software, as described in the WebLogic Server Installation Guide
  2. Add WebLogic Server classes to the CLASSPATH environment variable. See Setting the Classpath
  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 "Enabling the Domain-Wide Administration Port" in the Administration Console Online Help.

    The domain-wide administration port is secured by SSL. For information about using secured ports with the weblogic.Admin utility, refer to Java Options for SSL Communication.

Note: If a server instance is deadlocked, it can respond to weblogic.Admin commands only if you have enabled the domain-wide administration port. If you have not already enabled the domain-wide administration port, your only option is to shut down the server instance by killing the Java process that is running the server. You will lose all session data. For information on enabling the domain-wide administration port, refer to "Enabling the Domain-Wide Administration Port" in the Administration Console Online Help.

Syntax

java [-Dweblogic.security.SSL.ignoreHostnameVerify=true]
[-Dweblogic.security.TrustKeyStore=DemoTrust]
weblogic.Admin [ [-url | -adminurl] [protocol://]listen-address:port]
-username username -password password
COMMAND-NAME arguments

The command names and arguments are not case sensitive.

The following sections provide additional syntax information:

Java Options for SSL Communication

If you connect to a server instance through a secured port (such as the domain-wide administration port), note the following:

Protocol Support

The -url and -adminurl arguments of the weblogic.Admin utility support the t3, t3s, http, and https protocols.

If you want to use http or https to connect to a server instance, you must enable HTTP Tunneling for that instance. For more information, refer to "Configuring the HTTP Protocol" in the Administration Console Online Help.

If you use the -url argument to specify a non-secured port, the weblogic.Admin utility uses t3 by default. For example, java weblogic.Admin -url localhost:7001 resolves to java weblogic.Admin -url t3://localhost:7001.

If you use either the -url or -adminurl argument to specify a port that is secured by SSL, you must specify either t3s or https. For example, if you enable the default SSL listen port, you can use the following URLs: -url t3s://MyHost:7002 or -url https://MyHost:7002.

Common Arguments

Table 1-1 describes arguments that are common to most commands.

Table 1-1 Common Arguments

Argument

Definition

-url [protocol://]listen-address:listen-port

The listen address and listen port of the server instance that runs the command.

In most cases, you should specify the Administration Server's address and port, which is the central management point for all servers in a domain. Some commands, such as START, CREATE_POOL, and CREATE, must run on the Administration Server. The documentation for each command indicates whether this is so.

If you specify a Managed Server's listen address and port, the command can access data only for that server instance; you cannot run a command on one Managed Server to view or change data for another server instance.

When you use MBean-related commands, you must specify the Administration Server's listen address and port to access Administration MBeans. To access Local Configuration MBeans or Runtime MBeans, you can specify the server instance on which the MBeans reside. (However, the -adminurl argument can also retrieve Local Configuration MBeans or Runtime MBeans from any server.) For more information on where MBeans reside, refer to "WebLogic Server Managed Resources and MBeans" in the Programming WebLogic Management Services with JMX guide.

To use a listen port that is not secured by SSL, the format is -url [protocol://]listen-address:port

To use a port that is secured by SSL, the format is -url secure-protocol://listen-address:port

If you have set up a domain-wide administration port, you must specify the administration port number: -url secure-protocol://listen-address:domain-wide-admin-port

For information about valid values for protocol and secure-protocol, refer to Protocol Support.

For more information about the listen address and listen ports, refer to -Dweblogic.ListenAddress=host and -Dweblogic.ListenPort= portnumber.

For more information about the domain-wide administration port, refer to "Enabling the Domain-Wide Administration Port" in the Administration Console Online Help.

The default value for this argument is t3://localhost:7001.

-adminurl [protocol://]Admin-Server-listen-address:listen-port

Enables the Administration Server to retrieve Local Configuration MBeans or Runtime MBeans for any server instance in the domain. For information about types of MBeans, refer to "WebLogic Server Managed Resources and MBeans" in the Programming WebLogic Management Services with JMX guide.

For all commands other than the MBean commands, -adminurl admin-address and -url admin-address are synonymous.

Note: If you use the -url argument to specify the Administration Server (instead of using the -adminurl argument), you can retrieve only the Local Configuration MBeans and Runtime MBeans for the Administration Server itself.

The -adminurl value must specify the listen address and listen port of the Administration Server.

To use a port that is not secured by SSL, the format is -adminurl [protocol]Admin-Server-listen-address:port.

To use a port that is secured by SSL, the format is -adminurl secure-protocol://Admin-Server-listen-address:port

If you have set up a domain-wide administration port, you must specify the administration port number: -adminurl secure-protocol://Admin-Server-listen-address:domain-wide-admin-port

For information about valid values for protocol and secure-protocol, refer to Protocol Support.

There is no default value for this argument.

-username username

The name of the user who is issuing the command. This user must have appropriate permission to view or modify the target of the command.

For information about permissions for system administration tasks, refer to "Protecting System Administration Operations" in the Configuring and Managing WebLogic Server guide.

-password password

The password that is associated with the username.

Example Environment

In many of the examples throughout the sections that follow, it is assumed that a certain environment has been set up:

 


Exit Codes Returned by weblogic.Admin

All weblogic.Admin commands return an exit code of 0 if the command succeeds and an exit code of 1 if the command fails.

To view the exit code from a Windows command prompt, enter echo %ERRORLEVEL% after you run a weblogic.Admin command. To view the exit code in a BASH shell, enter echo $?.

For example:

D:\>java weblogic.Admin -username weblogic -password weblogic GET -pretty -mbean "MedRec:Name=MyServer,Type=Server" -property ListenPort
---------------------------
MBeanName: "MedRec:Name=MyServer,Type=Server"
ListenPort: 7010
D:\>echo %ERRORLEVEL%
0

 


Commands for Managing the Server Life Cycle

Table 1-2 is an overview of commands that manage the life cycle of a server instance. Subsequent sections describe command syntax and arguments, and provide an example for each command. For more information about the life cycle of a server instance, refer to "Server Life Cycle" in the Configuring and Managing WebLogic Server guide.

Table 1-2 Overview of Commands for Managing the Server Life Cycle 

Command

Description

DISCOVERMANAGEDSERVER

Causes the Administration Server to re-establish its administrative control over Managed servers.

See DISCOVERMANAGEDSERVER.

FORCESHUTDOWN

Immediately terminates a WebLogic Server process.

See FORCESHUTDOWN.

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.

See LOCK.

RESUME

Makes a server available to receive requests from external clients.

See RESUME.

SHUTDOWN

Shuts down a WebLogic Server.

See SHUTDOWN.

START

Uses a configured Node Manager to start a Managed Server in the RUNNING state.

See START.

STARTINSTANDBY

Uses a configured Node Manager to start a Managed Server and place it in the STANDBY state.

See STARTINSTANDBY.

UNLOCK

(Deprecated) Unlocks the specified WebLogic Server after a LOCK operation.

See UNLOCK.

 


CANCEL_SHUTDOWN

(Deprecated) The CANCEL_SHUTDOWN command cancels the SHUTDOWN command for a specified WebLogic Server.

When you use the SHUTDOWN 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.

See SHUTDOWN and UNLOCK.

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 "Controlling Graceful Shutdowns" and "Setting the Timeout Period for Forced Shutdown Operations" in the Administration Console Online Help.

Syntax

java weblogic.Admin [-url URL] 
-username username -password password
CANCEL_SHUTDOWN

Example

The following example cancels the shutdown of a WebLogic Server instance that runs on a machine named ManagedHost and listens on port 8001:

java weblogic.Admin -url ManagedHost:8001 -username weblogic 
-password weblogic CANCEL_SHUTDOWN

For more information about the environment in which this example runs, refer to Example Environment.

 


DISCOVERMANAGEDSERVER

Causes the Administration Server to re-establish administrative control over Managed Servers.

If the Administration Server fails while Managed Servers continue to run, or if you shut down the Administration Server while Managed Servers continue to run, you lose the ability to change the configuration or deploy modules to any server in the domain. To regain this administrative ability, you must restart the Administration Server. If you start an Administration Server in Production Mode, during its startup cycle it finds the last known set of Managed Servers and re-establishes a connection. For more information about discovering Managed Servers during an Administration Server's startup cycle, refer to the -Dweblogic.management.discover entry in Table 3-3 on page 9.

If the Administration Server is unable to automatically re-establish a connection to one or more Managed Servers during its startup cycle, you must use this command to re-establish administrative control.

The following situations can prevent the Administration Server from discovering a Managed Server:

Other factors can prevent the Administration Server from finding and re-connecting to Managed Servers, and you can use this command any time you need to re-establish a connection.

Syntax

java weblogic.Admin [-url URL] 
-username username -password password
DISCOVERMANAGEDSERVER [-serverName targetServer]

Argument

Definition

-url [protocol://]listen-address:listen-port

Specify the listen address and listen port of the Administration Server.

If you specify a secure listen port, you must also specify a secure protocol.

If you do not specify a value, the command assumes t3://localhost:7001.

For more information, refer to the -url entry in Table 1-1 on page 5 and Protocol Support.

-serverName

A Managed Server that is currently running.

If you do not specify a server, the Administration Server will discover and re-establish control over all the Managed Servers that are known to be running but disconnected from administrative services


 

Example

The following command instructs the Administration Server to re-connect to a Managed Server:

java weblogic.Admin -url AdminHost:7001 -username weblogic 
-password weblogic DISCOVERMANAGEDSERVER MedRecManagedServer

For more information about the environment in which this example runs, refer to Example Environment.

 


FORCESHUTDOWN

Immediately terminates a server instance.

When you initiate a forced shutdown, the server instructs subsystems to immediately drop in-work requests. For more information, refer to "Forced Shutdown" in the Configuring and Managing WebLogic Server guide.

If a server instance is in a deadlocked state, it can respond to weblogic.Admin commands only if you have enabled the domain-wide administration port. (A deadlocked server is one in which all threads are struck trying to acquire locks held by other threads.) If you have not already enabled the domain-wide administration port, your only option for shutting down the server instance is to kill the Java process that is running the server. You will lose all session data. For information on enabling the domain-wide administration port, refer to "Enabling the Domain-Wide Administration Port" in the Administration Console Online Help.

Syntax

java weblogic.Admin [-url URL] 
-username username -password password
FORCESHUTDOWN [targetServer]

Argument

Definition

-url [protocol://]listen-address:listen-port

Specify the listen address and listen port of the Administration Server.

If the Administration Server is not available, specify the listen address and listen port of the server instance that you want to shut down and omit the targetServer argument.

If you specify a secure listen port, you must also specify a secure protocol.

If you do not specify a value, the command assumes t3://localhost:7001.

For more information, refer to the -url entry in Table 1-1 on page 5 and Protocol Support.

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.


 

Example

The following command instructs the Administration Server to shut down a Managed Server:

java weblogic.Admin -url AdminHost:7001 -username weblogic 
-password weblogic FORCESHUTDOWN MedRecManagedServer

After you issue the command, MedRecManagedServer prints messages to its log file and to its standard out. The messages indicate that the server state is changing and that the shutdown sequence is starting.

If the command succeeds, the final message that the target server prints is as follows:

<Oct 12, 2002 11:28:59 AM EDT> <Alert> <WebLogicServer> <000219> <The shutdown sequence has been initiated.> 

In addition, if the command succeeds, the weblogic.Admin utility returns the following:

Server "MedRecManagedServer" was force shutdown successfully ...

For more information about the environment in which this example runs, refer to Example Environment.

In the following example, the Administration Server is not available, so the command instructs the Managed Server to shut itself down:

java weblogic.Admin -url ManagedHost:8001 -username weblogic 
-password weblogic FORCESHUTDOWN

 


LOCK

(Deprecated) Locks a WebLogic Server instance 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.

Syntax

java weblogic.Admin [-url URL]
-username username -password password
LOCK ["stringMessage"]

Argument

Definition

-url [protocol://]listen-address:listen-port

Specify the listen address and listen port of the server instance that you want to lock.

If you specify a secure listen port, you must also specify a secure protocol.

If you do not specify a value, the command assumes t3://localhost:7001.

For more information, refer to the -url entry in Table 1-1 on page 5 and Protocol Support.

"stringMessage"

Message, in double quotes, to be supplied in the security exception that is thrown if a non-privileged user attempts to log in while the WebLogic Server instance is locked.


 

Example

In the following example, a Managed Server named MedRecManagedServer is locked.

java weblogic.Admin -url ManagedHost:8001 -username weblogic
-password weblogic
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.

 


RESUME

Moves a server instance from the STANDBY state to the RUNNING state.

For more information about server states, refer to "Server Life Cycle" in the Configuring and Managing WebLogic Server guide.

Syntax

java weblogic.Admin [-url URL]
-username username -password password
RESUME [targetServer]

Argument

Definition

-url secure-protocol://listen-address:listen-port

Because servers can be in the STANDBY state only if the domain-wide administration port is enabled, to resume a server you must specify the Administration Server and domain-wide administration port as follows:

t3s://Admin-Server-listen-address:domain-wide-admin-port or

https://Admin-Server-listen-address:domain-wide-admin-port

For more information, refer to the -url entry in Table 1-1 on page 5 and Protocol Support.

targetServer

The name of the server to resume.

If you do not specify a value, the command resumes the server that you specified in the -url argument.


 

Example

The following example connects to the Administration Server and instructs it to resume a Managed Server:

java weblogic.Admin -url t3s://AdminHost:9002 -username weblogic 
-password weblogic RESUME MedRecManagedServer

For more information about the environment in which this example runs, refer to Example Environment.

 


SHUTDOWN

Shuts down the specified WebLogic Server instance.

A graceful shutdown gives WebLogic Server subsystems time to complete certain application processing currently in progress. For information, refer to "Graceful Shutdown" in the Configuring and Managing WebLogic Server guide.

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 assumes that a numerical value in the field immediately after the SHUTDOWN command indicates seconds. Thus, 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 "Controlling Graceful Shutdowns" and "Setting the Timeout Period for Forced Shutdown Operations" in the Administration Console Online Help.

If a server instance is in a deadlocked state, it can respond to weblogic.Admin commands only if you have enabled the domain-wide administration port. (A deadlocked server is one in which all threads are struck trying to acquire locks held by other threads.) If you have not already enabled the domain-wide administration port, your only option for shutting down the server instance is to kill the Java process that is running the server. You will lose all session data. For information on enabling the domain-wide administration port, refer to "Enabling the Domain-Wide Administration Port" in the Administration Console Online Help.

Syntax

java weblogic.Admin [-url URL]
-username username -password password
SHUTDOWN [-ignoreExistingSessions] [targetServer]
(Deprecated) java weblogic.Admin [-url URL]
-username username -password password
SHUTDOWN [-timeout seconds [targetServer]] |
[seconds ["stringMessage"]]

Argument

Definition

-url [protocol://]listen-address:listen-port

Specify the listen address and listen port of the Administration Server.

If the Administration Server is not available, specify the listen address and listen port of the server instance that you want to shut down and omit the targetServer argument.

If you specify a secure listen port, you must also specify a secure protocol.

If you do not specify a value, the command assumes t3://localhost:7001.

For more information, refer to the -url entry in Table 1-1 on page 5 and Protocol Support.

-ignoreExistingSessions

Causes a graceful shutdown operation to drop all HTTP sessions immediately. If you do not specify this option, the command refers to the Ignore Sessions During Shutdown setting for the server in the domain's config.xml file. For more information, refer to "Controlling Graceful Shutdowns" in the Administration Console Online Help.

By default, a graceful shutdown operation waits for HTTP sessions to complete or timeout.

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.

-timeout seconds

(Deprecated) Number of seconds allowed to elapse between the invoking of this command and the shutdown of the server.

"stringMessage"

(Deprecated) 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 being shut down.


 

Example

The following example instructs the Administration Server to shut down a Managed Server:

java weblogic.Admin -url AdminHost:7001 -username weblogic 
-password weblogic SHUTDOWN MedRecManagedServer

After you issue the command, MedRecManagedServer prints messages to its log file and to its standard out. The messages indicate that the server state is changing and that the shutdown sequence is starting.

If the command succeeds, the final message that the target server prints is as follows:

<Oct 12, 2002 11:28:59 AM EDT> <Alert> <WebLogicServer> <000219> <The shutdown sequence has been initiated.> 

In addition, if the command succeeds, the weblogic.Admin utility returns the following:

Server "MedRecManagedServer" was shutdown successfully ...

For more information about the environment in which this example runs, refer to Example Environment.

In the following example, the Administration Server is not available. The same user connects to a Managed Server and instructs it to shut itself down:

java weblogic.Admin -url ManagedHost:8001 -username weblogic
-password weblogic SHUTDOWN

 


START

Starts a Managed Server using Node Manager.

This command requires the following environment:

Note: In the Administration Console, the Servers—>General tab includes a Startup Mode field that you use to specify the state in which a server starts. However, this setting only applies if you start a server using the weblogic.Server command. The Node Manager, and therefore the weblogic.Admin START command, does not use the value that you specify. For example, even if you specify STANDBY as the value for the Startup Mode, if you issue the weblogic.Admin START command, the server will start in the RUNNING state.

Syntax

java weblogic.Admin [-url URL]
-username username -password password
START targetServer

Argument

Definition

-url [protocol://]listen-address:listen-port

Must specify the listen address and listen port of the domain's Administration Server.

If you specify a secure listen port, you must also specify a secure protocol.

If you do not specify a value, the command assumes t3://localhost:7001.

For more information, refer to the -url entry in Table 1-1 on page 5 and Protocol Support.

targetServer

The name of the Managed Server to start in a RUNNING state.


 

Example

The following example instructs the Administration Server and Node Manager to start a Managed Server:

java weblogic.Admin -url AdminHost:7001 -username weblogic 
-password weblogic START MedRecManagedServer

When you issue the command, the following occurs:

  1. The Administration Server determines which machine MedRecManagedServer is configured to run on. It instructs the Node Manager that is running on that machine to start MedRecManagedServer.
  2. The Node Manager indicates its progress by writing messages to its standard out. You can view these messages from the Administration Console on the Server—>Control—>Remote Start Output tab.
  3. If the command succeeds, the weblogic.Admin utility returns to the following message:
Server "MedRecManagedServer" was started ...
Please refer to server log files for completion status ...

For more information about the environment in which this example runs, refer to Example Environment.

 


STARTINSTANDBY

Starts a 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.

This command requires the following environment:

For more information about server states, refer to "Server Life Cycle" in the Configuring and Managing WebLogic Server guide.

Note: In the Administration Console, the Servers—>General tab includes a Startup Mode field that you use to specify the state in which a server starts. However, this setting only applies if you start a server using the weblogic.Server command. The Node Manager, and therefore the weblogic.Admin STARTINSTANDBY command, does not use the value that you specify. For example, even if you specify RUNNING as the value for the Startup Mode, if you issue the weblogic.Admin STARTINSTANDBY command, the server will start in the STANDBY state.

Syntax

java weblogic.Admin [-url URL]
-username username -password password
STARTINSTANDBY targetServer

Argument

Definition

-url secure-protocol://listen-address:listen-port

You must specify the Administration Server and domain-wide administration port as follows:

t3s://Admin-Server-listen-address:domain-wide-admin-port or

https://Admin-Server-listen-address:domain-wide-admin-port

For more information, refer to the -url entry in Table 1-1 on page 5 and Protocol Support.

targetServer

The name of the WebLogic Server to start in the STANDBY state.


 

Example

The following example instructs the Administration Server and Node Manager to start a Managed Server in a STANDBY state:

java weblogic.Admin -url t3s://AdminHost:9002 -username weblogic 
-password weblogic STARTINSTANDBY MedRecManagedServer

When you issue the command, the following occurs:

  1. The Administration Server determines which machine MedRecManagedServer is configured to run on. It instructs the Node Manager that is running on that machine to start MedRecManagedServer.
  2. The Node Manager indicates its progress by writing messages to its standard out. You can view these messages from the Administration Console on the Server—>Control—>Remote Start Output tab.
  3. If the command succeeds, the weblogic.Admin utility returns to the following message:
Server "MedRecManagedServer" was started ...
Please refer to server log files for completion status ...

When 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 more information about the environment in which this example runs, refer to Example Environment.

 


UNLOCK

(Deprecated) Unlocks the specified WebLogic Server after a LOCK operation.

This command is deprecated because the LOCK command is deprecated. Instead of LOCK and UNLOCK, use STARTINSTANDY and RESUME. For more information, refer to RESUME.

Syntax

java weblogic.Admin [-url URL]
-username username -password password
UNLOCK

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

 


Commands for Retrieving Information about WebLogic Server and Server Instances

Table 1-3 is an overview of commands that return information about WebLogic Server installations and instances of WebLogic Server. Subsequent sections describe command syntax and arguments, and provide an example for each command.

Table 1-3 Overview of Commands for Retrieving Information about WebLogic Server 

Command

Description

CONNECT

Makes the specified number of connections to a WebLogic Server instance 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.

GETSTATE

Returns the current state of the specified WebLogic Server instance.

See GETSTATE.

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.

See HELP.

LICENSES

Lists the licenses for all WebLogic Server instances that are installed on a specific server.

See LICENSES.

LIST

Lists the bindings of a node in a server's JNDI naming tree.

See LIST.

PING

Sends a message to verify that a WebLogic Server instance is listening on a port and is ready to accept client requests.

See PING.

For a similar command that returns information about all servers in a cluster, see CLUSTERSTATE.

SERVERLOG

Displays the server log file generated on a specific server instance.

See SERVERLOG.

THREAD_DUMP

Provides a real-time snapshot of the WebLogic Server threads that are currently running on a particular instance.

See THREAD_DUMP.

VERSION

Displays the version of the WebLogic Server software that is running on the machine specified by the value of URL.

See VERSION.

 


CONNECT

Connects to a WebLogic Server instance 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 [-url URL] 
-username username -password password
CONNECT [count]

Argument

Definition

-url [protocol://]listen-address:listen-port

Specify the listen address and listen port of the server instance to which you want to connect.

If you specify a secure listen port, you must also specify a secure protocol.

If you do not specify a value, the command assumes t3://localhost:7001.

For more information, refer to the -url entry in Table 1-1 on page 5 and Protocol Support.

count

Number of connections the weblogic.Admin utility makes to the specified server instance.

By default, this command makes only one connection.


 

Example

In the following example, the weblogic.Admin utility establishes 10 connections to a WebLogic Server instance whose listen address is ManagedHost and listen port is 8001:

java weblogic.Admin -url ManagedHost:8001 -username weblogic 
-password weblogic CONNECT 10

For more information about the environment in which this example runs, refer to Example Environment.

If the command establishes the connections, it returns the following information:

Connection: 0 - 3,229 ms
Connection: 1 - 17 ms
Connection: 2 - 14 ms
Connection: 3 - 20 ms
Connection: 4 - 18 ms
Connection: 5 - 25 ms
Connection: 6 - 27 ms
Connection: 7 - 15 ms
Connection: 8 - 15 ms
Connection: 9 - 15 ms
RTT = ~3422 milliseconds, or ~342 milliseconds/connection

If the command does not establish a connection, it returns nothing.

In this example, the first connection required 3,229 milliseconds and the second connection required 17 milliseconds. The average time for all connections was 3422 milliseconds.

 


GETSTATE

Returns the current state of a server.

For more information about server states, refer to "Server Life Cycle" in the Configuring and Managing WebLogic Server guide.

If a server instance is in a deadlocked state, it can respond to weblogic.Admin commands only if you have enabled the domain-wide administration port. (A deadlocked server is one in which all threads are struck trying to acquire locks held by other threads.) If you have not already enabled the domain-wide administration port, your only option is to shut down the server instance by killing the Java process that is running the server. You will lose all session data. For information on enabling the domain-wide administration port, refer to "Enabling the Domain-Wide Administration Port" in the Administration Console Online Help.

Syntax

java weblogic.Admin [-url URL]
-username username -password password
GETSTATE [targetServer]

Argument

Definition

-url [protocol://]listen-address:listen-port

Specify the listen address and listen port of the Administration Server.

If the Administration Server is not available, specify the listen address and listen port of the server instance for which you want to retrieve the current state and omit the targetServer argument.

If you specify a secure listen port, you must also specify a secure protocol.

If you do not specify a value, the command assumes t3://localhost:7001.

For more information, refer to the -url entry in Table 1-1 on page 5 and Protocol Support.

targetServer

The name of the server for which you want to retrieve the current state.

If you do not specify a value, the command returns the state of the server that you specified in the -url argument.


 

Example

The following example returns the state of a WebLogic Server instance that runs on a machine named AdminHost:

java weblogic.Admin -url AdminHost:7001 -username weblogic 
-password weblogic GETSTATE

For more information about the environment in which this example runs, refer to Example Environment.

If the command succeeds for a running server, it returns the following:

Current state of "MedRecServer" : RUNNING

For a complete list of server states, refer to "Server Life Cycle" in the Configuring and Managing WebLogic Server guide.

 


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.

You can issue this command from any computer on which the WebLogic Server is installed. You do not need to start a server instance to invoke this command, nor do you need to supply user credentials.

Syntax

java weblogic.Admin HELP [COMMAND]

Example

In the following example, information about using the PING command is requested:

java weblogic.Admin HELP PING

The command returns the following:

Usage: java [SSL trust options]
weblogic.Admin [ [-url | -adminurl] [<protocol>://]<listen-address>:<port>]
-username <username> -password <password>
PING <roundTrips> <messageLength>
Where:
roundTrips = Number of pings.
messageLength = Size of the packet (in bytes) to send in each ping. The default
size is 100 bytes. Requests for pings with packets larger than 10 MB throw exceptions.
Description: Sends a message to verify that a WebLogic Server instance is listen
ing on a port and is ready to accept WebLogic client requests.
Example(s):
Connecting through a non-secured port:
java weblogic.Admin -url t3://localhost:7001 -username weblogic -password weblog
icping 3 100
Connecting through an SSL port of a server that uses the demonstration keys and certificates:
|java -Dweblogic.security.TrustKeyStore=DemoTrust
weblogic.Admin -url t3s:\localhost:7001 -username weblogic -password weblogic PING <roundTrips> <messageLength>

 


LICENSES

Lists the BEA licenses for all WebLogic Server instances installed on the specified host.

Syntax

java weblogic.Admin [-url URL] 
-username username -password password
LICENSES

Argument

Definition

-url [protocol://]listen-address:listen-port

Specify the listen address and listen port of a WebLogic Server instance.

If you specify a secure listen port, you must also specify a secure protocol.

If you do not specify a value, the command assumes t3://localhost:7001.

For more information, refer to the -url entry in Table 1-1 on page 5 and Protocol Support.


 

Example

The following command returns a list of licenses for a host named AdminHost:

java weblogic.Admin -url AdminHost:7001 -username weblogic 
-password weblogic LICENSES

For more information about the environment in which this example runs, refer to Example Environment.

If the command establishes a connection, it returns license information to standard out.

 


LIST

Lists the bindings of a node in the JNDI naming tree.

Syntax

java weblogic.Admin [-url URL]
-username username -password password
LIST [JNDIcontextName]

Argument

Definition

-url [protocol://]listen-address:listen-port

Specify the listen address and listen port of the server instance for which you want to retrieve the JNDI naming tree.

If you specify a secure listen port, you must also specify a secure protocol.

If you do not specify a value, the command assumes t3://localhost:7001.

For more information, refer to the -url entry in Table 1-1 on page 5 and Protocol Support.

JNDIcontextName

The JNDI context for lookup, for example, weblogic, weblogic.ejb, javax.

By default, the command lists the bindings immediately below the InitialContext of the specified server instance.


 

Example

The following command returns the initial context for server instance that runs on a machine named AdminHost:

java weblogic.Admin -url AdminHost:7001 -username weblogic 
-password weblogic LIST

For more information about the environment in which this example runs, refer to Example Environment.

If the command succeeds, it returns information similar to the following.

Contents of InitialContext
javax: weblogic.jndi.internal.ServerNamingNode
mail: weblogic.jndi.internal.ServerNamingNode
weblogic: weblogic.jndi.internal.ServerNamingNode
mqseries: weblogic.jndi.internal.ServerNamingNode
jms: weblogic.jndi.internal.ServerNamingNode
MedRecTxDataSource: weblogic.jdbc.common.internal.RmiDataSource
MedRecDataSource: weblogic.jdbc.common.internal.RmiDataSource

The following command returns the JNDI bindings for the mail context:

java weblogic.Admin -url AdminHost:7001 -username weblogic 
-password weblogic LIST mail

If the command succeeds, it returns the following:

Contents of mail
MedRecMailSession: javax.mail.Session

 


PING

Sends a message to verify that a WebLogic Server instance is listening on a port and is ready to accept WebLogic client requests.

For information on returning a description of all servers in a cluster, refer to CLUSTERSTATE.

If a server instance is in a deadlocked state, it can respond to weblogic.Admin commands only if you have enabled the domain-wide administration port. (A deadlocked server is one in which all threads are struck trying to acquire locks held by other threads.) If you have not already enabled the domain-wide administration port, your only option is to shut down the server instance by killing the Java process that is running the server. You will lose all session data. For information on enabling the domain-wide administration port, refer to "Enabling the Domain-Wide Administration Port" in the Administration Console Online Help.

Syntax

java weblogic.Admin [-url URL]
-username username -password password
PING [roundTrips] [messageLength]

Argument

Definition

-url [protocol://]listen-address:listen-port

Specify the listen address and listen port of the server instance you want to ping.

If you specify a secure listen port, you must also specify a secure protocol.

If you do not specify a value, the command assumes t3://localhost:7001.

For more information, refer to the -url entry in Table 1-1 on page 5 and Protocol Support.

roundTrips

Number of pings.

messageLength

Size of the packet (in bytes) to be sent in each ping. Requests for pings with packets larger than 10 MB throw exceptions.


 

Example

The following command pings a server instance 10 times:

java weblogic.Admin -url AdminHost:7001 -username weblogic 
-password weblogic PING 10

For more information about the environment in which this example runs, refer to Example Environment.

If the command succeeds, it returns output similar to the following:

Sending 10 pings of 100 bytes.
RTT = ~46 milliseconds, or ~4 milliseconds/packet

The following command pings a server instance that is running on a host computer named ManagedHost:

java weblogic.Admin -url ManagedHost:8001 -username weblogic 
-password weblogic PING

 


SERVERLOG

Returns messages from the local log file of a server instance. The command returns messages only from the current log file; it does not return messages in log files that the server instance has archived (renamed) because of log file rotation.

This command can not be used to return the domain-wide log file. You can view the domain-wide log file from the Administration Console. For more information about server log files, refer to "Local Log Files and Domain Log Files" in the Administration Console Online Help.

If you omit the starttime and endtime arguments, the command returns all log messages in the current log file up to a maximum of 500 messages.

For each message, the command returns the following message attributes, separated by spaces:

MessageID TimeStamp Severity Subsystem MessageText

For more information about message attributes, refer to "Message Attributes" in the Administration Console Online Help.

Syntax

java.weblogic.Admin [-url URL]
-username username -password password
SERVERLOG [starttime [endtime]]

Argument

Definition

-url [protocol://]listen-address:listen-port

Specify the listen address and listen port of the server instance for which you want to retrieve the local log file.

If you use the -url argument to specify the Administration Server, the command returns the local log file of the Administration Server.

If you specify a secure listen port, you must also specify a secure protocol.

If you do not specify a value, the command assumes t3://localhost:7001.

For more information, refer to the -url entry in Table 1-1 on page 5 and Protocol Support.

starttime

Returns only the messages in the current log file with a time stamp that is after the time you specify. 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"

By default, SERVERLOG returns all messages in chronological order starting from the beginning of the current log file.

endtime

Specifies the end of a time range and causes SERVERLOG to return only the messages with a time stamp that is after starttime and before endtime. The date format is yyyy/mm/dd. Time is indicated using a 24-hour clock. The end date and time are entered inside quotation marks, in the following format: "yyyy/mm/dd hh:mm"

By default, SERVERLOG returns up to 500 messages in chronological starting with the starttime value and ending with the time at which you issued the SERVERLOG command.


 

Example

The following command returns all messages in the local log file of a server instance named MedRecManagedServer and pipes the output through the command shell's more command:

java weblogic.Admin -url ManagedHost:8001 -username weblogic 
-password weblogic SERVERLOG | more

For more information about the environment in which this example runs, refer to Example Environment.

If the command succeeds, it returns output similar to the following truncated example:

130036    Oct 18, 2002 4:19:12 PM EDT Info  XML   Initializing XMLRegistry.
001007 Oct 18, 2002 4:19:13 PM EDT Info JDBC Initializing... issued.
001007 Oct 18, 2002 4:19:13 PM EDT Info JDBC Initialize Done issued.
190000 Oct 18, 2002 4:19:13 PM EDT Info Connector Initializing J2EE Connector Service
190001 Oct 18, 2002 4:19:13 PM EDT Info Connector J2EE Connector Service initialized successfully
...

The following command returns messages that were written to the local log file since 8:00 am today:

java weblogic.Admin -url ManagedHost:8001 -username weblogic
-password weblogic SERVERLOG 08:00

The following command returns messages that were written to the local log file between 8:00 am and 8:30 am on October 18, 2002:

java weblogic.Admin -url ManagedHost:8001 -username weblogic
-password weblogic SERVERLOG "2002/10/18 08:00" "2002/10/18 08:30"

 


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.

If a server instance is in a deadlocked state, it can respond to weblogic.Admin commands only if you have enabled the domain-wide administration port. (A deadlocked server is one in which all threads are struck trying to acquire locks held by other threads.) If you have not already enabled the domain-wide administration port, your only option is to shut down the server instance by killing the Java process that is running the server. You will lose all session data. For information on enabling the domain-wide administration port, refer to "Enabling the Domain-Wide Administration Port" in the Administration Console Online Help.

Syntax

java weblogic.Admin [-url URL]
-username username -password password THREAD_DUMP

Argument

Definition

-url [protocol://]listen-address:listen-port

Specify the listen address and listen port of the server instance for which you want to view the thread dump.

If you specify a secure listen port, you must also specify a secure protocol.

If you do not specify a value, the command assumes t3://localhost:7001.

For more information, refer to the -url entry in Table 1-1 on page 5 and Protocol Support.


 

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

If the command succeeds, the command itself returns the following:

Thread Dump is available in the command window that is running the server.

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.

For more information about the environment in which this example runs, refer to Example Environment.

 


VERSION

Displays the version of the WebLogic Server software that is running the server instance you specify with the -url argument.

Syntax

java weblogic.Admin [-url URL] -username username 
-password password VERSION

Argument

Definition

-url [protocol://]listen-address:listen-port

Specify the listen address and listen port of a WebLogic Server instance.

If you specify a secure listen port, you must also specify a secure protocol.

If you do not specify a value, the command assumes t3://localhost:7001.

For more information, refer to the -url entry in Table 1-1 on page 5 and Protocol Support.


 

Example

The following command displays the version of the WebLogic Server software that is currently running on a host named ManagedHost:

java weblogic.Admin -url ManagedHost:8001 -username weblogic 
-password weblogic VERSION

For more information about the environment in which this example runs, refer to Example Environment.

If the command succeeds, it returns output similar to the following:

WebLogic Server 8.1  Sat Oct 15 22:51:04 EDT 2002 207896
WebLogic XMLX Module 8.1 Sat Oct 15 22:51:04 EDT 2002 207896

 


Commands for Managing JDBC Connection Pools

Table 1-4 is an overview of WebLogic Server administration commands for connection pools. Subsequent sections describe command syntax and arguments, and provide an example for each command.

For additional information about connection pools see Programming WebLogic JDBC and "JDBC Connection Pools" in the Administration Console Online Help.

Table 1-4 Overview of Commands for Managing JDBC Connection Pools

Command

Description

CREATE_POOL

Allows creation of connection pool while WebLogic Server is running. Note that dynamically created connection pools cannot be used with DataSources or TxDataSources.

See CREATE_POOL.

DESTROY_POOL

Connections are closed and removed from the pool and the pool dies when it has no remaining connections.

See DESTROY_POOL.

DISABLE_POOL

You can temporarily disable a connection pool, preventing any clients from obtaining a connection from the pool.

See DISABLE_POOL.

ENABLE_POOL

When a pool is enabled after it has been disabled, 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.

See ENABLE_POOL.

EXISTS_POOL

Tests whether a connection pool with a specified name exists in a WebLogic Server instance. Use this command 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.

See EXISTS_POOL.

RESET_POOL

Closes and reopens all allocated connections in a connection 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.

 


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.

Note that dynamically created connection pools cannot be used with DataSources or TxDataSources.

Syntax

java weblogic.Admin [-url URL]
-username username -password password
CREATE_POOL poolName aclName=aclX,
props=myProps,initialCapacity=1,maxCapacity=1,
capacityIncrement=1,allowShrinking=true,shrinkPeriodMins=15,
driver=myDriver,url=myURL

Argument

Definition

-url [protocol://]listen-address:listen-port

Specify the listen address and listen port of the Administration Server.

If you specify a secure listen port, you must also specify a secure protocol.

If you do not specify a value, the command assumes t3://localhost:7001.

For more information, refer to the -url entry in Table 1-1 on page 5 and Protocol Support.

poolName

Required. Unique name of pool.

aclName

Required. Identifies the different access lists within fileRealm.properties in the server config directory. Paired name must be dynaPool.

props

Database connection properties; typically in the format "database login name; database password; server network id".

initialCapacity

Initial number of connections in a pool. If this property is defined and a positive number > 0, WebLogic Server creates these connections at boot time. Default is 1; cannot exceed maxCapacity.

maxCapacity

Maximum number of connections allowed in the pool. Default is 1; if defined, maxCapacity should be =>1.

capacityIncrement

Number of connections that can be added at one time. Default = 1.

allowShrinking

Indicates whether or not the pool can shrink when connections are detected to not be in use.
Default = true.

shrinkPeriodMins

Required. Interval between shrinking. Units in minutes. Minimum = 1.If allowShrinking = True, then default = 15 minutes.

driver

Required. Name of JDBC driver. Only local (non-XA) drivers can participate.

url

Required. URL of the JDBC driver.

testConnsOnReserve

Indicates reserved test connections. Default = False.

testConnsOnRelease

Indicates test connections when they are released. Default = False.

testTableName

Database table used when testing connections; must be present for tests to succeed. Required if either testConnOnReserve or testConOnRelease are defined.

refreshPeriod

Sets the connection refresh interval. Every unused connection will be tested using TestTableName. Connections that do not pass the test will be closed and reopened in an attempt to reestablish a valid physical database connection. If TestTableName is not set then the test will not be performed.

loginDelaySecs

The number of seconds to delay before creating each physical database connection. This delay takes place both during initial pool creation and during the lifetime of the pool whenever a physical database connection is created. Some database servers cannot handle multiple requests for connections in rapid succession. This property allows you to build in a small delay to let the database server catch up. This delay takes place both during initial pool creation and during the lifetime of the pool whenever a physical database connection is created.


 

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
java weblogic.Admin -url forest:7901 -username weblogic
-password weblogic CREATE_POOL dynapool6 "aclName=someAcl,
allowShrinking=true,shrinkPeriodMins=10,
url=jdbc:weblogic:oracle,driver=weblogic.jdbc.oci.Driver,
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 [-url URL]
-username username -password password
DESTROY_POOL poolName [true|false]

Argument

Definition

-url [protocol://]listen-address:listen-port

Specify the listen address and listen port of the Administration Server.

If you specify a secure listen port, you must also specify a secure protocol.

If you do not specify a value, the command assumes t3://localhost:7001.

For more information, refer to the -url entry in Table 1-1 on page 5 and Protocol Support.

poolName

Required. Unique name of pool.

false

(soft shutdown)

Soft shutdown waits for connections to be returned to the pool before closing them.

true

(default—hard shutdown)

Hard shutdown kills all connections immediately. Clients using connections from the pool get exceptions if they attempt to use a connection after a hard shutdown.


 

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 [-url URL]
-username username -password password
DISABLE_POOL poolName [true|false]

Argument

Definition

-url [protocol://]listen-address:listen-port

Specify the listen address and listen port of the Administration Server.

If you specify a secure listen port, you must also specify a secure protocol.

If you do not specify a value, the command assumes t3://localhost:7001.

For more information, refer to the -url entry in Table 1-1 on page 5 and Protocol Support.

poolName

Name of the connection pool

false

(disables and suspends)

Disables the connection pool, and suspends clients that currently have a connection. Attempts to communicate with the database 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

(default—disables and destroys)

Disables the connection pool, and destroys the client's JDBC connection to the pool. Any transaction on the connection is rolled back and the connection is returned to the connection pool.


 

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 [-url URL]
-username username -password password
ENABLE_POOL poolName

Argument

Definition

-url [protocol://]listen-address:listen-port

Specify the listen address and listen port of the Administration Server.

If you specify a secure listen port, you must also specify a secure protocol.

If you do not specify a value, the command assumes t3://localhost:7001.

For more information, refer to the -url entry in Table 1-1 on page 5 and Protocol Support.

poolName

Name of the connection pool.


 

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 [-url URL]
-username username -password password
EXISTS_POOL poolName

Argument

Definition

-url [protocol://]listen-address:listen-port

Specify the listen address and listen port of the Administration Server.

If you specify a secure listen port, you must also specify a secure protocol.

If you do not specify a value, the command assumes t3://localhost:7001.

For more information, refer to the -url entry in Table 1-1 on page 5 and Protocol Support.

poolName

Name of connection pool.


 

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 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 [-url URL] 
-username username -password password
RESET_POOL poolName system password

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 "host:port."

poolName

Name of a connection pool as it is registered in the WebLogic Server's config.xml file.

password

Password to be authenticated so commands can be executed. Default is the password that is associated with the default username.


 

Example

This command refreshes the connection pool registered as "eng" for the WebLogic Server listening on port 7001 of the host xyz.com.

 java weblogic.Admin xyz.com:7001 RESET_POOL eng system gumby

 


TEST_POOL

Tests a connection pool by reserving and releasing a connection from it. If the pool is configured to test reserved connections or test released connections, this command also tests the reserve and release operations.

Syntax

 java weblogic.Admin [-url URL]
-username username -password password
TEST_POOL poolName

Argument

Definition

-url [protocol://]listen-address:listen-port

Specify the listen address and listen port of a WebLogic Server instance on which the connection pool has been deployed.

If you specify a secure listen port, you must also specify a secure protocol.

If you do not specify a value, the command assumes t3://localhost:7001.

For more information, refer to the -url entry in Table 1-1 on page 5 and Protocol Support.

poolName

Name of a connection pool as it is registered in the WebLogic Server's config.xml file.


 

Example

This command tests the connection pool registered as MedRecPool and deployed on a server that listens on port 7001 of the host AdminHost:

java weblogic.Admin -url AdminHost:7001 -username weblogic -password weblogic TEST_POOL MedRecPool

If the command succeeds, it returns the following:

JDBC Connection Test Succeeded for connection pool "MedRecPool".

 


Commands for Managing WebLogic Server MBeans

The following sections describe weblogic.Admin commands for managing WebLogic Server MBeans.

Specifying MBean Types

To specify which MBean or MBeans you want to access, view, or modify, all of the MBean management commands require either the -mbean argument or the -type argument.

Use the -mbean argument to operate on a single instance of an MBean.

Use the -type argument to operate on all MBeans that are an instance of a type that you specify. An MBean's type refers to the interface class of which the MBean is an instance. All WebLogic Server MBeans are an instance of one of the interface classes defined in the 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.

MBean Management Commands

Table 1-5 is an overview of the MBean management commands.

Table 1-5 MBean Management Command Overview 

Command

Description

CREATE

Creates an Administration MBean instance. This command cannot be used for Runtime MBeans and we recommend that you do not use it to create Local Configuration MBeans.

See CREATE.

DELETE

Deletes an MBean instance.

See DELETE.

GET

Displays properties of MBeans.

See GET.

INVOKE

Invokes management operations that an MBean exposes for its underlying resource.

See INVOKE.

QUERY

Searches for MBeans whose WebLogicObjectName matches a pattern that you specify.

See QUERY" on page 68.

SET

Sets the specified property values for the named MBean instance. This command cannot be used for Runtime MBeans.

See SET.

 


CREATE

Creates an instance of a WebLogic Server Administration or Local Configuration MBean, however, we recommend that you do not use it to create Local Configuration MBeans. This command cannot be used for Runtime MBeans.

If the command is successful, it returns OK.

When you use this command to create an Administration MBean instance, you must use the -url argument to specify the Administration Server. WebLogic Server populates the Administration MBean with default values and saves the MBean's configuration in the domain's config.xml file. For some types of Administration MBeans, 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 ManagedMedRecServer, you must restart ManagedMedRecServer so that it can create its local replica of the JDBCConnectionPool Administration MBean that you created. For more information on MBean replication and the life cycle of MBeans, refer to "MBeans for Configuring Managed Resources" in the Programming WebLogic Management Services with JMX guide.

Syntax

java weblogic.Admin [-url URL]
-username username -password password
CREATE -name name -type mbeanType

or

java weblogic.Admin [-url URL
-username username -password password
CREATE -mbean objectName

Argument

Definition

-url [protocol://]listen-address:listen-port

Specify the listen address and listen port of the Administration Server. You can create Administration MBeans only on the Administration Server.

If you specify a secure listen port, you must also specify a secure protocol.

If you do not specify a value, the command assumes t3://localhost:7001.

For more information, refer to the -url entry in Table 1-1 on page 5 and Protocol Support.

Although the CREATE command also supports the -adminurl argument, we recommend that you do not use CREATE to create Local Configuration MBeans.

-name name

The name you choose for the MBean that you are creating.

-type mbeanType

The type of MBean that you are creating. For more information, refer to Specifying MBean Types.

-mbean objectName

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.


 

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

For more information about the environment in which this example runs, refer to Example Environment.

If the command succeeds, it prints the following to standard out:

Ok

The following example uses the -mbean argument and WebLogicObjectName conventions to create a JDBCConnectionPool Administration MBean named myPool on an Administration Server:

java weblogic.Admin -url AdminHost:7001 -username weblogic
-password weblogic
CREATE -mbean "mydomain:Type=JDBCConnectionPool,Name=myPool"

 


DELETE

Deletes MBeans. If you delete an Administration MBean, WebLogic Server removes the corresponding entry from the domain's config.xml file.

If the command is successful, it returns OK.

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 [ {-url URL} | {-adminurl URL} ] 
-username username -password password
DELETE {-type mbeanType|-mbean objectName}

Arguments

Definition

{-url [protocol://]listen-address:listen-port}

or

{-adminurl [protocol://]Admin-Server-listen-address:listen-port}

To delete Administration MBeans, use -url to specify the Administration Server's listen address and listen port.

To delete Runtime MBeans or Local Configuration MBeans, use one of the following:

  • -url to specify the listen address and listen port of the server instance on which you want to delete MBeans.

  • -adminurl to delete instances of a Runtime or Local Configuration MBean type from all server instances in the domain.

For more information, refer to the -url and -adminurl entries in Table 1-1 on page 5 and Protocol Support.

-type mbeanType

Deletes all MBeans of the specified type. For more information, refer to Specifying MBean Types.

-mbean objectName

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.


 

Example

The following example deletes the JDBCConnectionPool Administration MBean named myPool:

java weblogic.Admin -url AdminHost:7001 -username weblogic 
-password weblogic DELETE -mbean
MedRec:Name=myPool,Type=JDBCConnectionPool

For more information about the environment in which this example runs, refer to Example Environment.

If the command succeeds, it prints the following to standard out:

Ok

The following example deletes the JDBCConnectionPool Local Configuration MBean named myPool on a server instance named MedRecManagedServer:

java weblogic.Admin -url ManagedHost:8001 -username weblogic
-password weblogic DELETE -mbean
MedRec:Location=MedRecManagedServer,Name=myPool,
Type=JDBCConnectionPoolConfig

The following example deletes all JDBCConnectionPool Local Configuration MBeans for all server instances in the domain:

java weblogic.Admin -adminurl AdminHost:7001 -username weblogic 
-password weblogic DELETE -type JDBCConnectionPoolConfig

The following example deletes all JDBCConnectionPool Local Configuration MBeans on a server instance named MedRecManagedServer:

java weblogic.Admin -url ManagedHost:8001 -username weblogic 
-password weblogic DELETE -type JDBCConnectionPoolConfig

 


GET

Displays MBean properties (attributes) and JMX object names (in the WebLogicObjectName format).

The output of the command is as follows:

{MBeanName object-name {property1 value} {property2 value}. . .} {MBeanName object-name {property1 value} {property2 value} . . .}
. . .

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 [ {-url URL} | {-adminurl URL} ] 
-username username -password password
GET [-pretty] {-type mbeanType|-mbean objectName}
[-property property1] [-property property2]...

Argument

Definition

{-url [protocol://]listen-address:listen-port}

or

{-adminurl [protocol://]Admin-Server-listen-address:listen-port}

To retrieve Administration MBeans, use -url to specify the Administration Server's listen address and listen port.

To retrieve Runtime MBeans or Local Configuration MBeans, use one of the following:

  • -url to specify the listen address and listen port of the server instance on which you want to retrieve MBeans.

  • -adminurl to retrieve instances of a Runtime or Local Configuration MBean type from all server instances in the domain.

For more information, refer to the -url and -adminurl entries in Table 1-1 on page 5 and Protocol Support.

-type mbeanType

Returns information for all MBeans of the specified type. For more information, refer to Specifying MBean Types.

-mbean objectName

Fully qualified object name of an MBean in the WebLogicObjectName format:
"domain:Type=type,Location:location,Name=name"

For more information, refer to the Javadoc for WebLogicObjectName.

-pretty

Places property-value pairs on separate lines.

-property property

The name of the MBean property (attribute) or properties to be listed.

Note: If property is not specified using this argument, all properties are displayed.


 

Example

The following example displays all properties of the JDBCConnectionPool Administration MBean for a connection pool named MedRecPool. 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
MedRec:Name=MedRecPool,Type=JDBCConnectionPool

For more information about the environment in which this example runs, refer to Example Environment.

If the command succeeds, it returns output similar to the following truncated example:

---------------------------
MBeanName: "MedRec:Name=MedRecPool,Type=JDBCConnectionPool"
ACLName:
CachingDisabled: true
CapacityIncrement: 1
ConnLeakProfilingEnabled: false
ConnectionCreationRetryFrequencySeconds: 0
ConnectionReserveTimeoutSeconds: 10
...

The following example displays all instances of all JDBCConnectionPoolRuntime MBeans for all servers in the domain.

java weblogic.Admin -adminurl AdminHost:7001 -username weblogic
-password weblogic GET -pretty -type JDBCConnectionPoolRuntime

The following example displays all instances of all JDBCConnectionPoolRuntime MBeans that have been deployed on the server instance that listens on ManagedHost:8001:

java weblogic.Admin -url ManagedHost:8001 -username weblogic
-password weblogic GET -pretty -type JDBCConnectionPoolRuntime

 


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 [ {-url URL} | {-adminurl URL} ] 
-username username -password password
INVOKE {-type mbeanType|-mbean objectName} -method
methodname [argument . . .]

Arguments

Definition

{-url [protocol://]listen-address:listen-port}

or

{-adminurl [protocol://]Admin-Server-listen-address:listen-port}

To invoke operations for Administration MBeans, use -url to specify the Administration Server's listen address and listen port.

To invoke operations for Runtime MBeans, use one of the following:

  • -url to specify the listen address and listen port of the server instance on which you want to invoke Runtime MBean operations.

  • -adminurl to invoke operations for all instances of a Runtime MBean on all server instances in the domain.

We recommend that you do not invoke operations for Local Configuration MBeans. Instead, invoke the operation on the corresponding Administration MBean.

-type mbeanType

Invokes the operation on all MBeans of a specific type. For more information, refer to Specifying MBean Types.

-mbean objectName

Fully qualified object name of an MBean, in the WebLogicObjectName format:
"domain:Type=type,Location=location,Name=name"

For more information refer to the Javadoc for WebLogicObjectName.

-method methodname

Name of the method to be invoked.

argument

Arguments to be passed to the method call.

When the argument is a String array, the arguments must be passed in the following format:

"String1;String2;. . . "


 

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 MedRec:Location=MedRecServer,Name=myPool,
ServerRuntime=MedRec,Type=JDBCConnectionPoolRuntime
-method enable

If the command succeeds, it returns the following:

{MBeanName="MedRec:Location=MedRecServer,Name=MedRecPool,ServerRuntime=MedRecServer,Type=JDBCConnectionPoolRuntime"} 
Ok

For more information about the environment in which this example runs, refer to Example Environment.

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

 


QUERY

Searches for WebLogic Server MBeans whose WebLogicObjectName matches a pattern that you specify.

All MBeans that are created from a WebLogic Server MBean type are registered in the MBean Server under a name that conforms to the weblogic.management.WebLogicObjectName conventions. You must know an MBean's WebLogicObjectName if you want to use weblogic.Admin commands to retrieve or modify specific MBean instances. For more information, refer to "WebLogicObjectNames for WebLogic Server MBeans" in the Programming WebLogic Management Services with JMX guide.

The output of the command is as follows:

{MBeanName object-name {property1 value} {property2 value}. . .} {MBeanName object-name {property1 value} {property2 value} . . .}
. . .

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 [{-url URL} | {-adminurl URL}] 
-username username -password password
QUERY -pretty -pattern object-name-pattern

Argument

Definition

{-url [protocol://]listen-address:listen-port}

or

{-adminurl [protocol://]Admin-Server-listen-address:listen-port}

To search for Administration MBean object names, use -url to specify the Administration Server's listen address and listen port.

To search for the object names of Local Configuration or Runtime MBeans, use one of the following:

  • -url to specify the listen address and listen port of the server instance on which you want to search.

  • -adminurl to search on all server instances in the domain.

For more information, refer to the -url and -adminurl entries in Table 1-1 on page 5 and Protocol Support.

-pretty

Places property-value pairs on separate lines.

-pattern

A partial WebLogicObjectName for which the QUERY command searches. The value must conform to the following pattern:

domain-name:property-list

For the domain-name portion of the pattern, you can use the * character, which matches any character sequence. Because the server instance that you specify with the -url or -adminurl argument can access only the MBeans that belong to its domain, the * character is sufficient. For example, if you use -url to specify a server in the MedRec domain, QUERY can only return MBeans that are in the MedRec domain. It cannot search for MBeans in a domain named mydomain.

For the property-list portion of the pattern, specify one or more components (property-value pairs) of a WebLogicObjectName. For a list of all WebLogicObjectName property-value pairs, refer to "WebLogicObjectNames for WebLogic Server MBeans" in the Programming WebLogic Management Services with JMX guide. (For example, all WebLogicObjectNames include Name=value and Type=value property-value pairs.)

You can specify these property-value pairs in any order.

Within a given naming property-value pair, there is no pattern matching. Only complete property-value pairs are used in pattern matching. However, you can use the * wildcard character in the place of one or more property-value pairs.

For example, Name=Med* is not valid, but Name=MedRecServer,* is valid.

If you provide at least one property-value pair in the property-list, you can locate the wildcard anywhere in the given pattern, provided that the property-list is still a comma-separated list.


 

Example

The following example searches for all JDBCConnectionPoolRuntime MBeans that are on a server instance that listens at ManagedHost:8001:

java weblogic.Admin -url ManagedHost:8001 -username weblogic 
-password weblogic QUERY
-pattern *:Type=JDBCConnectionPoolRuntime,*

If the command succeeds, it returns the following:

Ok

For more information about the environment in which this example runs, refer to Example Environment.

The following example searches for all instances of MedRecPool MBeans on all servers in the current domain. It uses -adminurl, which instructs the Administration Server to query the Administration MBeanHome interface (This interface has access to all MBeans in the domain):

java weblogic.Admin -adminurl AdminHost:7001 -username weblogic 
-password weblogic QUERY -pattern *:Name=MedRecPool,*

If the command succeeds, it returns an instance of the JDBCConnectionPool Administration MBean that is named MedRecPool, along with all corresponding Local Configuration and Runtime MBeans.

 


SET

Sets the specified property (attribute) values for a configuration MBean. This command cannot be used for Runtime MBeans.

If the command is successful, it returns OK.

When you use this command for an Administration MBean, the new values are saved to the config.xml file.

We recommend that you do not use this command to set values on a Local Configuration MBean. If you use this command for a Local Configuration MBean, the new values are not saved to the config.xml file. Depending on the attribute that you set, the subsystem that uses the MBean might not be able to modify its operation per the new value. In addition, some subsystems require that their Local Configuration MBeans be replicated throughout a domain. If you modify the value for a Local Configuration MBean on one server, the new value will not be replicated throughout the domain and the subsystem might not operate correctly.

Syntax

java weblogic.Admin [-url URL] 
-username username -password password
SET {-type mbeanType|-mbean objectName}
-property property1 property1_value
[-property property2 property2_value] . . .

Argument

Definition

-url [protocol://]listen-address:listen-port

Specifies the listen address and listen port of the Administration Server. Only the Administration Server can access Administration MBeans.

If you specify a secure listen port, you must also specify a secure protocol.

If you do not specify a value, the command assumes t3://localhost:7001.

For more information, refer to the -url entry in Table 1-1 on page 5 and Protocol Support.

Although the SET command supports the -adminurl, we recommend that you do not use it to set values of Local Configuration MBeans.

-type mbeanType

Sets the properties for all MBeans of a specific type. For more information, refer to Specifying MBean Types.

-mbean objectName

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.

-property property

The name of the property to be set.

property _value

The value to be set.

  • When the property value is an MBean array, separate each MBean object name by a semicolon and surround the entire property value list with quotes:

"domain:Name=name,Type=type;domain:Name=name,Type=type"

  • When the property value is a String array, separate each string by a semicolon and surround the entire property value list with quotes:

"String1;String2;. . . "

  • When the property value is a String or String array, you can set the value to null by using either of the following:

-property property-name ""
-property property-name

For example, both -property ListenAddress "" and -property ListenAddress set the listen address to null.

  • If the property value contains spaces, surround the value with quotes:

"-Da=1 -Db=3"

For example:
SET -type ServerStart -property Arguments "-Da=1 -Db=3"

  • When setting the properties for a JDBC Connection Pool, you must pass the arguments in the following format:

"user:username;password:password;server:servername"


 

Example

The following example sets to 64 the StdoutSeverityLevel property of the local configuration instance of the ServerMBean for a server named MedRecManagedServer:

java weblogic.Admin -url http://ManagedHost:8001
-username weblogic -password weblogic
SET -mbean
MedRec:Location=MedRecManagedServer,Name=MedRecManagedServer,
Type=ServerConfig
-property StdoutSeverityLevel 64

For more information about the environment in which this example runs, refer to Example Environment.

If the command succeeds, the server instance writes a log message similar to the following:

<Sep 16, 2002 12:11:27 PM EDT> <Info> <Logging> <000000> <Log messages of every severity will be displayed in the shell console.>

The command prints Ok to standard out.

The following example sets to 64 the StdoutSeverityLevel property for all administration instances of ServerMBean in the current domain:

java weblogic.Admin -url http://AdminHost:7001
-username weblogic -password weblogic
SET -type Server -property StdoutSeverityLevel 64

Using weblogic.Admin Commands to Create Servers

If you prefer to use the command line or a script to add one or more Managed Servers to an existing domain, you can use the weblogic.Admin utility. The following example illustrates how to use weblogic.Admin to add a server named ManagedMedRecServer to the sample MedRec domain.

The example assumes that you are working on a Windows computer.

  1. Start the MedRec domain and Administration Server. For example, you can open a command shell and run the following script:
    WL_HOME\samples\server\config\medrec\startMedRecServer

    Where WL_HOME is the directory in which you installed WebLogic Server.

  2. From the same computer on which you started the Administration Server, open a command shell and enter the following command:
    WL_HOME\server\bin\setWLSEnv.cmd

    The setWLSEnv.cmd script sets the environment variables that the weblogic.Admin utility requires.

  3. To create a server instance, enter the following command:
    java weblogic.Admin -url localhost:7001 -username weblogic
    -password weblogic CREATE -mbean MedRec:Type=Server,Name=MedRecManagedServer

    If the CREATE command succeeds, it creates a server instance named MedRecManagedServer that is configured with default values. Then the command returns OK.

  4. To verify that command succeeded, enter the following command:
    java weblogic.Admin -url localhost:7001 -username weblogic -password weblogic GET -pretty -mbean MedRec:Type=Server,Name=MedRecManagedServer

    The command returns a list of MedRecManagedServer attributes, similar to the following truncated list:

    MBeanName: "MedRec:Name=MedRecManagedServer,Type=Server"
    AcceptBacklog: 50
    AdministrationPort: 0
    AutoKillIfFailed: false
    AutoRestart: true
    COM: MedRecManagedServer
    COMEnabled: fals
    e

  5. To change the value of the non-SSL listen port, enter the following command:
    java weblogic.Admin -url localhost:7001 -username weblogic -password weblogic SET -mbean MedRec:Type=Server,Name=MedRecManagedServer -property ListenPort 7777
  6. To verify that command succeeded, enter the following command:
    java weblogic.Admin -url localhost:7001 -username weblogic -password weblogic GET -pretty -mbean MedRec:Type=Server,Name=MedRecManagedServer -property ListenPort

    If the command succeeds, it returns the following:
    MBeanName: "MedRec:Name=MedRecManagedServer,Type=Server"
    ListenPort: 7777

    For more information about the server attributes that you can set, refer to the Javadoc for weblogic.management.configuration.ServerMBean.

  7. To change the value of the SSL listen port, enter the following command:
    java weblogic.Admin -url localhost:7001 -username weblogic -password weblogic SET -mbean MedRec:Name=MedRecServer,Server=MedRecServer,Type=SSL -property ListenPort 7778
  8. To verify that command succeeded, enter the following command:
    java weblogic.Admin -url localhost:7001 -username weblogic -password weblogic GET -pretty -mbean MedRec:Name=MedRecServer,Server=MedRecServer,Type=SSL -property ListenPort

    If the command succeeds, it returns the following:
    MBeanName: "MedRec:Name=MedRecServer,Server=MedRecServer,Type=SSL"
    ListenPort: 7312

    For more information about the SSL attributes that you can set, refer to the Javadoc for weblogic.management.configuration.SSLMBean.

  9. To enable the server to be started by the Node Manager, enter the following commands:

    java weblogic.Admin -url localhost:7001 -username weblogic -password weblogic CREATE -mbean MedRec:Type=Machine,Name=MyMachine

    java weblogic.Admin -url localhost:7001 -username weblogic -password weblogic CREATE -mbean MedRec:Type=NodeManager,Name=MyMachine

    java weblogic.Admin -url localhost:7001 -username weblogic -password weblogic SET -mbean MedRec:Type=Server,Name=MedRecManagedServer -property Machine MedRec:Name=MyMachine,Type=Machine

    java weblogic.Admin -url localhost:7001 -username weblogic -password weblogic SET -mbean MedRec:Name=MedRecManagedServer,Server=MedRecManagedServer,Type=ServerStart -property Username weblogic

    java weblogic.Admin -url localhost:7001 -username weblogic -password weblogic SET -mbean MedRec:Name=MedRecManagedServer,Server=MedRecManagedServer,Type=ServerStart -property Password weblogic

    For more information about configuring the arguments that the Node Manager uses to start the server, refer to the Javadoc for weblogic.management.configuration.ServerStartMBean.

 


Running Commands in Batch Mode

By default, each weblogic.Admin command that you invoke starts a JVM, acts on a server instance, and then shuts down the JVM. To improve performance for issuing several weblogic.Admin commands in an uninterrupted sequence, you can use the BATCHUPDATE command to run multiple commands in batch mode. The BATCHUPDATE command starts a JVM, runs a list of commands, and then shuts down the JVM.

For example, if a domain contains multiple server instances, you can create a file that returns the listen ports of all Managed Servers in a domain. Then you specify this file as an argument in weblogic.Admin BATCHUPDATE command.

 


BATCHUPDATE

Runs a sequence of weblogic.Admin commands. All output from commands that BATCHUPDATE runs is printed to standard out.

Using this command provides better performance than issuing a series of individual weblogic.Admin commands. For more information, refer to the previous section, Running Commands in Batch Mode.

Syntax

java weblogic.Admin [ [-url URL] | [-adminurl URL] ] 
-username username -password password
BATCHUPDATE -batchFile fileLocation
[-continueOnError] [-batchCmdVerbose]

Argument

Definition

{-url [protocol://]listen-address:listen-port}

or

{-adminurl [protocol://]Admin-Server-listen-address:listen-port}

If the batch file contains commands that access Administration MBeans, use -url to specify the Administration Server's listen address and listen port.

If the batch file contains commands that access Local Configuration or Runtime MBeans, use one of the following:

  • -url to specify the listen address and listen port of the server instance on which you want to access MBeans.

  • -adminurl to access all Local Configuration or Runtime MBeans in the domain.

If you specify a secure listen port, you must also specify a secure protocol.

If you do not specify a value, the command assumes t3://localhost:7001.

For more information, refer to the -url and -adminurl entries in Table 1-1 on page 5 and Protocol Support.

-batchfile fileLocation

The name of a text file that contains a list of weblogic.Admin commands. If you use a relative pathname, the root context is the directory from which you issue the weblogic.Admin BATCHUPDATE command.

The file must contain one or more commands, formatted as follows:

COMMAND-NAME arguments

Place each command on a separate line.

Within the batch file, the BATCHUPDATE command ignores any line that begins with a # character.

-continueOnError

If one of the commands fails or emits errors, weblogic.Admin ignores the error and continues to the next command.

By default, weblogic.Admin stops processing commands as soon as it encounters an error.

-batchCmdVerbose

Causes BATCHUPDATE to indicate which command it is currently invoking. As it invokes a command, BATCHUPDATE prints the following to standard out:

Executing command: command-from-batchfile


 

Example

This example uses the BATCHUPDATE command to return the listen ports for a collection of server instances in a domain. A file named commands.txt contains the following lines:

get -mbean MedRec:Name=MedRecServer,Type=Server -property ListenPort
get -mbean MedRec:Name=MedRecManagedServer,Type=Server -property ListenPort

The following command invokes the commands in commands.txt:

java weblogic.Admin -url AdminHost:7001 -username weblogic -password weblogic BATCHUPDATE -batchFile c:\commands.txt -continueOnError -batchCmdVerbose

If the command succeeds it outputs the following to standard out:

Executing command: get -mbean MedRec:Name=MedRecServer,Type=Server -property ListenPort
{MBeanName="MedRec:Name=MedRecServer,Type=Server"{ListenPort=7001}}
Executing command: get -mbean MedRec:Name=MedRecManagedServer,Type=Server -property ListenPort
{MBeanName="MedRec:Name=MedRecManagedServer,Type=Server"{ListenPort=7021}}

For information about the environment in which this example runs, refer to Example Environment.

For a sample BATCHUPDATE script that creates a simple cluster, refer to Using BATCHUPDATE to Create a Simple Cluster.

 


Commands for Working with Clusters

Table 1-6 is an overview of the commands for working with clusters. Subsequent sections describe command syntax and arguments, and provide an example for each command.

In addition, the section Using BATCHUPDATE to Create a Simple Cluster, provides a sample script that uses the BATCHUPDATE command to create a simple cluster in the MedRec domain.

Table 1-6 MBean Management Command Overview 

Command

Description

CLUSTERSTATE

Returns the number and state of servers in a cluster.

See CLUSTERSTATE

MIGRATE

Migrates a JMS service or a JTA service from one server instance to another within a cluster.

See MIGRATE

STARTCLUSTER

Starts all servers in a cluster

See STARTCLUSTER

STOPCLUSTER

See STOPCLUSTER.

VALIDATECLUSTERCONFIG

Parses the domain's configuration file and reports any discrepancies in all cluster-related elements.

See VALIDATECLUSTERCONFIG.

 


CLUSTERSTATE

Returns the number and state of servers in a cluster.

Syntax

java weblogic.Admin [-url URL]
-username username -password password
CLUSTERSTATE -clusterName clusterName

Argument

Definition

{-url [protocol://]listen-address:listen-port}

Specify the listen address and listen port of any server instance that is currently active and that belongs to the cluster.

If you specify a secure listen port, you must also specify a secure protocol.

If you do not specify a value, the command assumes t3://localhost:7001.

For more information, refer to the -url entry in Table 1-1 on page 5 and Protocol Support.

-clusterName clusterName

The name of the cluster as specified in the domain's configuration file (config.xml).


 

Example

The following example returns information about a cluster:

java weblogic.Admin -url AdminHost:7001
-username weblogic -password weblogic
CLUSTERSTATE -clustername MedRecCluster

For more information about the environment in which this example runs, refer to Example Environment.

If the command succeeds, it returns output similar to the following:

There are 3 server(s) (MedRecServer, MedRecManagedServer, ManagedServer2) in cluster MedRecCluster     
Out of which MedRecServer, MedRecManagedServer, ManagedServer2 are alive

 


MIGRATE

Migrates a JMS service or a JTA Transaction Recovery service to a targeted server within a server cluster.

Syntax

java weblogic.Admin [-url URL] 
-username username -password password
MIGRATE [-jta]
-migratabletarget(migratabletargetName|servername)
-destination servername [-sourcedown] [-destinationdown]

Argument

Definition

{-url [protocol://]listen-address:listen-port}

Specify the listen address and listen port of the Administration Server.

If you specify a secure listen port, you must also specify a secure protocol.

If you do not specify a value, the command assumes t3://localhost:7001.

For more information, refer to the -url entry in Table 1-1 on page 5 and Protocol Support.

-jta

Specifies that the migration is a migration of JTA services.

-migratabletarget

Names a configuration file identified with the server from which services will migrate. For each server, WebLogic Server auto-creates a migratable target file named:

  • "(servername)_migratable" for JMS

  • servername for JTA

This migratable target file is a configuration file that specifies the preferred servers for JMS service and JTA Transaction Recovery service.

-destination

Names the server to which the services will migrate.

-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 weblogic
-password weblogic
MIGRATE -migratabletarget myserver2_migratable
-destination myserver3

In the following example, a JTA Transaction Recovery service is migrated from myserver2 to myserver3.

java weblogic.Admin -url AdminHost:7001 -username weblogic
-password weblogic
MIGRATE -jta -migratabletarget myserver2
-destination myserver3 -sourcedown

 


STARTCLUSTER

Starts all of the servers that are in a cluster have been configured to use a Node Manager. When the command finishes, all servers in the cluster are in the RUNNING state.

This command requires the following environment:

Note: In the Administration Console, the Servers—>General tab includes a Startup Mode field that you use to specify the state in which a server starts. However, this setting only applies if you start a server from the local host using the weblogic.Server command. The Node Manager, and therefore the weblogic.Admin STARTCLUSTER command, does not use the value that you specify. For example, even if you specify STANDBY as the value for the Startup Mode, if you issue the weblogic.Admin STARTCLUSTER command, the servers will start in the RUNNING state.

Syntax

java weblogic.Admin [-url URL]
-username username -password password
STARTCLUSTER -clusterName clusterName

Argument

Definition

{-url [protocol://]listen-address:listen-port}

Specify the listen address and listen port of the Administration Server.

If you specify a secure listen port, you must also specify a secure protocol.

If you do not specify a value, the command assumes t3://localhost:7001.

For more information, refer to the -url entry in Table 1-1 on page 5 and Protocol Support.

-clusterName clusterName

The name of the cluster as specified in the domain's configuration file (config.xml).


 

Example

The following example starts a cluster:

java weblogic.Admin -url AdminHost:7001
-username weblogic -password weblogic
STARTCLUSTER -clustername MedRecCluster

For more information about the environment in which this example runs, refer to Example Environment.

If the command succeeds, it returns output similar to the following:

Starting servers in cluster MedRecCluster: MedRecMS2,MedRecMS1
All servers in the cluster "MedRecCluster" started successfully.

 


STOPCLUSTER

Gracefully shuts down all servers in a cluster.

A graceful shutdown gives WebLogic Server subsystems time to complete certain application processing currently in progress. For information, refer to "Graceful Shutdown" in the Configuring and Managing WebLogic Server guide.

If a Node Manager started a server instance, and if the server does not respond to the graceful shutdown request, the Node Manager forcefully shuts down the server.

Syntax

java weblogic.Admin [-url URL]
-username username -password password
STOPCLUSTER -clusterName clusterName

Argument

Definition

{-url [protocol://]listen-address:listen-port}

Specify the listen address and listen port of the Administration Server.

If you specify a secure listen port, you must also specify a secure protocol.

If you do not specify a value, the command assumes t3://localhost:7001.

For more information, refer to the -url entry in Table 1-1 on page 5 and Protocol Support.

-clusterName clusterName

The name of the cluster as specified in the domain's configuration file (config.xml).


 

Example

The following example stops a cluster:

java weblogic.Admin -url AdminHost:7001
-username weblogic -password weblogic
STOPCLUSTER -clustername MedRecCluster

For more information about the environment in which this example runs, refer to Example Environment.

If the command succeeds, it returns output similar to the following:

Shutting down servers in cluster MedRecCluster: MedRecMS2,MedRecMS1
All servers in the cluster "MedRecCluster" were shutdown successfully

 


VALIDATECLUSTERCONFIG

Parses the domain's configuration file and reports any errors in the configuration of cluster-related elements.

You can run this command only on a WebLogic Server host that can access the domain's configuration file through the host's file system.

Syntax

java weblogic.Admin [-url URL]
-username username -password password
VALIDATECLUSTERCONFIG
-configPath pathname

Argument

Definition

{-url [protocol://]listen-address:listen-port}

Specify the listen address and listen port of any active server in the domain, regardless of whether it belongs to a cluster.

If you specify a secure listen port, you must also specify a secure protocol.

If you do not specify a value, the command assumes t3://localhost:7001.

For more information, refer to the -url entry in Table 1-1 on page 5 and Protocol Support.

-configPath pathname

The path and file name of the domain's configuration file. A relative pathname is resolved to the directory in which you issue the VALIDATECLUSTERCONFIG command.


 

Example

The following example validates the cluster-related configuration elements for the MedRec domain. In this example, the command is issued from the WL_HOME directory:

java weblogic.Admin -url AdminHost:7001
-username weblogic -password weblogic
VALIDATECLUSTERCONFIG -configpath
samples\server\config\medrec\config.xml

For more information about the environment in which this example runs, refer to Example Environment.

Using BATCHUPDATE to Create a Simple Cluster

The weblogic.Admin BATCHUPDATE command runs a sequence of weblogic.Admin commands that you specify in a text file. This section describes how to use BATCHUPDATE to create a simple example cluster. In this example cluster, all server instances run on the same WebLogic Server host as the Administration Server.

Before you can instantiate a cluster, your WebLogic Server license must include a cluster license. If you do not have a cluster license, contact your BEA sales representative. For more information about creating clusters, refer to "Setting Up Clusters" in the Using WebLogic Server Clusters guide.

To use BATCHUPDATE to create a simple cluster in the MedRec domain, do the following:

  1. Start the MedRec domain and Administration Server. For example, you can open a command shell and run the following script:
    WL_HOME\samples\server\config\medrec\startMedRecServer (Windows)
    WL_HOME/samples/server/config/medrec/startMedRecServer.sh (UNIX)

    Where WL_HOME is the directory in which you installed WebLogic Server.

  2. In a command shell, enter the following command:
    WL_HOME\server\bin\setWLSEnv.cmd (Windows)
    WL_HOME/server/bin/setWLSEnv.sh (UNIX)
  3. Copy the commands in Listing 1-1 and paste them into an empty text file. Make sure that each command is on a separate, single line. For example, "SET -mbean MedRec:Type=WebServer,Name=MedRecMS1,Server=MedRecMS1 -property LoggingEnabled true" must be on a single line.
  4. Save the text file.
  5. Edit the commands that you pasted into the text file as follows:
  6. In the command shell, enter the following command:
    java weblogic.Admin -url localhost:7001 -username weblogic -password weblogic BATCHUPDATE -batchFile filename -continueonerror -batchCmdVerbose

    where filename is the name of the file that you created in step 4.

    Note: The above command assumes that you are running the MedRec server and the BATCHUPDATE command on the same Windows computer, and that you have not modified the default listen port of 7001. If you specified some other listen address or listen port for the MedRec Administration Server, use the -url argument to specify your modified address and listen port.

    The BATCHUPDATE command returns OK for each command that it successfully runs.

To verify that you successfully created a cluster, view the Administration Console. In the left pane of the Administration Console, open the Cluster folder and make sure that it contains a cluster named MedRecCluster. Make sure that the cluster contains two server instances named MedRecMS1 and MedRecMS2. Also verify that the servers are targeted for the machine that the command CREATE -mbean MedRec:Type=Machine,Name=calamine (from Listing 1-1) creates.

Listing 1-1 BATCHUPDATE Commands for Creating a Cluster

#Create Server Instances
CREATE -mbean MedRec:Type=Server,Name=MedRecMS1
CREATE -mbean MedRec:Type=Server,Name=MedRecMS2
#Configure Servers
SET -mbean MedRec:Type=Server,Name=MedRecMS1 -property ListenPort 7777
SET -mbean MedRec:Type=WebServer,Name=MedRecMS1,Server=MedRecMS1 -property LoggingEnabled true
SET -mbean MedRec:Type=Server,Name=MedRecMS2 -property ListenPort 7778
SET -mbean MedRec:Type=WebServer,Name=MedRecMS2,Server=MedRecMS2 -property LoggingEnabled true
#Create and Configure Cluster
CREATE -mbean MedRec:Type=Cluster,Name=MedRecCluster
SET -mbean MedRec:Type=Cluster,Name=MedRecCluster -property MulticastAddress 239.0.0.32
SET -mbean MedRec:Type=Server,Name=MedRecMS1 -property Cluster MedRec:Name=MedRecCluster,Type=Cluster
SET -mbean MedRec:Type=Server,Name=MedRecMS2 -property Cluster MedRec:Name=MedRecCluster,Type=Cluster
#Deploy Resources to Cluster
INVOKE -mbean MedRec:Name=MedRecPool,Type=JDBCConnectionPool -method addTarget MedRec:Name=MedRecCluster,Type=Cluster
INVOKE -mbean MedRec:Name=MedRecTxPool,Type=JDBCConnectionPool -method addTarget MedRec:Name=MedRecCluster,Type=Cluster
INVOKE -mbean MedRec:Name=MedRecTxDataSource,Type=JDBCTxDataSource -method addTarget MedRec:Name=MedRecCluster,Type=Cluster
INVOKE -mbean MedRec:Name=MedRecDataSource,Type=JDBCTxDataSource -method addTarget MedRec:Name=MedRecCluster,Type=Cluster
INVOKE -mbean MedRec:Name=Queue,Type=JMSConnectionFactory -method addTarget MedRec:Name=MedRecCluster,Type=Cluster
INVOKE -mbean MedRec:Name=Topic,Type=JMSConnectionFactory -method addTarget MedRec:Name=MedRecCluster,Type=Cluster
INVOKE -mbean MedRec:Name=Topic,Type=JMSConnectionFactory -method addTarget MedRec:Name=MedRecCluster,Type=Cluster
INVOKE -mbean MedRec:Name=Queue,Type=JMSConnectionFactory -method addTarget MedRec:Name=MedRecCluster,Type=Cluster
INVOKE -mbean MedRec:Name=MedRecJMSServer,Type=JMSServer -method addTarget MedRec:Name=MedRecCluster,Type=Cluster
#Configure Machines and Node Manager
CREATE -mbean MedRec:Type=Machine,Name=calamine
CREATE -mbean MedRec:Type=NodeManager,Name=calamine
SET -mbean MedRec:Type=Server,Name=MedRecMS1 -property Machine MedRec:Name=calamine,Type=Machine
SET -mbean MedRec:Type=Server,Name=MedRecMS2 -property Machine MedRec:Name=calamine,Type=Machine
CREATE -mbean  MedRec:Name=MedRecMS1,Server=MedRecMS1,Type=ServerStart 
SET -mbean MedRec:Name=MedRecMS1,Server=MedRecMS1,Type=ServerStart -property Username weblogic
SET -mbean MedRec:Name=MedRecMS1,Server=MedRecMS1,Type=ServerStart -property Password weblogic
CREATE -mbean MedRec:Name=MedRecMS2,Server=MedRecMS1,Type=ServerStart
SET -mbean MedRec:Name=MedRecMS1,Server=MedRecMS1,Type=ServerStart -property Username weblogic
SET -mbean MedRec:Type=ServerStart,Name=MedRecMS2,Server=MedRecMS2 -property Password weblogic

Deploying Applications and Starting Servers in the Simple Cluster

After you create the cluster, you can use either the Administration Server or the weblogic.Deployer utility to deploy applications to the cluster. For more information, refer to "Deployment Tools Reference" in the Deploying WebLogic Server Applications guide and "Deploying Applications and Modules" in the Administration Console Online Help.

The commands in Listing 1-1 enable the MedRecMS1 and MedRecMS2 server instances to be started by the Node Manager. For information on setting up Managed Servers to be started by a Node Manager, refer to the following sections in the Configuring and Managing WebLogic Server guide:

 

Back to Top Previous Next