The Java EE 5 Tutorial

Building, Deploying, and Running the clientsessionmdb Example Using Ant

    To build the application using Ant, do the following:

  1. Start the Application Server, if it is not already running.

  2. Go to the following directory:

  3. To compile the source files and package the application, use the following command:


The ant command creates the following:

The clientsessionmdb.ear file is created in the clientsessionmdb/dist directory.

To deploy the application and run the client, use the following command:

ant run

Ignore the message that states that the application is deployed at a URL.

The client displays these lines:

running application client container.
To view the bean output,
 check <install_dir>/domains/domain1/logs/server.log.

The output from the enterprise beans appears in the server log (domain-dir/logs/server.log), wrapped in logging information. The Publisher session bean sends two sets of 18 messages numbered 0 through 17. Because of the message selector, the message-driven bean receives only the messages whose NewsType property is Sports or Opinion.

Undeploy the application after you finish running the client. Use the following command:

ant undeploy

To remove the generated files, use the following command in the clientsessionmdb, clientsessionmdb-app-client, and clientsessionmdb-ejb directories:

ant clean