If you already went through the deployment process you can run the application by clicking here.
This sample application illustrates the implementation of a global Bean-Managed Transaction (BMT). The application simulates the transfer of funds from one account to another in which the accounts may come from different banks. The transaction is "global" because it involves multiple data sources: a local bank and a foreign bank.
The first page of the application is an HTML form that allows the user to enter the following:
When the user clicks the Transfer Funds button, the GlobalBmtServlet is invoked to perform the following transaction:
(1) Get a global transaction from the EJB context.
private transient javax.ejb.SessionContext m_sessionContext;(2) Start the global transaction using the javax.transaction.UserTransaction.begin() method. Get the account balance for the Source Account and Recipient Account.
:
:
javax.transaction.UserTransaction txn = m_sessionContext.getUserTransaction( );
(3) Withdraw the transfer amount from the Source Account by deducting the amount from its balance. If the Source Account is from a Local Bank, LocalBankAccount.withdraw( amount ) is invoked. Otherwise, ForeignBankAccount.withdraw( amount ) is executed.
(4) Deposit the transfer amount to the Recipient Account by adding the amount to its balance. If the Recipient Account is from a Local Bank, LocalBankAccount.deposit( amount ) is invoked. Otherwise, ForeignBankAccount.deposit( amount ) is executed.
(5) Get the updated balance of the Source Account. If the balance is not negative, the transaction can be completed and all database updates within the transaction will be committed. This is implemented using the javax.transaction.UserTransaction.commit( ) method. On the other hand, if the balance is negative, this means that the Source Account does not have enough funds to transfer. When this exception occurs, the transaction cannot be completed -- the transaction must be rolled back so that the database updates will not take effect. This is implemented using the javax.transaction.UserTransaction.rollback( ) method.
The global bean-managed transaction described above is implemented in the GlobalBankServiceEJB.transferFunds( ) method.
This section describes how to register an underlying database driver with iPlanet 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 driver. A subsequent section of this document describes how to populate the database tables and register the data sources required by the sample.Determine if the iPlanet Type 2 Driver is Registered
On Windows, the application server automatically detects whether or not drivers for any of the supported databases are available. If a suitable driver is present, the driver will be automatically registered during installation of the application server.On UNIX, if during installation, either "Typical" or "Express" options were selected, JDBC database drivers will not be registered with the application server. If you are unsure as whether or not the client driver was registered, use the application server administrative tool to determine the drivers registered with the application server.
1. Start the application server administrative tool:install_dir/ias/bin/ksvradmin
2. If the application server instance is not listed automatically, connect to your application server instance by selecting File->New->Server. Click on Localhost to specify the default connection settings. Enter the iPlanet Application Server administrator's password and click on OK.3. Click on the Database button and expand the server name (default name of iAS1) to see the database driver settings. 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 with the application server. Go to the next section to register the driver.
Register iPlanet Type 2 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 iPlanet.UNIX: Type 2 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:
install_dir/ias/bin/db_setup.sh3. You will be asked to enter the iAS installation root directory.Please enter the iAS installation root directory[eg: /usr/iplanet/ias6]:4. Follow the instructions to set up an iPlanet Type 2 JDBC Driver.
/usr/iplanet/ias6Do you want to use third party JDBC drivers or native drivers.5. You will be asked if iAS should be configured with connectivity to Oracle, Sybase, Informix or DB2 databases. Enter 'y' for the database type(s) of interest. For example, if you are configuring iAS for connectivity to an Oracle database, enter 'y' for the following question:
1. iPlanet Type 2 JDBC Drivers
2. Third party jdbc drivers
To accept the default shown in brackets, press the Enter key.Select the component you want to install ? (1/2) [1]:
Enter 1 and hit Return or simply hit the Return key.
Do you want to configure iAS with Oracle connectivity [n]? (y/n)6. You will be asked if you want to configure a Resource Manager. For this sample, you need to register Resource Managers to support distributed and possibly heterogeneous transactions. To illustrate how global transactions work, it is highly recommended that the Local Bank database and the Foreign Bank database be created on different database servers. In this case, there will be 2 Resource Managers needed: one for the Local Bank database and another for the Foreign Bank database.
yEnter the Oracle home directory [/usr/oracle/product/8.1.6]:
/usr/oracle/product/8.1.6Enter the ORACLE_SID [IAS]:
IASFor example, here is how the Resource Managers are created for the scenario where the Local Bank database is in an Oracle server called fondue.red.iplanet.com, and the Foreign Bank database in another Oracle server called nasguru.red.iplanet.com:
Do you want to configure Resource Manager (y/n) [n]?7. Restart the application server using the iascontrol stop and iascontrol start commands. Refer to the Getting Started section for more information.
yHow many Resource Managers do you want to configure [1]?
2Enter Resource Manager Name: [rm1]:
fondueEnter Database Type: (Oracle) [Oracle]:
OracleConstruct OpenString:
Please enter database server name: fondue.red.iplanet.com
Please enter database user name: system
Please enter database user password: manager
Enable this Resource Manager (y/n) [y]?
yEnter Resource Manager Name: [rm2]:
nasguruConstruct OpenString:
Please enter database server name: nasguru.red.iplanet.com
Please enter database user name: system
Please enter database user password: manager
Enable this Resource Manager (y/n) [y]?
y8. Verify that the database driver was registered, by going through the steps in the previous section, Determine if the iPlanet Type 2 Driver is Registered.
If Resource Managers were not created in the previous section, Register iPlanet Type 2 Driver if Necessary, they can be created using the iPlanet Application Server Administration Tool. A Resource Manager must be created for each database server that is used in this application. If the Local Bank database resides on one database server and the Foreign Bank database resides on another database server, 2 resource managers must be created.
- Start the iPlanet Application Server Administration Tool: install_dir/ias/bin/ksvradmin
- If the application server instance is not listed automatically, connect to your application server instance by selecting File->New->Server. Click on Localhost to specify the default connection settings. Enter the iPlanet Application Server administrator's password and click on OK. Click on the Application Server instance.
- Click on the Transactions button.
- Click on the Configuration tab.
- Check the Enable Global Transactions checkbox.
- Click on the Resource Manager tab.
- Click the Add button at the bottom of the Resource Manager tab to create a Resource Manager for the Local Bank database server. This will launch the New Resource Manager window. Enter the information required for accessing the database. Give the resource manager a unique name and make sure that the Enabled checkbox is checked.
For example, to create a Resource Manager named fondue for an Oracle database server called fondue.red.iplanet.com:
- Enter fondue as Name.
- Enter the following as the Open String:
Oracle_XA+DB=fondue.red.iplanet.com+Acc=P/system/manager+Sqlnet=fondue.red.iplanet.com+SesTm=90+Threads=True
Note that the Open String for Oracle is in this format:
Oracle_XA+DB=<SERVER_INSTANCE>+Acc=P/<USERNAME>/<PASSWORD>+Sqlnet=<SERVER_INSTANCE>+SesTm=<SESSION_TIME_OUT>+Threads=<IS_THREADSAFE>
- Set Type to oracle
- Set Thread Mode to multiple_associations
- Check the Enabled checkbox
- Click the OK button to close the New Resource Manager window. The new Resource Manager will appear in the Resource Manager tab.
IMPORTANT:
- The machine where the iPlanet Application Server resides must have been previously configured to have access to both the Local Bank and Foreign Bank database servers before the Resource Managers are created. For example, Oracle database servers should be accessible using the SQL Plus utility on the machine where the iPlanet Application Server resides.
- The steps for creating a Resource Manager vary depending on the type of database. For example, when creating a Resource Manager for an Oracle database, there are recovery-related catalog tables that need to be created.
To create the catalog tables required for Oracle:
- Navigate to the <ORACLE_HOME>/rdbms/admin directory and find the xaview.sql script:
- Login to Oracle's sqlplus utility as user sys and run the xaview.sql script:
SQL> @xaview
For details on how to set up a resource manager, please refer to the iPlanet Application Server Administration Guide's section on Setting Up Resource Managers for Distributed Transactions.
- Repeat the previous step to create a Resource Manager for the Foreign Bank database server. For example, to create a Resource Manager named nasguru for an Oracle database server called nasguru.red.iplanet.com:
- Enter nasguru as Name.
- Enter the following as the Open String:
Oracle_XA+DB=nasguru.red.iplanet.com+Acc=P/system/manager+Sqlnet=nasguru.red.iplanet.com+SesTm=90+Threads=True
- Set Type to oracle
- Set Thread Mode to multiple_associations
- Check the Enabled checkbox
- Click the OK button to close the New Resource Manager window. The new Resource Manager will appear in the Resource Manager tab.
- Restart the application server using iascontrol stopand iascontrol start from the command line.
Before you can create and populate the database tables, it is necessary to create the localbank and foreignbank users. These users will own the tables created for the sample application. To illustrate how global transactions work across multiple data sources, it is strongly recommended that the localbank user and its tables be created in one database server, and the foreignbank user and its tables be created in another database server. However, if resource constraints make this impossible, the application will also work if the localbank and foreignbank users and their tables are created in the same database server.The following example shows how to create 2 new users: localbank and foreignbank using the Oracle SQL Plus utility. It is mandatory that the localbank and foreignbank users be used to create the database tables for this sample application.
To define a new Oracle user called localbank:
1. Use SQL Plus and login to the database server where the Local Bank database will be created.To define a new Oracle user called foreignbank:SQL > create user localbank identified by localbank;
The first localbank is the user name and the second localbank is the password.
2. Grant connect, resource, and dba privileges to the localbank Oracle user.
SQL> grant connect, resource, dba to localbank identified by localbank;
1. Use SQL Plus and login to the database server where the Foreign Bank database will be created.Now that you've identified the users for the application tables, the next step is to create and populate the tables.SQL > create user foreignbank identified by foreignbank;
The first foreignbank is the user name and the second foreignbank is the password.
2. Grant connect, resource, and dba privileges to the foreignbank Oracle user.
SQL> grant connect, resource, dba to foreignbank identified by foreignbank;
For this application, the following databases need to be created on different database servers:Creating the Local Bank Database
To create the Local Bank database, there is a script named setup_localbank_<rdbms_type>.sh for Unix (setup_localbank_<rdbms_type>.bat for Windows) which configures the database tables. (Replace <rdbms_type> with ora for Oracle, syb for Sybase). The script performs the following steps:
Go to the install_dir/ias/ias-samples/transactions/global/schema
directory and find the appropriate file that corresponds to the database of
interest.
The following instructions assume that you have either the Oracle sqlplus facility or the Sybase client software loaded on your system.
1. Ensure that the RDBMS environment variable is set appropriately. For example, ORACLE_HOME or SYBASE.
2. Run setup_localbank_<rdbms type>.sh on Unix or setup_localbank_<rdbms type>.bat on Windows.
Oracle Table Creation and Population
For example, with Oracle, run the setup_localbank_ora.sh
script as shown below:
<TNS Name> is the Oracle service or TNS name which maps to the appropriate Oracle database instance.
localbank and localbank 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.
<Resource Manager> is the name of the Resource Manager that is associated with the database server where the Local Database resides. This must be the same name that was used when a Resource Manager was created for the Local Database in the previous section, Create Resource Managers.
To create the Foreign Bank database, there is a script named setup_foreignbank_<rdbms_type>.sh for Unix (setup_foreignbank_<rdbms_type>.bat for Windows) which configures the database tables. (Replace <rdbms_type> with ora for Oracle, syb for Sybase). The script performs the following steps:
Go to the install_dir/ias/ias-samples/transactions/global/schema
directory and find the appropriate file that corresponds to the database
of interest.
The following instructions assume that you have either the Oracle sqlplus facility or the Sybase client software loaded on your system.
1. Ensure that the RDBMS environment variable is set appropriately. For example, ORACLE_HOME or SYBASE.
2. Run setup_foreignbank_<rdbms type>.sh on Unix or setup_foreignbank_<rdbms type>.bat on Windows.
Oracle Table Creation and Population
For example, with Oracle, run the setup_foreignbank_ora.sh
script as shown below:
<TNS Name> is the Oracle service or TNS name which maps to the appropriate Oracle database instance.
foreignbank and foreignbank 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.
<Resource Manager> is the name of the Resource Manager that is associated with the database server where the Foreign Database resides. This must be the same name that was used when a Resource Manager was created for the Foreign Database in the previous section, Create Resource Managers.
The datasource needs to be registered to the iPlanet Application Server. Go to the directory
install_dir/ias/ias-samples/transactions/global/schema
. Make necessary changes to the and localbank XML datasource files . Here is an example of a datasource file with Oracle as the database (foreignbankdb-ias-ora-type2.xml):
<ias-resource>
</ias-resource>
<resource>
<jndi-name>jdbc/transactions/global/ForeignBankDB</jndi-name>
<jdbc>
<datasource>pusti.world</datasource>
<database>dummy</database>
<username>foreignbank</username>
<password>foreignbank</password>
<driver-type>ORACLE_OCI</driver-type>
<resource-mgr>rm2</resource-mgr>
</jdbc>
</resource>
After modifying the datasource XML files for both localbank and foreignbank to suit your database connection requirements, run the iasdeploy command against each file to register the datasource in the application server.
For example, if you are using Oracle,
1. Go to the directory
install_dir
/ias/ias-samples/transactions/global/schema
.2. Execute the following command to register the JDBC datasources:
iasdeploy regdatasource localbankdb-ias-ora-type2.xml
iasdeploy regdatasource foreigndb-ias-ora-type2.xml
Now that you've registered the JDBC driver and datasources for the sample, you're ready to deploy the application.
Command Line Interface (CLI)-based Deployment describes how to manually register the sample application in iPlanet using a Command Line Interface (CLI). This is the fastest means of deploying the application to the application server.Graphical User Interface (GUI)-based Deployment describes how to use the iPlanet Deployment Tool to import and deploy the sample application. Alternatively, you can also assemble the application from scratch and deploy it using the Deployment Tool.
The transactions-globalbmt.ear file is an Enterprise Archive (EAR) file that contains the Web Archive (WAR) file for the application. Since this application does not have any EJB's, there is no JAR file involved.
Deploying the pre-built transactions-globalbmt.ear file is simple.
1. Go to the root of the application's directory:
install_dir/ias/ias-samples/transactions/global/bmt/2. Execute iasdeploy to deploy the application to the application server:
install_dir/ias/bin/iasdeploy deployapp transactions-globalbmt.ear3. Restart the application server using the iascontrol stop and iascontrol start commands.The deployment process involves the following operations:
iasdeploy authenticates against the local application server's administrative server. the EAR file is transferred to the administrative server. the administrative server begins the registration process: parses the EAR file and embedded WAR and EJB JAR files registers the J2EE application in the iPlanet Registry within the directory server registers the embedded J2EE modules (WARs and EJB JARs) in the iPlanet Registry within the directory server extracts the EJB JAR and WAR modules to the JAR/ directory. expands the content of the J2EE modules to the APPS/transactions-globalbmt directory.
Now that the application has been deployed, proceed to Verifying Registration.
Two approaches to using the Deployment Tool are described:
Import Pre-existing EAR File to quickly deploy the application. None of the application assembly steps are covered by this section. On average, this approach will take 15 minutes.or
Assemble Application from Scratch to learn how to use Deployment Tool to assemble and deploy the application from scratch. On average, this approach will take from 30 to 60 minutes.
1. Launch the Deployment Tool.
UNIX: Execute install_dir/ias/bin/deploytool2. Open the transactions-globalbmt.ear fileWindows: Start->Programs->iPlanet Application Server 6.0->iAS Deployment Tool
To compile the application sources, do the following from the command line:
1. Launch the Deployment Tool:UNIX: Execute install_dir/ias/bin/deploytool&2. Create transactions-globalbmt.jar:Windows: Programs->iPlanet Application Server 6.0->iAS Deployment Tool
3. Insert all class files needed in the transactions-globalbmt.jar file:
- In the startup dialog, select New EJB Application (.jar file)
- Alternatively, if Deployment Tool is already started, select File -> New.
- Click on EJB JAR Module.
- Enter transactions-globalbmt.jar as the File Name.
- Click on Browse to navigate to install_dir/ias/ias-samples/transactions/global/bmt/assemble
- Click on OK to exit the dialog window.
- The EJB JAR module appears in the EJB pane of the Deployment Tool window.
- Click on Component View to see only the name of the EJB JAR module without the directory path.
5. Edit the EJB Descriptor.
- Select transactions-globalbmtEjb from the EJB Modules window and right click. Select Insert (Alternatively, select the module, select Edit->Insert)
- Navigate to this directory:
install_dir/ias/ias-samples/transactions/global/bmt/build/classes/samples/transactions/components- In the left hand pane, select all class files. Click on the right arrow (>) to move the selected files into the right side of the dialog window.
- Navigate to this directory:
install_dir/ias/ias-samples/transactions/global/bmt/build/classes/samples/transactions/global/bmt/ejb- In the left hand pane, select all class files. Click on the right arrow (>) to move the selected files into the right side of the dialog window.
- Click on Resolve to determine if any of the included classes depend on classes that are not part of the EJB JAR module
- Click on Insert to add the classes to the EJB JAR module.
- Since you selected Component View, you'll see the EJB listed in the EJB module window.
- Expand the transactions-globalbmtEjb folder from the EJB Modules window.
- Select the GlobalBankServiceEJB bean, right click and select Edit Descriptor.
- Set the EJB Name to samples.transactions.global.bmt.ejb.GlobalBankServiceEJB to insure uniqueness.
- Select the References tab from the EJB Descriptor window.
- Enter the following information in the References to Resources section:
Resource Name Description Resource Class Authorization JNDI Name jdbc/transactions/LocalBankDB Local Bank Database javax.sql.DataSource Container jdbc/transactions/global/LocalBankDB jdbc/transactions/ForeignBankDB Foreign Bank Database javax.sql.DataSource Container jdbc/transactions/global/ForeignBankDB Close the EJB Descriptor window by clicking on the X in the upper right hand corner of the window. Click on Yes when asked to save the changes.
1. Create a new WAR file.
2. Insert all class files needed in the WAR file.
- In the startup dialog, select New Web Application (.war file). Alternatively, if Deployment Tool is already started, select File -> New.
- Click on Web Application.
- Enter transactions-globalbmt.war as the File name.
- Click on Browse to navigate to this directory:
install_dir/ias/ias-samples/transactions/global/bmt- Click on the assemble folder and click the OK button to exit the dialog window.
- The WAR file appears in the Web Applications pane of the Deployment Tool window.
- Click on Component View to see only the name of the WAR file without the directory path.
3. Add all JSP and HTML files needed in the WAR file.
- Select transactions-globalbmt from the Web Applications window. Right click and select Insert. Alternatively, select Edit->Insert from the menu bar.
- Navigate to this directory:
install_dir/ias/ias-samples/transactions/global/bmt/build/classes/samples/transactions/global/bmt/servlet- Select all files.
- Click on the right arrow (>) to move all classes into right side of the dialog window.
- Click on Resolve to determine if any of the included classes depend on classes that are not part of the WAR module.
- Click on Insert to add the classes to the WAR module.
4. Edit the Web Application Descriptor.
- Select transactions-globalbmt from the Web Applications window. Right click and select Insert. Alternatively, select Edit->Insert from the menu bar.
- Navigate to this directory: install_dir/ias/ias-samples/transactions/global/bmt/src/docroot
- Select all files.
- Click on the right arrow (>) to move these files into right side of the dialog window.
- Click on Resolve to modify the location of these files relative to the root of the WAR file.
- For each file: click the file name, set the Update Dest. Path to blank since the application requires that these files be located at the root of the WAR module. Click on Update to modify the relative location.
- Click on OK to close the Resolve dialog window.
- Click on Insert to close the insert dialog window and to add the files to the WAR file.
5. Save and close the WAR file.
- Select the transactions-globalbmt WAR file from the Web Applications window. Right click and select Edit Descriptor. Alternatively, select Edit->Edit Descriptor from the menu bar.
- Click on the References tab.
- Click the Add button in the References to EJBs defined elsewhere section.
- Enter the following information:
Reference Linked to Bean Bean Type Bean Home Interface Bean Remote Interface ejb/samples.transactions.global.bmt.ejb.GlobalBankServiceEJB samples.transactions.global.bmt.ejb.GlobalBankServiceEJB Session samples.transactions.global.bmt.ejb.GlobalBankServiceHome samples.transactions.global.bmt.ejb.GlobalBankService Make sure you hit the Return or Enter key after each entry.
- Click on X in the upper right hand corner of the Web App Descriptor window in order to close it. Click on Yes when asked to save the changes.
- Select the transactions-globalbmt file from the Web Applications window.
- Select File->Close from the menu bar and click on Yes when asked to save the changes.
1. Create a new EAR file:
2. Add JAR and WAR files:
- In the startup dialog, select New J2EE Application (.ear file). Alternatively, if Deployment Tool is already started, select File -> New.
- Click on J2EE Application.
- Enter transactions-globalbmt.ear as the File name.
- Click on Browse to navigate to this directory:
install_dir/ias/ias-samples/transactions/global/bmt/assemble- Click on OK to exit the dialog window.
- The EAR file appears in the J2EE Applications pane of the Deployment Tool window.
- Click on Component View to see only the name of the EAR without the directory path.
3. Set Context Root for Web Application
- Select transactions-globalbmt from the J2EE Applications window. Right click and select Insert.
- Navigate to the directory install_dir/ias/ias-samples/transactions/global/bmt/assemble
- Select both transactions-globalbmtEjb.jar and transactions-globalbmt.war files.
- Click on the right arrow (>) to move the file into right side of the dialog window.
- Click on Resolve to modify the location of this file relative to the root of the EAR file.
- Select the file and set the Update Dest. Path to blank since the J2EE modules should appear at the root of the EAR file. Click on Update to modify the relative location.
- Click on OK to close the Resolve dialog window.
- Click on Insert to close the Insert dialog window and to add the files to the EAR file.
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/transactions-globalbmt/index.html the transactions-globalbmt value is the context root of the web application.
4. Save the EAR file.
- Select the EAR file from the J2EE Applications window. Right click and select Edit Descriptor
- Under the Context Root tab, set both the web application (WAR) name and the context root to transactions-globalbmt
- Close the Application Descriptor window by clicking on the X in the upper right hand corner of the window. Click on Yes when asked to save the changes.
- Select the transactions-globalbmt EAR file from the J2EE Applications window.
- Select File->Save to save the EAR file.
1. Select the transactions-globalbmt EAR file from the J2EE Applications 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 application server server by using the application server's Administrative Console. See the Security settings tab in the 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. The deployment may take several minutes to complete. Once the status of the deployment changes to Success, proceed to the next step.
7. Restart the application server using the iascontrol stop and iascontrol start commands.
1. Start the Application Server Admin Tool
UNIX: install_dir/ias/bin/ksvradmin2. Connect to your application server instance by selecting File->New->Server. Click on Localhost to specify the default connection settings. Enter the application server administrator's password and click on OK.Windows: Start->Programs->iPlanet Application Server->iAS Administration Tool
3. 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.
4.You should see a folder for the transactions-globalbmt J2EE application. The transactions-globalbmt folder with the world icon represents the web application module while the transactions-globalbmtEjb folder represents the EJB module that is packaged as part of the application.
To see more details associated with the application, you can use the Registry Editor tool:
1. Launch the Registry Editor: install_dir/ias/bin/kregedit
2. Navigate to the SOFTWARE/iPlanet/Application Server/6.0/ portion of the tree.
3. Browse the J2EE-Application/ tree and look for the transactions-globalbmt application.
4. Expand the transactions-globalbmt folder and explore this portion of the directory tree.
5. Now open the J2EE-Module/ tree and look for the transactions-globalbmt web application module entry and the transactions-globalbmtEjb EJB module entry.
6. Expand each of these folders and explore their contents.
1. Start the application either by clicking here or, if you've deployed the web server on a separate machine, by accessing:
http://<web server hostname>:<port>/NASApp/transactions-globalbmt/index.html2. Enter a value for Source Bank, Source Account ID, Recipient Bank and Recipient Account ID.
The Local Bank Accounts are listed below:
|
|
|
|
|
|
|
|
|
The Foreign Bank Accounts are listed below:
|
|
|
|
|
|
3. Enter a value for Transfer Amount. This must be a value that is not less than 0. If the Source Account is from a Local Bank, this value must not be more than the Local Account's Maximum Withdrawal Amount.
4. Click on Transfer Funds to execute the transaction.
|
|
Solution |
Please correct your entries. | The values entered in the required fields are either blank or contain incorrect values. | Make sure there is a value for all the required fields.
Transfer Amount must be a number greater than 0. |
Account ID X does not exist. | The value X that was entered for either the Source Account ID or Recipient Account ID is not one of the valid Account ID's listed above. | Make sure that both Source Account ID and Recipient Account ID are in the list of valid Account ID's shown above. |
Cannot withdraw from Source Account: Account has insufficient funds. | The Source Account does not have enough funds to transfer the requested amount to the Recipient Account. | Reduce the Transfer Amount to be less or equal to the Source Account Balance. |
Cannot withdraw from Source Account: Maximum withdrawal amount is 300. | The Transfer Amount exceeds the Maximum Withdrawal Amount that was defined for the Source Account. This only happens when the Source Account is from a Local Bank. Foreign Bank Accounts do not have a maximum withdrawal amount. | Reduce the Transfer Amount to be less or equal to the Account's Maximum Withdrawal Amount. |
For example, to rebuild the entire application from scratch, follow these steps:
1. Compile and Assemble Components and Web ApplicationExecute build in the install_dir/ias/ias-samples/transactions/global/bmt/src directory.
This will compile the source code and rebuild the WAR and EAR files.
2. Redeploy Application
Execute build deploy in the install_dir/ias/ias-samples/transactions/global/bmt/src directory.
3. Restart the Application Server using iascontrol stop and iascontrol start on the command line.
Copyright (c) 2001 Sun Microsystems, Inc. All rights reserved.