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 existing 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>/hosts/default_host/WSsamples_app/servlets/
WebSphereSamples/AccountAndTransfer directory. If you run it from this
directory, the resulting servlet and client application class files
will go beneath it, in the WebSphereSamples/AccountAndTransfer
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 Enterprise Bean Configuration
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 deployed 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 view.
- Expand the following tree:
WebSphere Administrative Domain, <your_machine_node>, Default
Server, Default Container.
- Right-click the enterprise bean 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>/hosts/default_host/WSsamples_app/servlets/
WebSphereSamples/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.5.
- 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.5. Refer to Enterprise
Bean Configuration 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.5.
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 WebSphereSamples/AccountAndTransfer
under the <was_root>/hosts/default_host/WSsamples_app/servlets/
WebSphereSamples/AccountAndTransfer directory. Copy the new servlet
and resource bundle class files back to the <was_root>/hosts/default_host/WSsamples_app/servlets/
WebSphereSamples/AccountAndTransfer directory, replacing the class
file samples shipped with WebSphere Application Server Version 3.5.
- You can then run the new Account and Transfer enterprise
beans and servlets through the Enterprise
Bean Samples page.
|