BEA Logo BEA WebLogic Server Release 6.1

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

   BEA WebLogic Server Administration Guide:   Previous topic   |   Next topic   |   Contents   |  Index

 

Using the WebLogic Server Java Utilities

 

WebLogic Server provides several Java programs that simplify installation and configuration tasks, provide services, and offer convenient shortcuts. This section describes each Java utility provided with WebLogic Server. The command-line syntax is specified for all utilities and, for some, examples are provided. The following utilities are documented:

To use these utilities you must correctly set your CLASSPATH. For more information, see "Setting the Classpath Option."

AppletArchiver

The AppletArchiver utility runs an applet in a separate frame, keeps a record of all of the downloaded classes and resources used by the applet, and packages these into either a .jar file or a .cab file. (The cabarc utility is available from Microsoft.)

Syntax

$ java utils.applet.archiver.AppletArchiver URL filename

Argument

Definition

URL

URL for the applet

filename

Local filename that is the destination for the .jar/.cab archive

ClientDeployer

You use weblogic.ClientDeployer to extract the client-side JAR file from a J2EE EAR file, creating a deployable JAR file. The weblogic.ClientDeployer class is executed on the Java command line with the following syntax:

java weblogic.ClientDeployer ear-file client

The ear-file argument is an expanded directory (or Java archive file with a .ear extension) that contains one or more client application JAR files.

For example:

java weblogic.ClientDeployer app.ear myclient

where app.ear is the EAR file that contains a J2EE client packaged in myclient.jar.

Once the client-side JAR file is extracted from the EAR file, use the weblogic.j2eeclient.Main utility to bootstrap the client-side application and point it to a WebLogic Server instance as follows:

java weblogic.j2eeclient.Main clientjar URL [application args]

For example

java weblogic.j2eeclient.Main helloWorld.jar t3://localhost:7001 Greetings

Conversion

If you have used an earlier version of WebLogic Server, you must convert your weblogic.properties files. Instructions for converting your files using a conversion script are available in the Administration Console Online Help section called "Conversion."

der2pem

The der2pem utility converts an X509 certificate from DER format to PEM format. The .pem file is written in the same directory as the source .der file.

Syntax

$ java utils.der2pem derFile [headerFile] [footerFile]

Argument

Description

derFile

The name of the file to convert. The file name must end with a .der extension, and must contain a valid certificate in .der format.

headerFile

The header to place in the PEM file. The default header is "-----BEGIN CERTIFICATE-----".

Use a header file if the DER file being converted is a private key file, and create the header file containing one of the following:

  • "-----BEGIN RSA PRIVATE KEY-----" for an unencrypted private key

  • "-----BEGIN ENCRYPTED PRIVATE KEY-----" for an encrypted private key.

    Note: There must be a new line at the end of the header line in the file.

footerFile

The header to place in the PEM file. The default header is "-----END CERTIFICATE-----".

Use a footer file if the DER file being converted is a private key file, and create the footer file containing one of the following in the header:

  • "-----END RSA PRIVATE KEY-----" for an unencrypted private key

  • "-----END ENCRYPTED PRIVATE KEY-----" for an encrypted private key

    Note: There must be a new line at the end of the header line in the file.

Example

$ java utils.der2pem graceland_org.der
Decoding
................................................................
................................................................
................................................................
................................................................
................................................................

dbping

The dbping command-line utility tests the connection between a DBMS and your client machine via a two-tier WebLogic jDriver.

Syntax

$ java -Dbea.home=WebLogicHome utils.dbping DBMS user password DB

Argument

Definition

WebLogicHome

The directory containing your WebLogic Server license (license.bea). For example, d:\beaHome\. Required only if using a BEA-supplied JDBC driver.

DBMS

Choose one of the following for your JDBC driver:

WebLogic jDriver for Microsoft SQL Server:
  MSSQLSERVER4

WebLogic jDriver for Oracle:
  ORACLE

WebLogic jDriver for Informix:
  INFORMIX4

Oracle Thin Driver:
  ORACLE_THIN

Sybase JConnect driver:
  JCONNECT

user

Valid username for login. Use the same values you use with isql or sqlplus.

password

Valid password for the user. Use the same values you use with isql or sqlplus.

DB

Name of the database. Use the following format, depending on which JDBC driver you use:

WebLogic jDriver for Microsoft SQL Server:
   DBNAME@HOST:PORT

WebLogic jDriver for Oracle:
  DBNAME

WebLogic jDriver for Informix:
  DBNAME@HOST:PORT

Oracle Thin Driver:
  HOST:PORT:DBNAME

Sybase JConnect driver: JCONNECT:
  
HOST:PORT:DBNAME

Where:

  • HOST is the name of the machine hosting the DBMS,

  • PORT is port on the database host where the DBMS is listening for connections, and

  • DBNAME is the name of a database on the DBMS. (For Oracle, this is the name of a DBMS defined in the tnsnames.ora file.)s

deploy

The deploy utility gets a J2EE application from an archive file (.jar, .war, or .ear) and deploys the J2EE application to a running WebLogic Server. For additional information, see Deploying and Configuring Web Applications in the WebLogic Server Administration Guide, and the programming guide, Developing WebLogic Server Applications.

Syntax

$ java weblogic.deploy [options] [list|deploy|undeploy|update]
password {application} {source}

Arguments

Argument

Description

applications

Required. Idenitfies the name of the application. The application name can be specified at deployment time, either with the deployment or console utilities.

deploy

Optional. Deploys a J2EE application .jar, .war, or .ear file to the specified server.

list

Optional. Lists all applications in the specified WebLogic Server.

password

Required. Specifies the system password for the WebLogic Server.

source

Required. Specifies the exact location of the application archive file (.jar, .war, or .ear) , or the path to the top level of an application directory.

undeploy

Optional. Removes an existing application from the specified server.

update

Optional. Re-deploys an application in the specified server.

Options

Option

Definition

-component componentname:target1, target2

Component to be deployed on various targets, must be specified as: componentname:target1,target2

where componentname is the name of the .jar or .war file without the extension. This option can be specified multiple times for any number of components (.jar or .war). An .ear file cannot be deployed. Each of its components must be deployed separately using this option.

-debug

Prints detailed debugging information to stdout during the deployment process.

-help

Prints a list of all options available for the deploy utility.

-host host

Specifies the host name of the WebLogic Server to use for deploying the J2EE application (.jar, .war, .ear). If you do not specify this option, the deploy utility attempts to connect using the host name localhost.

-port port

Specifies the port number of the WebLogic Server to use for deploying the J2EE application .jar, .war, or .ear file.

Note: If you do not specify the -port option, deploy connects uses a default of 7001.

-url url

Specifies the URL of a Weblogic Server. The default is localhost:7001.

-username username

Name of the user with which a connection will be made. The default is system.

-version

Prints the version of the deploy utility.

Examples

The deploy utility is useful for various purposes, including the following:

Viewing a Deployed J2EE Application

To view an application that is deployed on a local WebLogic Server, enter the following command:

% java weblogic.deploy list password

The value of password is the password for the WebLogic Server system account.

To list a deployed application on a remote server, specify the port and host options, as follows:

% java weblogic.deploy -port port_number -host host_name list password

Deploying a New J2EE Application

To deploy a J2EE application file (.jar, .war, or .ear) or application directory that is not deployed to WebLogic Server, enter the following command:

% java weblogic.deploy -port port_number -host host_name
deploy password application source

The values are as follows:

For example:

% java weblogic.deploy -port 7001 -host localhost deploy weblogicpwd Basic_example
c:\mysamples\ejb\basic\BasicStatefulTraderBean.jar

Note: The J2EE application file (.jar,.war,.ear) copied to the applications directory of the Administration Server is renamed with the name of the application. Therefore, in the previous example, the name of the application archive . . ./config/mydomain/applications directory is changed from BasicStatefulTraderBean.jar to Basic_example.jar.

Removing a Deployed J2EE Application

To remove a deployed J2EE application, you need only reference the assigned application name, as shown in the following example:

% java weblogic.deploy -port 7001 -host localhost undeploy
weblogicpwd Basic_example

Note: Removing a J2EE application does not remove the application from WebLogic Server. You cannot re-use the application name with the deploy utility. You can re-use the application name to update the deployment, as described in the following section.

Updating a Deployed J2EE Application

To update a J2EE application, use the update argument and specify the name of the active J2EE application as follows:

% java weblogic.deploy -port 7001 -host localhost update
weblogicpwd Basic_example
c:\updatesample\ejb\basic\BasicStatefulTraderBean.jar

To update a specific component on one or more servers, enter the following command:

% java weblogic.deploy -port 7001 -host localhost -component
BasicStatefulTraderBean.jar:sampleserver,exampleserver update
weblogicpwd Basic_example
c:\updatesample\ejb\basic\BasicStatefulTraderBean.jar

getProperty

The getProperty utility gives you details about your Java setup and your system. It takes no arguments.

Syntax

$ java utils.getProperty

Example

$ java utils.getProperty
-- listing properties --
user.language=en
java.home=c:\java11\bin\..
awt.toolkit=sun.awt.windows.WToolkit
file.encoding.pkg=sun.io
java.version=1.1_Final
file.separator=\
line.separator=
user.region=US
file.encoding=8859_1
java.vendor=Sun Microsystems Inc.
user.timezone=PST
user.name=mary
os.arch=x86
os.name=Windows NT
java.vendor.url=http://www.sun.com/
user.dir=C:\weblogic
java.class.path=c:\weblogic\classes;c:\java\lib\cla...
java.class.version=45.3
os.version=4.0
path.separator=;
user.home=C:\

logToZip

The logToZip utility searches an HTTP server log file in common log format, finds the Java classes loaded into it by the server, and creates an uncompressed .zip file that contains those Java classes. It is executed from the document root directory of your HTTP server.

To use this utility, you must have access to the log files created by the HTTP server.

Syntax

$ java utils.logToZip logfile codebase zipfile

Argument

Definition

logfile

Required. Fully-qualified pathname of the log file.

codebase

Required. Code base for the applet, or "" if there is no code base. By concatenating the code base with the full package name of the applet, you get the full pathname of the applet (relative to the HTTP document root).

zipfile

Required. Name of the .zip file to create. The resulting .zip file is created in the directory in which you run the program. The pathname for the specified file can be relative or absolute. In the examples, a relative pathname is given, so the .zip file is created in the current directory.

Examples

The following example shows how a .zip file is created for an applet that resides in the document root itself, that is, with no code base:

$ cd /HTTP/Serv/docs
$ java utils.logToZip /HTTP/Serv/logs/access "" app2.zip

The following example shows how a .zip file is created for an applet that resides in a subdirectory of the document root:

C:\>cd \HTTP\Serv
C:\HTTP\Serv>java utils.logToZip \logs\applets\classes app3.zip

MulticastTest

The MulticastTest utility helps you debug multicast problems when configuring a WebLogic Cluster. The utility sends out multicast packets and returns information about how effectively multicast is working on your network. Specifically, MulticastTest displays the following types of information via standard out:

  1. A confirmation and sequence ID for each message sent out by this server.

  2. The sequence and sender ID of each message received from any clustered server, including this server.

  3. A missed-sequenced warning when a message is received out of sequence.

  4. A missed-message warning when an expected message is not received.

To use MulticastTest, start one copy of the utility on each node on which you want to test multicast traffic.

Warning: Do NOT run the MulticastTest utility by specifying the same multicast address (the -a parameter) as that of a currently running WebLogic Cluster. The utility is intended to verify that multicast is functioning properly before starting your clustered WebLogic Servers.

For information about setting up multicast, see the configuration documentation for the operating system/hardware of the WebLogic Server host. For more information about configuring a cluster, see Using WebLogic ServerClusters.

Syntax

$ java utils.MulticastTest -n name -a address [-p portnumber]
[-t timeout] [-s send]

Argument

Definition

-n name

Required. A name that identifies the sender of the sequenced messages. Use a different name for each test process you start.

-a address

Required. The multicast address on which: (a) the sequenced messages should be broadcast; and (b) the servers in the clusters are communicating with each other. (The default for any cluster for which a multicast address is not set is 237.0.0.1.)

-p portnumber

Optional. The multicast port on which all the servers in the cluster are communicating. (The multicast port is the same as the listen port set for WebLogic Server, which defaults to 7001 if unset.)

-t timeout

Optional. Idle timeout, in seconds, if no multicast messages are received. If unset, the default is 600 seconds (10 minutes). If a timeout is exceeded, a positive confirmation of the timeout is sent to stdout.

-s send

Optional. Interval, in seconds, between sends. If unset, the default is 2 seconds. A positive confirmation of each message sent out is sent to stdout.

Example

$ java utils.MulticastTest -N server100 -A 237.155.155.1
Set up to send and receive on Multicast on Address 237.155.155.1 on port 7001
Will send a sequenced message under the name server100 every 2 seconds.
Received message 506 from server100
Received message 533 from server200
I (server100) sent message num 507
Received message 507 from server100
Received message 534 from server200
I (server100) sent message num 508
Received message 508 from server100
Received message 535 from server200
I (server100) sent message num 509
Received message 509 from server100
Received message 536 from server200
I (server100) sent message num 510
Received message 510 from server100
Received message 537 from server200
I (server100) sent message num 511
Received message 511 from server100
Received message 538 from server200
I (server100) sent message num 512
Received message 512 from server100
Received message 539 from server200
I (server100) sent message num 513
Received message 513 from server100

myip

The myip utility returns the IP address of the host.

Syntax

$ java utils.myip

Example

$ java utils.myip
Host toyboat.toybox.com is assigned IP address: 192.0.0.1

pem2der

The pem2der utility converts an X509 certificate from PEM format to DER format. The .der file is written in the same directory as the source .pem file.

Syntax

$ java utils.pem2der pemFile

Argument

Description

pemFile

The name of the file to be converted. The filename must end with a .pem extension, and it must contain a valid certificate in .pem format.

Example

$ java utils.pem2der graceland_org.pem
Decoding
................................................................
................................................................
................................................................
................................................................
................................................................

Schema

The Schema utility lets you upload SQL statements to a database using the WebLogic JDBC drivers. For additional information about database connections, see Programming WebLogic JDBC.

Syntax

$ java utils.Schema driverURL driverClass [-u username]
[-p password] [-verbose SQLfile]

Argument

Definition

driverURL

Required. URL for the JDBC driver.

driverClass

Required. Pathname of the JDBC driver class.

-u username

Optional. Valid username.

-p password

Optional. Valid password for the user.

-verbose

Optional. Prints SQL statements and database messages.

SQLfile

Required when the -verbose argument is used. Text file with SQL statements.

Example

The following code shows a sample Schema command line:

$ java utils.Schema "jdbc:cloudscape:demo;create=true"
COM.cloudscape.core.JDBCDriver
-verbose examples/utils/ddl/demo.ddl

The following code shows a sample .ddl file:

    DROP TABLE ejbAccounts;
CREATE TABLE ejbAccounts
(id varchar(15),
bal float,
type varchar(15));
DROP TABLE idGenerator;
CREATE TABLE idGenerator
(tablename varchar(32),
maxkey int);

showLicenses

The showLicenses utility displays license information about BEA products installed in this machine.

Syntax

$ java -Dbea.home=license_location utils.showLicenses

Argument

Description

license_location

The fully qualified name of the directory where the license.bea file exists.

Example

$ java -Dbea.home=d:\bea utils.showLicense

system

The system utility displays basic information about your computer's operating environment, including the manufacturer and version of your JDK, your CLASSPATH, and details about your operating system.

Syntax

$ java utils.system

Example

$ java utils.system
* * * * * * * java.version * * * * * * *
1.1.6

* * * * * * * java.vendor * * * * * * *
Sun Microsystems Inc.

* * * * * * * java.class.path * * * * * * *
\java\lib\classes.zip;\weblogic\classes;
\weblogic\lib\weblogicaux.jar;\weblogic\license
...

* * * * * * * os.name * * * * * * *
Windows NT

* * * * * * * os.arch * * * * * * *
x86

* * * * * * * os.version * * * * * * *
4.0

t3dbping

The t3dbping utility tests a WebLogic JDBC connection to a DBMS via any two-tier JDBC driver. You must have access to a WebLogic Server and a DBMS to use this utility.

Syntax

$ java utils.t3dbping WebLogicURL username password DBMS driverClass driverURL

Argument

Definition

WebLogicURL

Required. URL of the WebLogic Server.

username

Required. Valid username of DBMS user.

password

Required. Valid password of DBMS user.

DBMS

Required. Database name.

driverClass

Required. Full package name of the WebLogic Server two-tier driver.

driverURL

Required. URL of the WebLogic Server two-tier driver.

verboseToZip

When executed from the document root directory of your HTTP server, verboseToZip takes the standard output from a Java application run in verbose mode, finds the Java classes referenced, and creates an uncompressed .zip file that contains those Java classes.

Syntax

$ java utils.verboseToZip inputFile zipFileToCreate

Argument

Definition

inputFile

Required. Temporary file that contains the output of the application running in verbose mode.

zipFileToCreate

Required. Name of the .zip file to be created. The resulting .zip file is be created in the directory in which you run the program.

UNIX Example

$ java -verbose myapplication > & classList.tmp
$ java utils.verboseToZip classList.tmp app2.zip

NT Example

$ java -verbose myapplication > classList.tmp
$ java utils.verboseToZip classList.tmp app3.zip

version

The version utility displays version information about your installed WebLogic Server via stdout.

Syntax

$ java weblogic.version

Example

$ java weblogic.version
WebLogic Build: 4.0.1 04/05/1999 22:02:11 #41864

writeLicense

The writeLicense utility writes information about all your WebLogic licenses in a file called writeLicense.txt, located in the current directory. This file can then be emailed, for example, to WebLogic technical support.

Syntax

$ java utils.writeLicense -nowrite -Dweblogic.system.home=path

Argument

Definition

-nowrite

Required. Sends the output to stdout instead of writeLicense.txt.

-Dweblogic.system.home

Required. Sets WebLogic system home (the root directory of your WebLogic Server installation).

Note: This argument is required unless you are running writeLicense from your WebLogic system home.

Examples

$ java utils.writeLicense -nowrite

Example of UNIX Output

* * * * * * System properties * * * * * *

* * * * * * * java.version * * * * * * *
1.1.7

* * * * * * * java.vendor * * * * * * *
Sun Microsystems Inc.

* * * * * * * java.class.path * * * * * * *
c:\weblogic\classes;c:\weblogic\lib\weblogicaux.jar;
c:\java117\lib\classes.zip;c:\weblogic\license
...

Example of Windows NT Output

* * * * * * * os.name * * * * * * * 
Windows NT

* * * * * * * os.arch * * * * * * *
x86

* * * * * * * os.version * * * * * * *
4.0

* * * * * * IP * * * * * *
Host myserver is assigned IP address: 192.1.1.0

* * * * * * Location of WebLogic license files * * * * * *
No WebLogicLicense.class found

No license.bea license found in
weblogic.system.home or current directory

Found in the classpath: c:/weblogic/license/license.bea
Last Modified: 06/02/1999 at 12:32:12

* * * * * * Valid license keys * * * * * *
Contents:
Product Name : WebLogic
IP Address : 192.1.1.0-255
Expiration Date: never
Units : unlimited
key : b2fcf3a8b8d6839d4a252b1781513b9
...

* * * * * * All license keys * * * * * *
Contents:
Product Name : WebLogic
IP Address : 192.1.1.0-255
Expiration Date: never
Units : unlimited
key : b2fcf3a8b8d6839d4a252b1781513b9
...

* * * * * * WebLogic version * * * * * *
WebLogic Build: 4.0.x xx/xx/1999 10:34:35 #xxxxx

 

Back to Top