Home

 

Testing the Java EE Application Client

Now that the code has been updated, we can test the Java EE application client as follows:

Make sure that the WebSphere Application Server v7.0 is started.

Ensure that the RAD75EJBEAR enterprise application is deployed on the server:

In the Servers view, right-click WebSphere Application Server v7.0 and select Add and Remove Projects. Add the RAD75EJBEAR project if it is not deployed to the server already.
Do not add the RAD75AppClientEAR to the server. We run the application client outside of the server.

In the Enterprise Explorer, right-click RAD75AppClient and select Run As Æ Run Configurations.

In the Run Configurations dialog, double-click WebSphere v7.0 Application Client in the left pane. A New_configuration is added and displayed in the right pane (Figure | 7-11):

Figure 17-11 Create a new run configuration for the application client

Type RAD75AppClient in the Name field.
Select RAD75AppClientEAR as Enterprise application and RAD75AppClient as Application Client module.
Select Enable application client to connect to a server and accept WebSphere Application Server v7.0 as the specific server.

Click Apply, and then click Run.

If prompted with SSL Signer Exchange Prompt, click Yes.

If security is enabled in the Application Server, the Login at the Target Server po-up appears. Enter admin/admin (the user ID configured for the server) and click OK (Figure | 7-12).

Figure 17-12 Login to the secure server

A number of messages are displayed in the Console:

IBM WebSphere Application Server, Release 7.0

Java EE Application Client Tool

Copyright IBM Corp., 1997-2008

......

WSCL0013I: Initializing the Java EE Application Client Environment.

......

WSCL0035I: Initialization of the Java EE Application Client Environment

has completed.

WSCL0014I: Invoking the Application Client class

itso.rad75.client.control.BankDesktopController

The Bank Desktop window opens (Figure | 7-13).

Figure 17-13 Bank Desktop opens

Type a customer SSN and click Search. The customer and the accounts are displayed (Figure | 7-14).

Figure 17-14 Bank Desktop results

Type an invalid customer SSN and the name is displayed as (not found).

Close the client window.

Note: In the main method of the BankDesktopController we added the line:

bank.getAccounts("xxx");

Without this initial communication with the server to run the getAccounts query, the application client fails when run inside RAD v7.5.

Exception in thread "AWT-EventQueue-0" java.rmi.MarshalException: CORBA 
MARSHAL 0x4942f896 No; nested exception is: 
	org.omg.CORBA.MARSHAL: Unable to read value from underlying bridge :
		null  vmcid: IBM  minor code: 896  completed: No
	at com.ibm.CORBA.iiop.UtilDelegateImpl.mapSystemException
		(UtilDelegateImpl.java:271)
	at javax.rmi.CORBA.Util.mapSystemException(Util.java:84)
	at itso.bank.service._EJBBankRemote_Stub.getAccounts 
		(_EJBBankRemote_Stub.java)
	at itso.rad75.client.control.BankDesktopController.actionPerformed
		(BankDesktopController.java:40)

ibm.com/redbooks