Testing J2EE Application Clients

J2EE application clients are like regular Java™ applications. They contain a main() method that is executed, and they continue executing until the client virtual machine terminates. They can be run as typical "fat client" applications, to display a GUI that connects to a set of EJBs for persistence and business logic, or as server applications that provide services over the network. However, a J2EE application client has several advantages over regular Java applications, because it runs within a lightweight server container. This container can provide the application client with services that used to be available only to other J2EE components.

Prerequisite: Create an EAR that contains a complete application client project.

Benefits of using J2EE application clients instead of regular Java applications include:

To build a full command line to launch an application client, do the following:

  1. Switch to the Debug perspective (

    Window > Open Perspective > Other > Debug).

  2. In the main toolbar, expand the

    Run icon and select

    Open Run Dialog, alternatively expand the

    Debug icon and select

    Open Debug Dialog. An Application Client Launch Configurations dialog box opens.

  3. In the left pane of the Application Client Launch Configurations dialog box, select the type of configuration that you want to create, either WebSphere® v6.1, or v6.0 Application Client and click

    New.

  4. In the

    Name field, enter the name of your configuration.

  5. In the Application tab, select your enterprise application from the

    Enterprise Application list. If you want to make changes to your code while you are debugging, select the

    Enable hot method replace in debug mode check box.

  6. In the Arguments tab, you can add Program arguments and VM arguments as well as specifying your working directory. All WAS client launcher arguments begin with -CC. The default Program argument is -CCverbose=true, which will provide useful debugging information and at run-time. Any arguments that do not start with -cc will be passed to your application at run-time. For more information on the various Program arguments and VM arguments, refer to the WAS documentation for the Launch Client tool

  7. When you have completed configuring your launch configurations, click

    Apply to set your configuration, then click

    Run to launch the application client.

 

Related reference

Running multiple threaded WebSphere application clients