Product EJB - Container Managed Persistence
J2EE Developer's Guide Samples on iPlanet Application Server

Updated June 18, 2001

This sample is based on the Product EJB sample included in Sun's J2EE Developer's Guide, version 1.2.1 . The following instructions describe how to assemble and deploy the same EJB to iPlanet Application Server and how to access the EJB from both a simple Java client application using RMI/IIOP as well as from a Servlet client using HTTP. Although the client application and EJB offer minimal functionality, this sample should provide you with a basic understanding of RMI/IIOP and CMP support in iPlanet Application Server.

Setting Up the Environment

Getting Started includes a checklist of prerequisites for deploying sample applications to iPlanet.

J2EE Developer's Guide Samples Notes describes special considerations when deploying these sample.

Enable RMI/IIOP Support in the application server. (Performed automatically in a Test Drive installation).

Configuring the Database describes how to setup the database schema, load the content and register the JDBC data sources for the application.

Deploying and Running the Application

Select one of two approaches to deploying the application:

Command Line-based Deployment describes how to manually register the application in iPlanet using a Command Line Interface (CLI). This is the fastest means of deploying the application.

GUI-based Deployment describes how to use the iPlanet Deployment Tool to import and deploy the application. It also addresses assembling the application from scratch using the Deployment Tool.

Deploying the Client Application describes how to deploy the Java client application.

Running the Application describes how to start the application, navigate through it and how to troubleshoot in the event of problems.

Further Exploration

Compiling and Assembling the Application describes how to use command line tools to recompile the sources and rebuild the WAR and EJB modules and the overall EAR file.


Configuring the Database

The sample application requires the following database setup prior to running the application:
Ensure Database Requirements are Met

Ensure Database Driver is Registered

Identify or Create a Database User

Create and Populate Sample Database Tables

Ensure Database Requirements are Met

See the iPlanet Application Server Release Notes for database version requirements. The Product sample includes setup scripts for Oracle.

Ensure Database Driver is Registered

This section describes how to register an underlying database driver with the application server in the event that a driver was not registered during installation of the application server. The following instructions address only the registration of the database client driver. The subsequent section of this document will describe how to populate the database tables and register JDBC data sources.

If PointBase is to be used as the database, then the driver has already been registered and the data has been loaded during installation. However, the datasource needs to be registered with the application server. Got to the directory:

install_dir/ias/ias-samples/j2eeguide/product/src/schema/

And execute the command:

iasdeploy regdatasource ProductDB-pointbase-type4.xml

Use of the iasdeploy command requires that you first register the application server instance in the application server's administration tool. Refer to the Getting Started section for more information on using the iasdeploy command.

If you are using PointBase, proceed to the next section Command Line-based deployment. If you are using Oracle, then continue with the following instructions.

The following instructions address only the registration of the database client driver. Subsequent sections of this document will describe how to populate the database tables and register JDBC data sources.

Determine if the iPlanet Type 2 Driver is Registered

On UNIX, if during installation the application server, either "Typical" or "Express" installation options were selected, the native database driver will not be registered in the application server. If you are unsure as whether or not the client driver was registered, use the application server's Administrative Tool to determine status of JDBC drivers.
  1. Start the Admin Tool
  2. install_dir/ias/bin/ksvradmin
  3. Connect to your application server instance by selecting File->New->Server. Click on Localhost to specify the default connection settings. Enter the application server's administrator's password and click on OK.
  4. Click on the Database button and expand the server name (default name of iAS1) to see the database driver settings.
  5. If you see a red X on the client driver entry of interest, then you need to run the db_setup.sh script to register the native client driver in the application server. Go to the next section to register the driver.
On Windows, the application server automatically detects whether or not drivers for any of the supported databases are available. If a driver is present, the driver will be automatically registered during installation of the application server.

Register Driver if Necessary

For UNIX, if the driver has not been registered (you see the red X in the Admin Tool), then you must use the db_setup.sh command to register the driver with the application server.

UNIX: Database Driver Registration

  1. Ensure that your user ID is the same as the one used to install the application server.
  2. Execute the database driver registration script:
  3. install_dir/ias/bin/db_setup.sh
  4. Follow the instructions to register the native client driver. The default application server installation root directory is /usr/iplanet/ias6.
  5. For the Bank sample, you need not register a Resource Manager. (Resource Manager setup is required only in support of distributed and possibly heterogeneous transactions relying on the application server's built-in transaction manager).
  6. Restart the application server using the iascontrol stop and iascontrol start commands.
  7. After you've registered the driver, you can use the application server's Admin Tool (ksvradmin) to verify that the native driver entry no longer shows a red X and that the client library and other settings are accurate.

Identify or Create an RDBMS User

You should ensure that you have an RDBMS user defined for the sample application. You can use either an existing RDBMS user or define a new RDBMS user for the sample application. This RDBMS user will own the tables created for the sample application. The following example shows how to create a new user called j2eeguide using the Oracle SQL Plus utility. It is strongly recommended that a user such as j2eeguide be used to create the sample database tables. This approach will help to avoid confusion between table names used in other applications.

To define a new Oracle user:

  1. Use SQL Plus to define an Oracle user name (e.g. bank).

  2. SQL > create user j2eeguide identified by j2eeguide;

    Where the first j2eeguide is the user name and the second j2eeguide is the password.
  3. Grant connect, resource, and dba privileges to the j2eeguide Oracle user.

  4. SQL> grant connect, resource, dba to j2eeguide identified by j2eeguide;

Create and Populate the Sample RDBMS Tables

A shell script named setup_<rdbms type>.sh/.bat configures the database tables, populates the tables with sample data and updates the application server's registry with database information to support the sample application. The setup_<rdbms type>.sh/.bat script performs the following steps:

  1. Dynamically creates an XML file describing the JDBC datasource.
  2. Invokes the application server's iasdeploy regdatasource command to register the data source resource in the application server's registry.
  3. Verifies connectivity to the specified database.
  4. Creates the tables required by the sample application and populates the tables.
Go to the install_dir/ias/ias-samples/j2eeguide/product/src/schema/ directory and find the setup_<rdbms type>.sh/.bat file that corresponds to the database of interest. Now follow these instructions:
UNIX: Create and Populate RDBMS

Windows: Create and Populate RDBMS

UNIX: Create and Populate RDBMS

  1. Ensure that the RDBMS enviornment variable is set appropriately. For example, ORACLE_HOME or SYBASE.

  2.  
  3. Edit setup_<rdbms type>.sh. Set the GX_ROOTDIR environment variable to the location of the ias/ directory in your application server installation.
For example,
GX_ROOTDIR=/usr/iplanet/ias6/ias
3. Run setup_<dbname>.sh with the following arguments:
setup_ora.sh <TNS name> <dbusername> <dbpassword>
For example using Oracle:
setup_ora.sh iassample j2eeguide j2eeguide

Where:

<TNS Name> is the Oracle service or TNS name which maps to the appropriate Oracle database instance. In the example above, "iassample" is the Oracle service or TNS name. (This assumes that the Oracle client has been configured to recognize "iassample" as a valid Oracles service/TNS name.)

<dbusername> and <dbpassword> are the Oracle user name and password under which the tables will be created and populated. These are also the values that will be used by the sample application to access the Oracle database.

Since the setup_ora.sh script uses sqlplus, ensure that LD_LIBRARY_PATH includes $ORACLE_HOME/lib.

Windows: Create and Populate RDBMS

1. Ensure that the RDBMS enviornment variable is set appropriately. For example, ORACLE_HOME or SYBASE.

2. Run setup_<rdbms type>.bat with the following arguments:

setup_ora <TNS name> <dbusername> <dbpassword>

For example using Oracle:

setup_ora iassample j2eeguide j2eeguide
Where:

<TNS Name> is the Oracle service or TNS name which maps to the appropriate Oracle database instance. In the example above, "iassample" is the Oracle service or TNS name. (This assumes that the Oracle client has been configured to recognize "iassample" as a valid Oracles service/TNS name.)

<dbusername> and <dbpassword> are the Oracle user name and password under which the tables will be created and populated. These are also the values that will be used by the sample application to access the Oracle database.


Command Line-based Deployment

You have a choice of  deploying and registering the application through either command line utilities or the iPlanet Application Server Deployment Tool GUI. Since a complete EAR file is supplied, the fastest means of setting up the application is to use the command line utilities as described in this section. If you would like to experience either deploying through a GUI tool or assembling an application from scratch, then follow instructions in GUI-based Deployment.

The pre-built j2eeguide-product.ear file is a Enterprise ARchive file that contains the Web Archive (WAR) and EJB JAR files for the Product application. Within each of these JAR files reside the XML deployment descriptor files, application class files, JSPs and other content required by the application.

Deploying the pre-built j2eeguide-product.ear file is simple.

1. Go to the root of the Product sample directory:

install_dir/ias/ias-samples/j2eeguide/product/

2. Execute iasdeploy to deploy application to the local application server instance:

iasdeploy deployapp j2eeguide-product.ear

Refer to the Getting Started section for more information on using the iasdeploy command.

The deployment process involves the following operations:

Now you're ready to exercise the application by Deploying the Client Application.


GUI-Based Deployment

The Deployment Tool provides an easy-to-use means of assembling J2EE applications and deploying applications to iPlanet Application Server. For most cases, use of Deployment Tool is recommended over the approach of manually creating XML-based deployment descriptors and manually assembling J2EE modules and application JAR files.

Two approaches to using the Deployment Tool are described:

Import Pre-existing EAR File to quickly deploy the application to iPlanet using the Deployment Tool. None of the application assembly steps are covered by this section. On average, this approach will take 10 minutes.

or

Assemble the Application to learn how to use Deployment Tool to assemble the application from scratch and to deploy it to the application server. On average, this approach will take from 15-25 minutes.

Import Pre-existing EAR File

Since a pre-built Enterprise ARchive (EAR) file for the Product application is shipped with the application server, you can use the Deployment Tool to quickly read in the .ear file, modify deployment settings and deploy to the application server.Open the pre-existing sample EAR file.

1. Launch the Deployment Tool.

2. Open the EAR file

Proceed to Deploying the Application


Assemble Product Application

These instructions describe how to assemble the Product CMP application from scratch using only the compiled source files and the Deployment Tool.
  1. Compile Application Sources
  2. Create EJB JAR Module
  3. Create WAR Module
  4. Assemble EAR File
  5. Deploy Application

1. Compile Application Sources

To compile the application sources, simply execute "build compile" under the application's src/ directory. See the section Compiling and Assembling the Application for more information on recompiling the application using the supplied build facility.

2. Create EJB JAR Module

Insert EJB Classes

1. Create assembly location:
Create the new directory install_dir\ias\ias-samples\j2eeguide\product\assemble\ outside the Deployment Tool. You will assemble the application into JAR files and save them to this directory.
2. Launch the Deployment Tool:
UNIX: Execute install_dir/ias/bin/deploytool&

Windows: Programs->iPlanet Application Server 6.0->iAS Deployment Tool

3. Create j2eeguide-productEjb.jar:

4. Now insert all class files needed in the j2eeguide-productEjb.jar file:

Modify Deployment Descriptor Settings for Product EJB

1. Modify Descriptor for Product EJB

2. Begin Modifying the Product EJB Descriptor

EJB Attribute 
Attribute Type 
Key 
Database Column
description java.lang.String false DESCRIPTION
price double false PRICE
productId java.lang.String true PRODUCTID
Name
Type 
Value
findByDescriptionParms java.util.Vector description
findByDescriptionSQL java.lang.String select PRODUCTID from PRODUCT where DESCRIPTION = ?
findInRangeParms java.util.Vector low,high
findInRangeSQL java.lang.String select PRODUCTID from PRODUCT where PRICE between ? and ?

3. Close the Descriptor for the EJB

Now we can close the EJB descriptor by clicking on the X in the upper right hand corner of the descriptor window. Click on Yes when asked to save the changes.

Save and close j2eeguide-productEjb.jar

Now that we've assembled the EJB JAR module, we're ready to move on to assembling the Web Application aRchive (WAR) file.

3. Create WAR Module

Identify the Content for WAR File

1. Create j2eeguide-product.war:

2. Now insert all class files needed in the j2eeguide-product.war file:

Modify Web Application Descriptor

Now we need to make several changes to settings at the WAR module level. To do so, select either the WAR file path if in File View or the WAR module name if in Component View. Right click and select Edit Descriptor.

As described for the j2eeguide-productEjb.jar, in the following paragraphs, the title gives the tab name, where you have to enter the data given below.

1. General Tab

Name: j2eeguide-product
Distributable checked
Session Timeout (seconds): 500 (take server default)

2. iAS Tab

Distributed Session checked
Timeout (minutes): 15
Timeout Type Since last access
Data Synchronization Distributed

Save and close j2eeguide-product.war

Now that we've assembled both J2EE modules (EJB JAR and WAR), we're ready to move on to assembling the modules into an EAR file.

4. Assemble EAR File

1. Create j2eeguide-product.ear:

2. Add j2eeguide-productEjb.jar and j2eeguide-product.war Files:

3. Set the EJB references

Next, we need to set the EJB references from the WAR module

EJB References:

Reference Bean Type Bean Home Interface Bean Remote Interface Linked to Bean
MyProduct Entity j2eeguide.product.ProductHome j2eeguide.product.Product MyProduct

4. Set Context Root for Web Application

Next, we need to set the context root of the web application. This value will appear in URLs that access web application components. For example, in the URL http://localhost/NASApp/j2eeguide-product/ProductServlet the "j2eeguide-product" value is the context root of the web application.

4. Save j2eeguide-product.ear:

Now that the EAR file has been assembled, the next step is to deploy the application to an application server instance.

5. Deploy the Application

Now you're about to deploy the application by transferring the EAR file to a target iPlanet Application Server. First, you will identify the target server. After the EAR file is deployed to the server, post processing is performed. The post processing step involves running iasdeploy against the transferred j2eeguide-product.ear file. You will see the output from iasdeploy fed back to the deployment window. After this step, you will be able to run the application. No server restart is required.

Although you could perform the deployment steps manually by transferring the EAR file to the remote application server and executing j2eeappreg to register the EAR file, Deployment Tool provides a point and click means of deploying applications to remote iPlanet Application Servers.

If you followed the assembly instructions, then j2eeguide-product.ear is opened in Deployment Tool. If you opened the pre-existing EAR file, you are working with install_dir\ias\ias-samples\j2eeguide\product\j2eeguide-product.ear. If you are following the "Create EAR File from Scratch" instructions, you are modifying install_dir\ias\ias-sample\j2eeguide\product\assemble\j2eeguide-product.ear.

If you entered all deployment information manually, you can skip the following steps 1 to 3, because you have entered this information already.

1. Select the j2eeguide-product.ear file under the J2EE Application window.

2. Select File -> Deploy

3. If you have not already registered a target application server, do so now by clicking on the Register button. Enter the host name, administrative port number and username/password for the target application server. Otherwise, select a pre-registered target server.

Note: You may authorize additional users to deploy applications to an iAS server by using the iAS Administrative Console. See the Security settings tab in the iAS Administrative Console.

4. Click on Overwrite modules in case you are repeating the deployment step.

5. Click on Deploy to start the deployment process.

6. Now the file transfer and application registration begins. See the Deploy tab for the status of the deployment. Once the status of the deployment changes to Success, proceed to the next section.

Verifying Registration

After you've deployed the application, you're ready to use several iAS administrative tools to verify that the application is available. The first
  1. Start the application server Administrative Tool
  2. UNIX:
    install_dir/ias/bin/ksvradmin
    Windows:
    Start->Programs->iPlanet Application Server->iAS Administration Tool
  3. Connect to your application server instance by selecting File->New->Server. Click on Localhost to specify the default connection settings. Enter the application server's administrator's password and click on OK.
  4. Select the server name (default name of iAS1) and select the Application button in the top right hand corner of the window to see the applications registered in this instance of the application server.
  5. You should see several folders for the j2eeguide-product J2EE application. The j2eeguide-product folder with the world icon represents the web application module while thej2eeguide-productEjb folder represents the EJB module packaged as part of the sample application.
To see more details associated with the sample application, you can use the lower level tool kregedit:
  1. Execute kregedit to start the iPlanet Application Server Registry Editor GUI.
  2. Navigate to the SOFTWARE/iPlanet/Application Server/6.0/ portion of the tree.
  3. Browse the J2EE-Application/ tree and look for the j2eeguide-product application.
  4. Expand the j2eeguide-product folder and explore this portion of the directory tree.
  5. Now open the J2EE-Module/ tree and look for the j2eeguide-product web application module entry and the j2eeguide-productEjb EJB module entry.
  6. Expand each of these folders and explore their contents.
  7. Once you find the GUID associated with each EJB in the sample application, you can navigate through the SOFTWARE/iPlanet/Application Server/ClassDef/ folders to find out more details on each EJB. Expanding the matching GUID folders under the ClassDef folder will show you the detailed settings associated with each EJB. Many of these settings appear in the XML deployment descriptors for EJBs.

Deploy the Client Application

Although in practice, you will most likely script the following client application deployment steps, the manual steps are described below in order to provide you with a sense of deploying an RMI/IIOP client. Since manual steps such as setting CLASSPATH variables and such are prone to error, please review each step carefully.

As you review the sample build facility described in Compiling and Assembling the Application, you'll note the install_client target that automates steps 1, 5 and 6. Since the other steps are one time configuration changes, using the "build install_client" command will prove to be a great time saver for local client redeployments.

  1. Compile Client Source File
  2. Setup Client Directories
  3. Install RMI/IIOP Client Support
  4. Set the Client Environment Variables
  5. Copy Client Application Main Class
  6. Copy EJB Interfaces and iPlanet-Specific Stubs
  7. Check Your Client Setup

1. Compile Client Source File

To compile the application sources, simply execute "build compile" under the application's src/ directory. See the section Compiling and Assembling the Application for more information on recompiling the application using the supplied build facility.

2. Setup Client Directories

Establish a directory on your client system to support the client application class files, the EJB home and remote interface classes as well as the RMI/IIOP stub classes. The specific directory names shown below are not required and may be changed to suit your environment.

For example, on UNIX:

/opt/rmi-client/

For example, on Windows:

d:\rmi-client\

3. Install RMI/IIOP Client Support

If you are planning to run the Java application client on a machine other than the one on which the application server resides, refer to the RMI/IIOP chapter of the Developer's Guide for details on the configuration of the remote client environment.

4. Set the Client Environment Variables

Ensure that the PATH and CLASSPATH variables reference the appropriate JDK, javax.jar and iasclient.jar files.

Testing RMI/IIOP Client Access to EJBs on Same System
If you are experimenting with RMI/IIOP client access using a client that is on the same machine as the application server, you can take a shortcut to setting up the PATH and CLASSPATH variables. Simply reference the existing, pre-installed copies of the javax.jar, iasclient.jar and usr/java/bin/. For example, to test RMI/IIOP access locally, set the CLASSPATH variable as follows (since the Windows System PATH environment variable already contains usr/java/bin/ of the bundled JDK, there is no need to set this again on Windows):

Windows:

set CLASSPATH=d:\iplanet\ias6\ias\lib\java\javax.jar;d:\iplanet\ias6\ias\classes\java\iasclient.jar;%CLASSPATH%

You could set the Windows System CLASSPATH to avoid having to manually set the variable.

UNIX:

export CLASSPATH=/usr/iplanet/ias6/ias/classes/java/javax.jar:/usr/iplanet/ias6/ias/classes/java/iasclient.jar:$CLASSPATH

On UNIX, you will also need to modify the PATH to include the bundled JDK directory:

export PATH=/usr/iplanet/ias6/ias/usr/java/bin:$PATH

Testing RMI/IIOP Client Access to EJBs from a Remote System
If you are using a remote client system, then follow these steps to establish the appropriate PATH and CLASSPATH settings.

UNIX

Set your PATH environment variable to include the appropriate Java 2 bin/ directory:

export PATH=<Java 2 install>/usr/java/bin:$PATH

Set your CLASSPATH to include the standard Java Extension classes and the iPlanet RMI/IIOP client support JAR:

export CLASSPATH=/opt/rmi-client/iasclient.jar:/opt/rmi-client/javax.jar:$CLASSPATH

Doublecheck the CLASSPATH to ensure that it is set correctly (your CLASSPATH may vary from the one shown below).

echo $CLASSPATH
/opt/rmi-client/iasclient.jar:/opt/rmi-client/javax.jar:

Windows

Set your PATH environment variable to include the appropriate Java 2 bin/ directory:

set PATH=<Java 2 install>\usr\java\bin;%PATH%

Set your CLASSPATH to include the standard Java Extension classes (javax.jar) and the iPlanet client support JAR (iasclient.jar).

set CLASSPATH=d:\rmi-client\javax.jar;d:\rmi-client\iasclient.jar;%CLASSPATH%

5. Copy Client Application Main Class

Copy the ProductClient.class file from the compile location to the same package directory structure under your client application directory. (Typically, the client application would most likely belong to a different Java package, but for simplicity reasons, we've packaged the client and EJB in the same Java package).

Copy ProductClient.class to...

UNIX: /opt/rmi-client/j2eeguide/product/

Windows: d:\rmi-client\j2eeguide\product\
 

Set your client's CLASSPATH to include the Product client directory path:
UNIX:

export CLASSPATH=/opt/rmi-client:$CLASSPATH

Windows:

set CLASSPATH=d:\rmi-client;%CLASSPATH%

This setting will enable both the application main class as well as the Product-specific EJB interfaces and stubs to be accessed at run time.

6. Copy EJB Interfaces and Application Server-Specific Stubs

From the APPS/j2eeguide-product/j2eeguide-productEjb/ deployment area on the application server, copy the following files to the same package location (j2eeguide/product/) under the client application directory.

Product EJB Interface Classes:

EJB-Specific iPlanet Client Stubs:

7. Check Your Client Setup

Go to the rmi-client/ directory and navigate to the j2eeguide/product/ directory. You should see the following files:

Running the Sample

Review Configuration

Before running the sample, first double check your work thus far by ensuring that:

Executing the Java Application Client

From the rmi-client/ directory, execute the following command:

java j2eeguide.product.ProductClient <hostname> <port>

For example,

java j2eeguide.product.ProductClient hamlet 9010

Where:

<hostname> is the host name of the application server.

<port> is the IIOP port number of the RMI-IIOP bridge or cxs process on the application server.

The application should emit the following messages:

Compare this output with the ProductClient.java source code.

After client application completes, the PRODUCT table should contain the following rows:

SQL> select * from product;

DESCRIPTION PRICE PRODUCTID
----------- ----- ------------------------------
Ceramic Dog 14 123

Wooden Duck 13 456

Ivory Cat 19 999

Ivory Cat 33 789

Chrome Fish 22 876

Before rerunning the application client again, ensure that you reset the database table by either rerunning the product/src/schema/setup_ora script or by removing all rows from the table. The application will not work correctly unless you clean up the database table.

If you are using PointBase, you can remove and recreate the sample table by using the supplied src/schema/product_pb.sql script and the PointBase tools described in Using PointBase with iPlanet guide.

Execute Servlet Client

Go to the following URL to exercise the servlet front end:

http://<hostname>/NASApp/j2eeguide-product/ProductServlet

If your deployment process was successful, the servlet sends the following information to your browser:

Ceramic Dog: 10.0
Ceramic Dog: 14.0
Chrome Fish: 22.0
999: Ivory Cat 19.0
789: Ivory Cat 33.0
123: 14.0
456: 13.0
999: 19.0

Compare the resulting web page with the ProductServlet.java source code.

After servlet application completes, the PRODUCT table should contain the following rows:

SQL> select * from product;

DESCRIPTION PRICE PRODUCTID
----------- ----- ------------------------------
Ceramic Dog 14 123

Wooden Duck 13 456

Ivory Cat 19 999

Ivory Cat 33 789

Chrome Fish 22 876

Before rerunning the application client again, ensure that you reset the database table by either rerunning the product/src/schema/setup_ora script or by removing all rows from the table. The application will not work correctly unless you clean up the database table.

If you are using PointBase, you can remove and recreate the sample table by using the supplied src/schema/product_pb.sql script and the PointBase tools described in Using PointBase with iPlanet guide.

Troubleshooting

If you encounter problems when running the application, review the General Troubleshooting section to learn how to view logs files. Also review the Troubleshooting section of the RMI/IIOP chapter of the Developer's Guide.

If you don't receive data in the browser and the kjs log shows a "ORA-00001: unique constraint ..." message in the log or a "javax.ejb.DuplicateKeyException" in the rich client, the condition is most likely one in which the sample was run at least partially before. Consequently, there are rows in the Product table. Since this simple sample is not designed to handle this condition, you must manually remove all rows from the table prior to executing the application. Open a sqlplus session and enter TRUNCATE TABLE PRODUCT; to remove all entries from this table. Alternatively, rerun the product/src/setup_ora.sh/.bat script to drop and recreate the Product table.


Compiling and Assembling the Application

To easily recompile, assemble and deploy the application, see the Sample Application Build Facility document for details on using a build facility to quickly perform these tasks.

For example, to rebuild the entire application from scratch, follow these steps:

1. Compile and Assemble EJB JAR Components and Web Application

Execute "build" under j2eeguide/product/src/

The default target core will be executed to rebuild the EJB JAR and WAR files as well as the web application's EAR file.

2. Redeploy Application

Execute "build deploy" under j2eeguide/product/src/

3. Install the Java Client Application

Execute "build install_client" under j2eeguide/product/src/

Executing this target will install the class files required to run the client application under:

<iPlanet install path>/ias/rmi-client/

4. Restart Application Server

An application server restart will be necessary if you've modified either deployment descriptors or EJBs. For servlet and/or JSP modification, no restart is is necessary.

To clean the application build and assembly areas, execute "build clean".

Copyright (c) 2001 Sun Microsystems, Inc. All rights reserved.