Run a Java Application to Transfer Funds

You can also access enterprise beans from a Java client application, instead of a servlet. The TransferApplication uses the Transfer enterprise bean to show you how.

Reminders:

  • Before you can run any of the sample enterprise beans, you must deploy them. This sample requires you to deploy Account.jar and Transfer.jar.
  • As with the Transfer servlet, in order to transfer funds, the Transfer enterprise bean requires at least two Accounts: one to transfer to and one to transfer from. You must first use the Account enterprise bean to create these accounts.

To run this application from the same system as the Application Server:

  1. From a system command prompt, go to hosts/default_host/default_app/servlets.


  2. For Windows NT, enter: runTransferApp
    For UNIX, enter: runTransferApp.sh

To run this application from a different system than the Application Server:

  1. Ensure that the remote system has JDK 1.1.7. This level of the JDK is required.

  2. Set up directories for the Transfer Application package:

    /TransferApplicationRoot/
    (for runTransferApplication.bat or runTransferApplication.sh)

    /TransferApplicationRoot/com/ibm/ejs/doc/client/
    (for TransferApplication.class and ClientResourceBundle.class)

    /TransferApplicationRoot/deployedEJBs/
    (for DeployedAccount.jar and DeployedTransfer.jar)


    /TransferApplicationRoot/bin/
    (for ioser and ioserx files from the WebSphere AppServer bin directory)


    /TransferApplicationRoot/lib/
    (for the required jar files)

  3. Transfer the following files to these directories on your remote system:
    • runTransferApp script
    • TransferApplication.class and ClientResourceBundle.java
    • WebSphere jar files that are listed in the runTransferApp script
    • WebSphere ioser and ioserx binaries from the bin directory

  4. Edit the runTransferApp script and modify the paths to match your remote system setup.

  5. Edit ClientResourceBundle.java, change the the value of 'providerURL'  from 'localhost' to the hostname of your Application Server, and compile it.

  6. From a system command prompt, go to TransferApplication Root to run the Transfer Application:

    For Windows NT, enter: runTransferApp
    For UNIX, enter: runTransferApp.sh