![]() |
![]() |
|
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.)
$ 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 |
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.
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]
java weblogic.j2eeclient.Main helloWorld.jar t3://localhost:7001 Greetings
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.
$ java utils.der2pem derFile [headerFile] [footerFile]
$ 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.
$ java -Dbea.home=WebLogicHome utils.dbping DBMS user password DB
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.
$ java weblogic.deploy [options] [list|deploy|undeploy|update]
password {application} {source}
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
% 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
The getProperty utility gives you details about your Java setup and your system. It takes no arguments.
$ java utils.getProperty
$ 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:\
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.
$ java utils.logToZip logfile codebase zipfile
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
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:
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.
$ java utils.MulticastTest -n name -a address [-p portnumber]
[-t timeout] [-s send]
$ 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
The myip utility returns the IP address of the host.
$ java utils.myip
$ java utils.myip
Host toyboat.toybox.com is assigned IP address: 192.0.0.1
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.
$ 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. |
$ java utils.pem2der graceland_org.pem
Decoding
................................................................
................................................................
................................................................
................................................................
................................................................
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.
$ java utils.Schema driverURL driverClass [-u username]
[-p password] [-verbose SQLfile]
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);
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. |
$ java -Dbea.home=d:\bea utils.showLicense
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
$ 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
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.
$ java utils.t3dbping WebLogicURL username password DBMS driverClass driverURL
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.
$ java utils.verboseToZip inputFile zipFileToCreate
$ java -verbose myapplication > & classList.tmp
$ java utils.verboseToZip classList.tmp app2.zip
$ java -verbose myapplication > classList.tmp
$ java utils.verboseToZip classList.tmp app3.zip
The version utility displays version information about your installed WebLogic Server via stdout.
$ java weblogic.version
$ java weblogic.version
WebLogic Build: 4.0.1 04/05/1999 22:02:11 #41864
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.
$ java utils.writeLicense -nowrite -Dweblogic.system.home=path
$ java utils.writeLicense -nowrite
* * * * * * 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
...
* * * * * * * 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
|
Copyright © 2000 BEA Systems, Inc. All rights reserved.
|