1 Using the Oracle WebLogic Server Java Utilities
Oracle WebLogic Server provides a number of Java utilities and Ant tasks for performing administrative and programming tasks, installing and configuring the WebLogic Server environment, building and deploying applications, generating certificates for development environments, providing convenient shortcuts, and more.
To use these utilities and tasks, you must set your CLASSPATH
correctly. For more information, see Modifying the Classpath. The command-line syntax is specified for all utilities and, for some, examples are provided.
The Apache Web site provides other useful Ant tasks as well, including tasks for packaging EAR, WAR, and JAR files. For more information, see http://jakarta.apache.org/ant/manual/
.
- appc
Theappc
compiler generates and compiles the classes needed to deploy EJBs and JSPs to Oracle WebLogic Server. It also validates the deployment descriptors for compliance with the current specifications at both the individual module level and the application level. - AppletArchiver
TheAppletArchiver
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. (Thecabarc
utility is available from Microsoft.) - autotype (deprecated)
Use theautotype
Ant task to generate non-built-in data type components, such as the serialization class, for Web Services. The fully qualified name for theautotype
Ant task isweblogic.ant.taskdefs.webservices.javaschema.JavaSchema
. - BuildXMLGen
Use BuildXMLGen to generate abuild.xml
file for enterprise applications in the split-directory structure. - CertGen
TheCertGen
utility generates certificates that should only be used for demonstration or testing purposes, not in a production environment. - ClientDeployer
Useweblogic.ClientDeployer
to extract the client-side JAR file from a Jakarta EE EAR file, creating a deployable JAR file. - clientgen
Useclientgen
to generate the client-side artifacts, needed to invoke a Web Service. - Conversion (deprecated)
WebLogic Server 9.0 does not support conversion or upgrading from a pre-6.0 version of Oracle WebLogic Server. - dbping
Thedbping
command-line utility tests the connection between a DBMS and your client machine via a JDBC driver. You must complete the installation of the driver before attempting to use this utility. - DemoCertGen
The DemoCertGen utility configures keystore resources for demonstration or testing purposes. Do not use it in a production environment. - Deployer
Using the weblogic.Deployer tool, you can deploy Jakarta EE applications and components to WebLogic Servers in a command-line or scripting environment. - der2pem
Theder2pem
utility converts an X509 certificate from DER format to PEM format. The.pem
file is written in the same directory and has the same filename as the source.der
file. - Derby
Derby is an open source relational database management system based on Java, JDBC, and SQL standards. It is bundled with WebLogic Server for use by the sample applications and code examples as a demonstration database. - ejbc (deprecated)
For each deployment descriptor either specified in the command line or present in a.jar
file,ejbc
creates wrapper classes for the corresponding EJBean class. It then runs these through the RMI compiler, which generates a client-side stub and a server-side skeleton. - encrypt
Theweblogic.security.Encrypt
utility encrypts clear text strings for use with Oracle WebLogic Server. The utility uses the encryption service of the current directory, or the encryption service for a specified Oracle WebLogic Server domain root directory. - getProperty
ThegetProperty
utility gives you details about your Java setup and your system. It takes no arguments. - host2ior
Thehost2ior
utility obtains the Interoperable Object Reference (IOR) of an Oracle WebLogic Server. - ImportPrivateKey
TheImportPrivateKey
utility is used to load a private key into a private keystore file. - jhtml2jsp
Thejhtml2jsp
utility converts JHTML files to JSP files. Be sure to inspect the results carefully. Given the unpredictable nature the JHTML code,jhtml2jsp
does not necessarily produce flawless translations. - jspc (deprecated)
Thejspc
utility is a JSP-specific compiler task. - logToZip
ThelogToZip
utility searches an HTTP server log file, finds the Java classes loaded into it by the server, and creates an uncompressed.zip
file that contains those Java classes. - MBean Commands
Use the MBean commands (CREATE
,DELETE
,GET
,INVOKE
, andSET
) to administer MBeans. - MulticastTest
TheMulticastTest
utility helps you debug multicast problems when configuring a WebLogic cluster. - myip
Themyip
utility returns the IP address of the host. - pem2der
Thepem2der
utility converts an X509 certificate from PEM format to DER format. - rmic
The WebLogic RMI compiler is a command-line utility for generating and compiling remote objects. - Schema
TheSchema
utility lets you upload SQL statements to a database using the WebLogic JDBC drivers. - SearchAndBuild
This Ant task executesbuild.xml
files that are included within theFileSet
. - system
Thesystem
utility displays basic information about your computer's operating environment, including the manufacturer and version of your JDK, yourCLASSPATH
, and details about your operating system. - ValidateCertChain
WebLogic Server provides theValidateCertChain
utility to check whether or not an existing certificate chain will be rejected by WebLogic Server. - 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. - WebLogicMBeanMaker
TheWebLogicMBeanMaker
utility takes an XML MBean Description File (MDF) and outputs some intermediate Java files, including an MBean interface, an MBean implementation, and an associated MBean information file. - wlappc
Thewlappc
utility compiles and validates a Jakarta EE EAR file, an EJB JAR file, or a WAR file for deployment. - wlcompile
Use thewlcompile
Ant task to invoke thejavac
compiler to compile your application's Java files in a split development directory structure. - wlconfig
Thewlconfig
Ant task enables you to configure a WebLogic Server domain by creating, querying, or modifying configuration MBeans on a running Administration Server instance. - wldeploy
Thewldeploy
Ant task enables you to performweblogic.Deployer
tool functions using attributes specified in an Ant task. - wlpackage
You use thewlpackage
Ant task to package your split development directory application as a traditional EAR file that can be deployed to WebLogic Server. - wlserver
Thewlserver
Ant task enables you to start, reboot, shutdown, or connect to a WebLogic Server instance. - wsdl2Service
Thewsdl2Service
Ant task is a web services tool that takes as input an existing WSDL file and generates the Java interface that represents the implementation of your web service and theweb-services.xml
file that describes the web service.
appc
appc
compiler generates and compiles the classes needed to deploy EJBs and JSPs to Oracle WebLogic Server. It also validates the deployment descriptors for compliance with the current specifications at both the individual module level and the application level.See appc Reference in Developing Enterprise JavaBeans, Version 3.2, for Oracle WebLogic Server.
Parent topic: Using the Oracle WebLogic Server Java Utilities
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.)
Parent topic: Using the Oracle WebLogic Server Java Utilities
Syntax
$ java utils.applet.archiver.AppletArchiver URL filename
Table 1-1 describes the arguments passed to the AppletArchiver
utility.
Table 1-1 AppletArchiver Arguments
Argument | Definition |
---|---|
|
URL for the applet. |
|
Local filename that is the destination for the |
Parent topic: AppletArchiver
autotype (deprecated)
Use the autotype
Ant task to generate non-built-in data type components, such as the serialization class, for Web Services. The fully qualified name for the autotype
Ant task is weblogic.ant.taskdefs.webservices.javaschema.JavaSchema
.
For a complete list of Web Services Ant tasks, see Ant Task Reference in WebLogic Web Services Reference for Oracle WebLogic Server.
Parent topic: Using the Oracle WebLogic Server Java Utilities
BuildXMLGen
build.xml
file for enterprise applications in the split-directory structure. For complete documentation of this utility, see Building Applications in a Split Development Directory in Developing Applications for Oracle WebLogic Server.
Parent topic: Using the Oracle WebLogic Server Java Utilities
CertGen
The CertGen
utility generates certificates that should only be used for demonstration or testing purposes, not in a production environment.
The CertGen
utility generates certificates with the following attributes by default:
-
2048-bit public key.
-
SHA256 message digest algorithm.
-
Subject Key Identifier extension.
-
Authority Key Identifier extension (if the CA certificate contains a Subject Key ID.)
Parent topic: Using the Oracle WebLogic Server Java Utilities
Syntax
$ java utils.CertGen
-certfile <cert_file> -keyfile <private_key_file>
-keyfilepass <private_key_password>
[-cacert <ca_cert_file>][-cakey <ca_key_file>]
[-cakeypass <ca_key_password>]
[-selfsigned][-strength <key_strength>]
[-digestalgorithm <message digest algorithm such as MD5, SHA1, or SHA256>]
[-e <email_address>][-cn <common_name>]
[-ou <org_unit>][-o <organization>]
[-l <locality>][-s <state>][-c <country_code>]
[-keyusage [digitalSignature,nonRepudiation,keyEncipherment,
dataEncipherment,keyAgreement,keyCertSign,
cRLSign,encipherOnly,decipherOnly]]
[-keyusagecritical true|false]
[-noskid]
[-subjectkeyid <subject_key_identifier>]
[-subjectkeyidformat UTF-8|BASE64]
[-nosanhostdns]
[-a DNS:<hostname>,DNS:<localhost>,IP:<ip address>,IP:<127.0.0.1>]
[-domain <DOMAIN_HOME>]
[-validuntil "YYYY-MM-DD"]
[-help]
Table 1-2 describes the arguments that are passed to the CertGen
utility.
Table 1-2 CertGen Arguments
Argument | Definition |
---|---|
|
Respectively, the output file names without extensions of the generated public certificate and private key. The appropriate extensions are appended when the |
|
The password for the generated private key. |
|
Respectively, the public certificate, private key file, and private key password of the CA that will be used as the issuer of the generated certificate. If one or more of these options are not specified, the relevant demonstration CA files will be used: |
|
Generates a self-signed certificate that can be used as a trusted CA certificate. If this argument is specified, the |
|
The message digest algorithm used with the signature algorithm to sign the certificate. The default is SHA256. Supported values are MD5, SHA1, SHA256, SHA384, and SHA512. |
|
The length (in bits) of the keys to be generated. The default is 2048 bits. The longer the key, the more difficult it is for someone to break the encryption. Generating a certificate with an RSA key length less than 1024 bits may not work in JDK 7u40+. See |
|
The email address associated with the generated certificate. |
|
The name associated with the generated certificate. |
|
The name of the organizational unit associated with the generated certificate. |
|
The name of the organization associated with the generated certificate. |
|
The name of a city or town. |
|
The name of the state or province in which the organizational unit ( |
|
Two-letter ISO code for your country. The code for the United States is US. |
|
Generate certificate with a key usage extension, and with bits set according to the comma-separated list of bit names. Specify a key usage when you want to restrict the operation for a key that could be used for more than one operation. |
|
By default, a key usage extension is marked critical. To generate a certificate with a non-critical extension, use |
|
Prevents a subject key identifier extension in the certificate from being generated. CertGen ignores |
|
Generates a certificate with the specified subject key identifier. |
|
The format of the |
|
Disables the use of the fully-qualified DNS name in the SAN extension. By default, without this option, the certificate is generated with the SAN extension containing the fully qualified DNS name. |
|
Specify a comma-separated list of additional host names, or IP addresses, or both, in the Subject Alternative Name (SAN) field of the certificate, by using the |
|
Uses the specified domain's demo CA to sign certificates, save the identity and trust stores in the |
|
Specifies how long a certificate or CA is valid for. By default, certificates are valid for 6 months and demo CAs are valid for 5 years. |
Parent topic: CertGen
Example
By default, the CertGen utility looks for the CertGenCA.der
and CertGenCAKey.der
files in the current directory, or in the WL_HOME
directory, as specified in the weblogic.home
system property or the CLASSPATH
. Alternatively, you can specify CA files on the command line.
Enter the following command to generate certificate files named testcert
with private key files named testkey
:
$ java utils.CertGen -keyfilepass mykeypass
-certfile testcert -keyfile testkey
Generating a certificate with common name machine-name
and key strength 2048
issued by CA with certificate from CertGenCA.der file and key from CertGenCAKey.der file
Parent topic: CertGen
ClientDeployer
Use weblogic.ClientDeployer
to extract the client-side JAR file from a Jakarta EE EAR file, creating a deployable JAR file.
Run the weblogic.ClientDeployer
class on the Java command line with the following syntax:
java weblogic.ClientDeployer ear-file client
Table 1-3 Syntax for ClientDeployer
Argument | Definition |
---|---|
|
An expanded directory (or Java archive file with a |
|
The name of the client. |
For example:
java weblogic.ClientDeployer app.ear myclient
In the preceding example, app.ear
is the EAR file that contains a Jakarta EE client packaged in myclient.jar
.
After the client-side JAR file is extracted from the EAR file, you can use the weblogic.j2eeclient.Main
utility to bootstrap the client-side application and point it to a WebLogic Server instance.
Run the weblogic.j2eeclient.Main
class on the Java command line with the following syntax:
java weblogic.j2eeclient.Main [options] [clientjar] URL [client-args]
Table 1-4 Syntax for weblogic.j2eeclient.Main
Argument | Definition |
---|---|
|
Optional. Options can include:
For more information on user configuration files, see storeUserConfig in WLST Command Reference for Oracle WebLogic Server. |
|
Optional. The client jar or an exploded |
|
The address of the administration server. |
|
Optional. Additional arguments for the client. |
For example:
java weblogic.j2eeclient.Main helloWorld.jar t3://localhost:7001 Greetings
Parent topic: Using the Oracle WebLogic Server Java Utilities
clientgen
clientgen
to generate the client-side artifacts, needed to invoke a Web Service.
See Ant Task Reference in WebLogic Web Services Reference for Oracle WebLogic Server.
Parent topic: Using the Oracle WebLogic Server Java Utilities
Conversion (deprecated)
Parent topic: Using the Oracle WebLogic Server Java Utilities
dbping
dbping
command-line utility tests the connection between a DBMS and your client machine via a JDBC driver. You must complete the installation of the driver before attempting to use this utility. To install a driver, see the documentation from your driver vendor. Also see Using Third-Party Drivers with WebLogic Server in Developing JDBC Applications for Oracle WebLogic Server.
Parent topic: Using the Oracle WebLogic Server Java Utilities
Creating a DB2 Package with dbping
With the WebLogic Type 4 JDBC Driver for DB2, you can also use the dbping
utility to create a package on the DB2 server. When you ping the database with the dbping utility, the driver automatically creates the default package on the database server if it does not already exist. If the default package already exists on the database server, the dbping
utility uses the existing package.
The default DB2 package includes 200 dynamic sections. You can specify a different number of dynamic sections to create in the DB2 package with the -d
option. The -d
option also sets CreateDefaultPackage=true
and ReplacePackage=true
on the connection used in the connection test, which forces the DB2 driver to replace the DB2 package on the DB2 server. (See Using DataDirect Documentation in Developing JDBC Applications for Oracle WebLogic Server.) You can use the -d
option with dynamic sections set at 200
to forcibly recreate a default package on the DB2 server.
Note:
When you specify the -d
option, the dbping
utility recreates the default package and uses the value you specify for the number of dynamic sections. It does not modify the existing package.
To create a DB2 package, the user that you specify must have CREATE PACKAGE privileges on the database.
Parent topic: dbping
Syntax
$ java utils.dbping DBMS [-d dynamicSections] user password DB
Table 1-5 describes the arguments that are passed to the dbping
command-line utility.
Table 1-5 dbping Arguments
Argument | Definition |
---|---|
|
Varies by DBMS and JDBC driver:
|
|
Specifies the number of dynamic sections to create in the DB2 package. This option is for use with the WebLogic Type 4 JDBC Driver for DB2 only. If the |
|
Valid database username for login. Use the same values you use with For DB2 with the |
|
Valid database password for the user. Use the same values you use with |
|
Name and location of the database. Use the following format, depending on which JDBC driver you use:
Where:
|
Parent topic: dbping
Examples
The following is an example using the Oracle Thin Driver.
C:\>java utils.dbping ORACLE_THIN scott tiger dbserver1:1561:demo **** Success!!! **** You can connect to the database in your app using: java.util.Properties props = new java.util.Properties(); props.put("user", "scott"); props.put("password", "tiger"); props.put("dll", "ocijdbc9"); props.put("protocol", "thin"); java.sql.Driver d = Class.forName("oracle.jdbc.driver.OracleDriver").newInstance(); java.sql.Connection conn = Driver.connect("jdbc:oracle:thin:@dbserver1:1561:demo", props);
The following is an example using the Derby driver. Derby is an open source relational database management system bundled with WebLogic Server for use by the sample applications and code examples as a demonstration database.
$ java utils.dbping DERBY examples examples localhost:1527/demo **** Success!!! **** You can connect to the database in your app using: java.util.Properties props = new java.util.Properties(); props.put("user", "examples"); props.put("password", "examples"); java.sql.Driver d = Class.forName("org.apache.derby.jdbc.ClientDriver").newInstance(); java.sql.Connection conn = Driver.connect("jdbc:derby://localhost:1527/demo", props);
Parent topic: dbping
DemoCertGen
The DemoCertGen utility configures keystore resources for demonstration or testing purposes. Do not use it in a production environment.
The DemoCertGen
utility combines functionality from the CertGen
, Java keytool
, and ImportPrivateKey
utilities to configure demonstration keystores for each domain.
- The
CertGen
utility generates a self-signed demonstration certificate authority (CA) for the domain. - The Java
keytool
utility imports the demo CA to the demo trust keystore,DemoTrust.p12
, under theCertGenCA_<actual domain name>
alias. - The
CertGen
utility then generates a demo identity certificate signed with the newly created demo CA. - The
ImportPrivateKey
utility imports the demo certificate and private key to the demo identity keystore,DemoIdentity.p12
, under thedemoidentity
alias.
Syntax
$ java utils.DemoCertGen -domain DOMAIN_HOME [-genIDOnly] [-cn common_name]
Table 1-6 DemoCertGen Arguments
Argument | Definition |
---|---|
|
Generates and imports a demonstration certificate, signed with the demo CA. |
|
Generates the demo identity store only. |
|
The name associated with the generated certificate. |
Parent topic: Using the Oracle WebLogic Server Java Utilities
Deployer
The weblogic.Deployer
utility replaces the weblogic.deploy
utility, which has been deprecated.
Parent topic: Using the Oracle WebLogic Server Java Utilities
der2pem
The der2pem
utility converts an X509 certificate from DER format to PEM format. The .pem
file is written in the same directory and has the same filename as the source .der
file.
Parent topic: Using the Oracle WebLogic Server Java Utilities
Syntax
$ java utils.der2pem derFile [headerFile] [footerFile]
Table 1-7 describes the arguments that are passed to the der2pem
utility.
Table 1-7 der2pem Arguments
Argument | Description |
---|---|
|
The name of the file to convert. The filename must end with a |
|
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:
Note: There must be a new line at the end of the header line in the file. |
|
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:
Note: There must be a new line at the end of the header line in the file. |
Parent topic: der2pem
Example
$ java utils.der2pem
graceland_org.der
Decoding
................................................................
Parent topic: der2pem
Derby
http://db.apache.org/derby
.
Parent topic: Using the Oracle WebLogic Server Java Utilities
ejbc (deprecated)
.jar
file, ejbc
creates wrapper classes for the corresponding EJBean class. It then runs these through the RMI compiler, which generates a client-side stub and a server-side skeleton.See appc Reference in Developing Enterprise JavaBeans, Version 3.2, for Oracle WebLogic Server.
Parent topic: Using the Oracle WebLogic Server Java Utilities
encrypt
The weblogic.security.Encrypt
utility encrypts clear text strings for use with Oracle WebLogic Server. The utility uses the encryption service of the current directory, or the encryption service for a specified Oracle WebLogic Server domain root directory.
Note:
An encrypted string must have been encrypted by the encryption service in the Oracle WebLogic Server domain where it will be used. If not, the server will not be able to decrypt the string.
You can run the weblogic.security.Encrypt
utility only on a machine that has at least one server instance in an Oracle WebLogic Server domain; it cannot be run from a client.
Note:
Oracle recommends running the utility from the Administration Server domain directory or on the machine hosting the Administration Server and specifying a domain root directory.
Parent topic: Using the Oracle WebLogic Server Java Utilities
Syntax
java [-Dweblogic.RootDirectory=dirname]
[-Dweblogic.management.allowPasswordEcho=true]
weblogic.security.Encrypt [password]
Table 1-8 describes the arguments that are passed to the weblogic.security.Encrypt
utility.
Table 1-8 Encrypt Arguments
Argument | Definition |
---|---|
|
Optional. Oracle WebLogic Server domain directory in which the encrypted string will be used. If not specified, the default domain root directory is the current directory (the directory in which the utility is being run). |
|
Optional. Allows echoing characters entered on the command line. |
|
Optional. Cleartext string to be encrypted. If omitted from the command line, you will be prompted to enter a password. |
Parent topic: encrypt
Examples
The utility returns an encrypted string using the encryption service of the domain located in the current directory.
java weblogic.security.Encrypt xxxxxx {AES}yWv/i0qhfM4/IvzoghzjHj/xpJUkQPF8OWuSfh0f0Ss=
The utility returns an encrypted string using the encryption service of the specified domain location.
java -Dweblogic.RootDirectory=./mydomain weblogic.security.Encrypt xxxxxx {AES}wr86u9Z5DHr+5p7WIbzTDSy4M/sl7EYnX/K5xzcarDQ=
The utility returns an encrypted string in the current directory, without echoing the password.
java weblogic.security.Encrypt Password: {AES}LIX8hoiStcAhph0PGCpveouw/0UO0lciODuj+TQh/bs=
Parent topic: encrypt
getProperty
The getProperty
utility gives you details about your Java setup and your system. It takes no arguments.
Parent topic: Using the Oracle WebLogic Server Java Utilities
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:\
Parent topic: getProperty
host2ior
The host2ior
utility obtains the Interoperable Object Reference (IOR) of an Oracle WebLogic Server.
Parent topic: Using the Oracle WebLogic Server Java Utilities
ImportPrivateKey
The ImportPrivateKey
utility is used to load a private key into a private keystore file.
Parent topic: Using the Oracle WebLogic Server Java Utilities
Syntax
$ java utils.ImportPrivateKey
-certfile <cert_file> -keyfile <private_key_file>
[-keyfilepass <private_key_password>]
-keystore <keystore> -storepass <storepass> [-storetype <storetype>]
-alias <alias> [-keypass <keypass>]
[-domain <DOMAIN_HOME>]
[-help]
Table 1-9 describes the arguments that are passed to the ImportPrivateKey
utility.
Table 1-9 ImportPrivateKey Arguments
Argument | Definition |
---|---|
|
The name of the certificate associated with the private key. |
|
The name of the generated private key file. |
|
The password for the private key. |
|
The name of the keystore file. A new keystore is created if one does not exist. |
|
The password for the keystore. |
|
The type (format) of the keystore. The
You can change the default by specifying the |
|
The name that is used for looking up the certificate and private key being imported into the keystore. |
|
The password of the private key entry being imported into the keystore. If |
|
Use the specified domain's |
Note:
If you used CertGen
to create a private key file protected by a password (-keyfilepass
private_key_password
), that password is the one required by ImportPrivateKey
to extract the key from the key file and insert the key in the newly created keystore (which will contain both the certificate(s) from cert_file
and the private key from private_key_file
).
Parent topic: ImportPrivateKey
Example
Use the following steps to:
-
Generate a certificate and private key using the
CertGen
utility -
Create a keystore and store a private key using the
ImportPrivateKey
utilityNote:
By default, the CertGen utility looks for the
CertGenCA.der
andCertGenCAKey.der
files in the current directory, or in theWL_HOME
/server/lib
directory, as specified in theweblogic.home
system property or the CLASSPATH.Alternatively, you can specify CA files on the command line. If you want to use the default settings, there is no need to specify CA files on the command line.
To generate a certificate:
-
Enter the following command to generate certificate files named
testcert
with private key files namedtestkey
:$ java utils.CertGen -keyfilepass mykeyfilepass -certfile testcert -keyfile testkey Generating a certificate with common name machine-name and key strength 2048 issued by CA with certificate from CertGenCA.der file and key from CertGenCAKey.der file
-
Convert the certificate from DER format to PEM format.
$ java utils.der2pem CertGenCA.der
-
Concatenate the certificate and the Certificate Authority (CA).
$ cat testcert.pem CertGenCA.pem >> newcerts.pem
-
Create a new keystore named
mykeystore
and load the private key located in thetestkey.pem
file.$ java utils.ImportPrivateKey -keystore mykeystore -storepass password -keyfile mykey -keyfilepass mykeyfilepass -certfile newcerts.pem -keyfile testkey.pem -alias passalias -storetype jks No password was specified for the key entry Key file password will be used . . . Imported private key testkey.pem and certificate newcerts.pem into a new keystore mykeystore of type jks under alias passalias
Parent topic: ImportPrivateKey
jhtml2jsp
The jhtml2jsp
utility converts JHTML files to JSP files. Be sure to inspect the results carefully. Given the unpredictable nature the JHTML code, jhtml2jsp
does not necessarily produce flawless translations.
The output is a new JSP file named after the original file.
The HTTP servlets auto-generated from JSP pages differ from the regular HTTP servlets generated from JHTML. JSP servlets extend weblogic.servlet.jsp.JspBase
, and so do not have access to the methods available to a regular HTTP servlet.
If your JHTML pages reference these methods to access the servlet context
or config
objects, you must substitute these methods with the reserved words in JSP that represent these implicit objects.
If your JHTML uses variables that have the same name as the reserved words in JSP, the tool will output a warning. You must edit your Java code in the generated JSP page to change the variable name to something other than a reserved word.
Parent topic: Using the Oracle WebLogic Server Java Utilities
Syntax
$ java weblogic.utils.jhtml2jsp [-d directory] filename.jhtml
Table 1-10 describes the argument that is passed to the jhtml2jsp
tool.
Table 1-10 jhtml2jsp Arguments
Argument | Definition |
---|---|
|
Optional. The target directory. If the target directory isn't specified, output is written to the current directory. |
Parent topic: jhtml2jsp
jspc (deprecated)
jspc
utility is a JSP-specific compiler task. Use appc instead.
Parent topic: Using the Oracle WebLogic Server Java Utilities
logToZip
logToZip
utility searches an HTTP server log file, 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.
Parent topic: Using the Oracle WebLogic Server Java Utilities
Syntax
$ java utils.logToZip logfile codebase zipfile
Table 1-11 describes the arguments that are passed to the logToZip
utility.
Table 1-11 logToZip Arguments
Argument | Definition |
---|---|
|
Required. Fully-qualified pathname of the log file. |
|
Required. Code base for the applet, or |
|
Required. Name of the |
Parent topic: logToZip
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
Parent topic: logToZip
MBean Commands
CREATE
, DELETE
, GET
, INVOKE
, and SET
) to administer MBeans. See Editing Commands in WLST Command Reference for Oracle WebLogic Server.
Parent topic: Using the Oracle WebLogic Server Java Utilities
MulticastTest
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 output:
-
A confirmation and sequence ID for each message sent out by the current server.
-
The sequence and sender ID of each message received from any clustered server, including the current server.
-
A missed-sequenced warning when a message is received out of sequence.
-
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.
Tip:
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 and hardware of the WebLogic Server host machine. See Administering Clusters for Oracle WebLogic Server.
Parent topic: Using the Oracle WebLogic Server Java Utilities
Syntax
$ java utils.MulticastTest -n name -a address [-p portnumber]
[-t timeout] [-s send]
Table 1-12 describes the arguments that are passed to the MulticastTest
utility.
Table 1-12 MulticastTest Arguments
Argument | Definition |
---|---|
|
Required. A name that identifies the sender of the sequenced messages. Use a different name for each test process you start. |
|
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 is 237.0.0.1.) |
|
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 not set.) |
|
Optional. Idle timeout, in seconds, if no multicast messages are received. If not set, the default is 600 seconds (10 minutes). If a timeout is exceeded, a positive confirmation of the timeout is sent to |
|
Optional. Interval, in seconds, between sends. If not set, the default is 2 seconds. A positive confirmation of each message sent out is sent to |
Parent topic: MulticastTest
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
Parent topic: MulticastTest
myip
The myip
utility returns the IP address of the host.
Parent topic: Using the Oracle WebLogic Server Java Utilities
Example
$ java utils.myip Host toyboat.toybox.com is assigned IP address: 192.0.0.1
Parent topic: myip
pem2der
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.
Parent topic: Using the Oracle WebLogic Server Java Utilities
Syntax
$ java utils.pem2der pemFile
Table 1-13 describes the argument that is passed to the pem2der
utility.
Table 1-13 pem2der Arguments
Argument | Description |
---|---|
|
The name of the file to be converted. The filename must end with a |
Parent topic: pem2der
Example
$ java utils.pem2der
graceland_org.pem
Decoding
................................................................
................................................................
................................................................
................................................................
................................................................
Parent topic: pem2der
rmic
weblogic.rmic
to generate dynamic proxies on the client-side for custom remote object interfaces in your application, and to provide hot code generation for server-side objects. See Using the WebLogic RMI Compiler in Developing RMI Applications for Oracle WebLogic Server.
Parent topic: Using the Oracle WebLogic Server Java Utilities
Schema
Schema
utility lets you upload SQL statements to a database using the WebLogic JDBC drivers. For additional information about database connections, see Developing JDBC Applications for Oracle WebLogic Server.
Parent topic: Using the Oracle WebLogic Server Java Utilities
Syntax
$ java utils.Schema driverURL driverClass [-u username]
[-p password] [-verbose] SQLfile
Table 1-14 describes the arguments that are passed to the Schema
utility.
Table 1-14 Schema Arguments
Argument | Definition |
---|---|
|
Required. URL for the JDBC driver. |
|
Required. Pathname of the JDBC driver class. |
|
Optional. Valid username. |
|
Optional. Valid password for the user. |
|
Optional. Prints SQL statements and database messages. |
|
Required. Text file with SQL statements. |
Parent topic: Schema
Example
The following code shows a Schema
command line for the examples.utils
package:
$ java utils.Schema "jdbc:derby://localhost:1527/demo" "org.apache.derby.jdbc.ClientDriver" -u examples -p examples examples/utils/ddl/demo.ddl utils.Schema will use these parameters: url: jdbc:derby://localhost:1527/demo driver: org.apache.derby.jdbc.ClientDriver user: examples password: examples SQL file: examples/utils/ddl/demo.ddl
Parent topic: Schema
SearchAndBuild
build.xml
files that are included within the FileSet
. The task assumes that all of the files defined in FileSet
are valid build files, and executes the Ant
task of each of them.
Make certain that your FileSet
filtering is correct. If you include the build.xml
file that SearchAndBuildTask
is being called from, you will be stuck in an infinite loop as this task will execute the top level build file—itself—forever.
Parent topic: Using the Oracle WebLogic Server Java Utilities
Example
<project name="all_modules" default="all" basedir="."> <taskdef name="buildAll" classname="weblogic.ant.taskdefs.build.SearchAndBuildTask"/> <target name="all"> <buildAll> <fileset dir="${basedir}"> <include name="**\build.xml"/> <exclude name="build.xml"/> </fileset> </buildAll> </target> </project>
Parent topic: SearchAndBuild
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.
Parent topic: Using the Oracle WebLogic Server Java Utilities
Example
$ java utils.system * * * * * * * java.version * * * * * * * 1.8.0_121 * * * * * * * java.vendor * * * * * * * Oracle Corporation * * * * * * * java.class.path * * * * * * * C:\Oracle\wlserver\samples\server\examples\build\serverclasses;C:\Java\JDK18~1.0_7\lib\tools.jar; C:\Oracle\wlserver\server\lib\weblogic.jar;C:\Oracle\oracle_common\modules\net.sf.antcontrib_1.1.0.0_1-0b3\lib \ant-contrib.jar;C:\Oracle\wlserver\modules\features\oracle.wls.common.nodemanager.jar; C:\Oracle\wlserver\common\derby\lib\derbynet.jar;C:\Oracle\wlserver\common\derby\lib\derbyclient.jar; C:\Oracle\wlserver\common\derby\lib\derby.jar;C:\Oracle\wlserver\samples\server\examples\build\clientclasses * * * * * * * os.name * * * * * * * Windows 7 * * * * * * * os.arch * * * * * * * amd64 * * * * * * * os.version * * * * * * * 6.1
Parent topic: system
ValidateCertChain
ValidateCertChain
utility to check whether or not an existing certificate chain will be rejected by WebLogic Server. Note:
Support for PEM and PKCS-12 files is deprecated in this release.ValidateCertChain
utility:
java utils.ValidateCertChain -file pemcertificatefilename (Deprecated, use -pkcs12store or -jks) java utils.ValidateCertChain -pem pemcertificatefilename (Deprecated, use -pkcs12store or -jks) java utils.ValidateCertChain -pkcs12store pkcs12storefilename java utils.ValidateCertChain -pkcs12file pkcs12filename password (Deprecated, use -pkcs12store or -jks) java utils.ValidateCertChain -jks alias storefilename [storePass]
Example of valid certificate chain:
java utils.ValidateCertChain -jks mykey mykeystore Cert[0]: CN=zippy,OU=FORTESTINGONLY,O=MyOrganization,L=MyTown,ST=MyState,C=US Cert[1]: CN=CertGenCAB,OU=FOR TESTINGONLY,O=MyOrganization,L=MyTown,ST=MyState,C=US Certificate chain appears valid
Example of invalid certificate chain:
java utils.ValidateCertChain -jks mykey mykeystore Cert[0]: CN=corba1 OU=FOR TESTING ONLY, O=MyOrganization,L=MyTown,ST=MyState,C=US CA cert not marked with critical BasicConstraint indicating it is a CA Cert[1]: CN=CACERT,OU=FOR TESTING ONLY, O=MyOrganization,L=MyTown,ST=MyState,C=US Certificate chain is invalid
Parent topic: Using the Oracle WebLogic Server Java Utilities
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.
Parent topic: Using the Oracle WebLogic Server Java Utilities
Syntax
$ java utils.verboseToZip inputFile zipFileToCreate
Table 1-15 describes the arguments that are passed to verboseToZip
.
Table 1-15 verboseToZip Arguments
Argument | Definition |
---|---|
|
Required. Temporary file that contains the output of the application running in verbose mode. |
|
Required. Name of the |
Parent topic: verboseToZip
Example
$ java -verbose myapplication > & classList.tmp $ java utils.verboseToZip classList.tmp app2.zip
Parent topic: verboseToZip
WebLogicMBeanMaker
WebLogicMBeanMaker
utility takes an XML MBean Description File (MDF) and outputs some intermediate Java files, including an MBean interface, an MBean implementation, and an associated MBean information file. Together, these intermediate files form the MBean type for a custom security provider
See Understand What the WebLogic MBeanMaker Provides in Developing Security Providers for Oracle WebLogic Server.
Parent topic: Using the Oracle WebLogic Server Java Utilities
Syntax
$ java -DMDF=xmlfile -DFiles=filesdir -DcreateStubs=true|false weblogic.management.commo.WebLogicMBeanMaker
Table 1-16 describes the arguments that are passed to WebLogicMBeanMaker
.
Table 1-16 WebLogicMBeanMaker Arguments
Argument | Description |
---|---|
|
Specifies that the WebLogic MBeanMaker utility should translate the MDF file, represented by |
|
Specifies the location, represented by |
|
Specifies whether the WebLogic MBeanMaker utility overwrites any existing MBean implementation file. |
Parent topic: WebLogicMBeanMaker
wlappc
The wlappc
utility compiles and validates a Jakarta EE EAR
file, an EJB JAR file, or a WAR file for deployment.
See Building Modules and Applications Using wlappc in Developing Applications for Oracle WebLogic Server.
Parent topic: Using the Oracle WebLogic Server Java Utilities
wlcompile
wlcompile
Ant task to invoke the javac
compiler to compile your application's Java files in a split development directory structure.Parent topic: Using the Oracle WebLogic Server Java Utilities
wlconfig
wlconfig
Ant task enables you to configure a WebLogic Server domain by creating, querying, or modifying configuration MBeans on a running Administration Server instance. For complete documentation on this Ant task, see Using Ant Tasks to Configure a WebLogic Server Domain in Developing Applications for Oracle WebLogic Server.
Parent topic: Using the Oracle WebLogic Server Java Utilities
wldeploy
wldeploy
Ant task enables you to perform weblogic.Deployer
tool functions using attributes specified in an Ant task.See Deployer. For more information about wldeploy
, see Deploying and Packaging from a Split Development Directory in Developing Applications for Oracle WebLogic Server.
Parent topic: Using the Oracle WebLogic Server Java Utilities
wlpackage
wlpackage
Ant task to package your split development directory application as a traditional EAR file that can be deployed to WebLogic Server.
See Deploying and Packaging from a Split Development Directory in Developing Applications for Oracle WebLogic Server.
Parent topic: Using the Oracle WebLogic Server Java Utilities
wlserver
wlserver
Ant task enables you to start, reboot, shutdown, or connect to a WebLogic Server instance. The server instance may already exist in a configured WebLogic Server domain, or you can create a new single-server domain for development by using the generateconfig=true
attribute. For complete documentation on this Ant task, see Starting Servers and Creating Domains Using the wlserver Ant Task in Developing Applications for Oracle WebLogic Server.
Parent topic: Using the Oracle WebLogic Server Java Utilities
wsdl2Service
wsdl2Service
Ant task is a web services tool that takes as input an existing WSDL file and generates the Java interface that represents the implementation of your web service and the web-services.xml
file that describes the web service. See Developing WebLogic Web Services Starting From a WSDL File: Main Steps in Developing JAX-WS Web Services for Oracle WebLogic Server.
Parent topic: Using the Oracle WebLogic Server Java Utilities