- J2EE Administration Tool
- Cleanup Tool
- Cloudscape Server
- Deployment Tool
- J2EE Server
- Key Tool
- Realm Tool
- Runclient Script
j2eeadmintool is a command-line script that enables you to add and remove these resources: JDBC TM drivers and data sources, JMS destinations and connection factories, and resource adapter connection factories.
Table 43 j2eeadmintool Options Option Description
Adds a connection factory with the specified
<jndi-name>. The connection factory is contained in the RAR file specified by
<rar-filename>. The <rar-filename> must be the base name of the file; it cannot include any prefix ending in / (Unix) or \ (Windows). If the RAR file is contained in an EAR file, then the name of the J2EE application name must be specified by
<app-name>, followed by a colon. Optionally, a user name and password for the factory may be specified. Also optional is the
-propsflag, followed by one or more name-value pairs that specify properties for this factory. To prevent the shell from interpreting characters in the values, enclose the values in single or double quotes.
Adds the JDBC driver specified by its fully-qualified
<class-name>. You must also update the
J2EE_CLASSPATHenvironment variable in the file
bin\userconfig.bat. Then you must restart the J2EE server.
Adds the JDBC
DataSourcewith the specified
Adds the JDBC
XADataSourcewith the specified
<class-name>. Optionally, a user name and password for the
DataSourcemay be specified. Also optional is the
-propsflag, followed by one or more name-value pairs that specify properties for this
Adds a JMS destination with the specified
<jndi-name>and declares the destination as either a queue or topic.
Adds a JMS connection factory with the specified
<jndi-name>and destination type, either queue or topic. Optionally, one or more properties may be specified with name-value pairs.
Lists resources of the specified
JmsFactory. There is no space between
Removes the resource of the specified
<jndi-name>. (See the description of
-listfor the allowed
Removes all resources of the specified
<resource-type>. (See the description of
-listfor the allowed
Note: Use this utility with care!
Mon Aug 09 11:50:30 PDT 1999: [RmiJdbc] COM.cloudscape.core.JDBCDriver registered in DriverManager Mon Aug 09 11:50:30 PDT 1999: [RmiJdbc] Binding . . .. Mon Aug 09 11:50:30 PDT 1999: [RmiJdbc] No installation of RMI Security Manager... Mon Aug 09 11:50:31 PDT 1999: [RmiJdbc] RmiJdbcServer bound in rmi registry
Note: If you stop the server with Control-c, files will not be closed properly. When the server is started the next time, it must perform recovery by rolling back non-committed transactions and possibly applying the forward log.
Within the tool, each command you type must end in a semicolon. The commmands in the next example display all rows from the
orderstable, execute a SQL script named
myscript.sql, and end the tool session:
Before you deploy an entity bean with container-managed persistence, you use the
deploytoolto generate the bean's SQL statements. Because the table names in these SQL statements are case-sensitive, you must enclose them in double quotes:
The default database used by the Cloudscape server is named
CloudscapeDB. This database will reside in the
cloudscapedirectory of your J2EE SDK installation. The
CloudscapeDBdatabase will be created automatically the first time it is accessed. The driver for the Cloudscape server is already configured in the
config/default.propertiesfile. No further changes by you are necessary.
Table 44 deploytool Options Option Description
Deploys the J2EE application contained in the EAR file specified by
<ear-filenamme>onto the J2EE server running on the machine specified by
<server-name>. Optionally, a JAR file for a stand-alone Java application client may be created by specifying
Deploys the resource adapter contained in the RAR file specified by
<rar-filename>onto the J2EE server running on the machine specified by
Lists the J2EE applications that are deployed on the J2EE server running on the machine specified by
Lists the resource adapters that are deployed on the J2EE server running on the machine specified by
Undeploys the resource adapter contained in the file specified by
<rar-filename>from the J2EE server running on the machine specified by
Undeploys the J2EE application whose name is
<app-name>from the J2EE server running on the machine specified by
Runs GUI version (default).
Table 45 j2ee Options Option Description
Redirects all logging output to the current shell.
Displays the version number.
Stops the J2EE server.
keytoolutility creates public and private keys and generates X509 self-signed certificates. The J2EE SDK version of the
keytoolutility has the same options as the version distributed with the J2SE SDK. However, the J2EE version programatically adds a Java Cryptographic Extension provider that has implementations of RSA algorithms (licensed from RSA Data Security). For more information, see the Security chapter.
packagertool is a command-line script that enables you to package J2EE components. This tool is for advanced users who do not want to use the
deploytoolto package J2EE components. With the
packager, you can create the following component packages:
- EJB JAR file
- Web Application WAR file
- Application Client JAR file
- J2EE Application EAR file
- Resource Adapter RAR file
Note: To make them easier to read, the examples that follow contain line breaks within the commands. When typing these commands, do not include the line breaks.
packager -webArchive -classpath . -classFiles cart\ShoppingCart.class:cart\ShoppingCartItem.class: database\BookDB.class:util\Currency.class . -contentFiles banner.jsp:bookdetails.jsp:bookstore.jsp:cashier.jsp: catalog.jsp:DigitalClock.class:duke.books.gif: errorpage.jsp:initdestroy.jsp:receipt.jsp:showcart.jsp web.xml bookstore2.war
The preceding example specified the
-enterpriseArchiveflag to create a portable J2EE application EAR file. This file is portable because you can import it into any J2EE environment that conforms to the J2EE Specification. Although you can import the file into the
deploytool, you cannot deploy it on the J2EE server until it contains a runtime deployment descriptor. This deployment descriptor is an XML file that contains information such as the JNDI names of the application's enterprise beans.
Note: The runtime deployment descriptor (
sun-j2ee-ri.xml) is not required by the J2EE Specification. This descriptor is unique to the J2EE SDK and may change in future releases.
In this example, the
jarcommand packages the files under the
myfiles.jar. The packager command creates a RAR file named
Table 46 realmtool Options Option Description
Lists the realm names.
Lists the users in the specified realm. This release has two realms:
-add <username password
Adds the specified user to the
Adds a group to the
Adds a user to the
certificaterealm by importing a file containing an X509 certificate.
-remove <realm-name username>
Removes a user from the specified realm.
Removes a group.
To add a user to the default realm you specify the
-addflag. The following command will add a user named robin who is protected by the password red, and will include robin in the bird and wing groups:runclient -client <appjar> [-name <name>] [-textauth] [-Dj2eelogin.name=guest -Dj2eelogin.password=guest123] [app-args] <table> <caption> Table 47 runclient Options </caption> <tr> <th> Option </th> <th> Description </th> </tr> <tr> <td>
-client <appjar></td> <td> The J2EE application EAR file. </td> </tr> <tr> <td>
-name <name></td> <td> The display name of the J2EE application client component. </td> </tr> <tr> <td> -textauth </td> <td> Causes the client container to prompt for the user name and password are from the command line, not from a pop-up window. </td> </tr> <tr> <td> -Dj2eelogin.name=guest -Dj2eelogin.password=guest123 </td> <td> Prevents the client container from prompting for the user name and password. </td> </tr> <tr> <td>
<app-args></td> <td> Any arguments required by the J2EE application. </td> </tr> </table>
Before executing the
runclientcommand, you must set the
APPCPATHenvironment variable to the name of the client JAR stub file that is generated during deployment. The following example shows how to set
APPCPATHon a Windows machine. The
runclientcommand that follows launches a client named
FabulousClient. The J2EE application of this client resides in the
- Copy the EAR file to the remote client's machine.
- Copy the client JAR stub file to the remote client's machine.
- Set the
APPCPATHenvironment variable to the name of the client JAR stub file.
- Set the
VMARGSenvironment variable to the following value:
- For example, if the remote host were named
murphyyou would set the
VMARGSvariable on a Windows machine as follows:
Table 48 verifier Options Syntax Description
Displays a verbose version of output.
Writes the results to the specified
<output-file>, overriding the default
Runs the stand-alone GUI version.
Determines whether warnings or failures are reported. The
<report-level>may be either
By default, only warnings and failures are reported.