Our example Windows NT batch file, createbeans.bat,
automates the process of creating EJB JAR files for the sample Account
and Transfer enterprise beans. The batch process starts with the Account
and Transfer source files, compiles them, uses exisitng XML files to
run the jetace tool in line mode, and creates Account and Transfer EJB
JAR files that you can deploy with the WebSphere Administrative Console.
Be sure to read the comments in this file so you are familiar with all
of its 8 steps.
The following instructions explain how to to
run this batch file and test your own version of the Account and Transfer
enterprise beans. You can find the executable version of createbeans.bat,
plus the related source and XML files, in the <was_root>/EJBSamples/src/AccountAndTransfer
directory. If you run it from this directory, the resulting servlet
and client application class files will go beneath it, in the com/ibm/ejs/doc/client
subdirectory.
It is a good idea to deploy and test the sample Account and Transfer
enterprise beans that are shipped with the Application Server. This
will familiarize you with the deployment process and enterprise bean
behavior. Refer to Deploy the Sample Enterprise
Beans for instructions.
Steps to create and test your own deployable EJB
JAR files
First, create and deploy the EJB JAR files:
- If you have already delpoyed the sample Account
and Transfer beans shipped with the Application Server (which we recommend),
you will need to undeploy them using the WebSphere Administrative
Console. You might also want to save the deployed sample JAR files
for later use.
To undeploy the sample enterprise beans:
- From the Console, select the Topology tab.
- Expand the following tree:
WebSphere Admin Domain, <your_machine_node>, server1, server1_container.
- Right-click the enterprise be to undeploy.
- Select Remove from the menu.
To save the deployed sample JAR files:
rename them in the <was_root>/deployableEJBs directory, or copy
them to another location.
- Edit and run the executable batch file, createbeans.bat.
in the <was_root>/EJBSamples/src/AccountAndTransfer directory.
- Copy the newly created Account.jar and Transfer.jar
files to the <was_root>/deployableEJBs directory. These new
JAR files are created by the batch file (steps 3 and step 6), and
they replace the Account.jar and Transfer.jar files that ship with
WebSphere Application Server Version 3.0.
- Deploy the new Account and Transfer enterprise beans,
following the same process for deploying the sample Account and Transfer
enterprise beans shipped with WebSphere Application Server Version
3.0. . Refer to Deploy the Sample Enterprise
Beans for instructions.
Now you are ready to test them.
- If you have not made any servlet changes:
You can use the existing CreateAccount and TransferFunds servlets
and their resource bundle, ClientResourceBundle, that are shipped
with WebSphere Application Server Version 3.0.
If you have made servlet changes:
Use the new versions created by the batch file (step 8). You will
find the newly compiled class files in the subdirectory com/ibm/ejs/doc/client
under the <was_root>/EJBSamples/src/AccountAndTransfer directory.
Copy the new servlets and resource bundle to the <was_root>/hosts/default_host/default_app/servlets/com/ibm/ejs/doc/client
directory, replacing the samples shipped with WebSphere Application
Server Version 3.0.
- Open the create.html or transfer.html files with
your browser, and use them to run the CreateAccount or TransferFunds
servlets.
|