background image

Building the clientsessionmdb Example

<< Running the Client | Using the JMS API with an Entity >>
<< Running the Client | Using the JMS API with an Entity >>

Building the clientsessionmdb Example

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:
tut-install/javaeetutorial5/examples/jms/clientsessionmdb/
3. To compile the source files and package the application, use the following command:
ant
The ant command creates the following:
An application client JAR file that contains the client class file and the session bean's remote
interface, along with a manifest file that specifies the main class
An EJB JAR file that contains both the session bean and the message-driven bean
An application EAR file that contains the two JAR files
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:
A Java EE Application That Uses the JMS API with a Session Bean
Chapter 32 · Java EE Examples Using the JMS API
969