background image

Running the Client

<< Coding the Message-Driven Bean | Building the clientsessionmdb Example >>
<< Coding the Message-Driven Bean | Building the clientsessionmdb Example >>

Running the Client

3. In the Open Project dialog, navigate to tut-install/javaeetutorial5/examples/jms/.
4. Select the clientsessionmdb folder.
5. Select the Open as Main Project check box and the Open Required Projects check box.
6. Click Open Project Folder.
7. Right-click the clientsessionmdb project and choose Build Project. This task 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
8. Right-click the project and choose Deploy Project.
9. Right-click the project and choose Run Project.
This command returns a JAR file named clientsessionmdbClient.jar and then executes
it.
The output of the application client in the Output pane looks like this:
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. To undeploy the application,
follow these steps:
1. Click the Runtime tab.
2. Expand the Servers node.
3. Expand the Sun Java System Application Server node.
4. Expand the Applications node.
5. Expand the Enterprise Applications node.
6. Right-click clientsessionmdb and choose Undeploy.
To remove the generated files, right-click the clientsessionmdb project and choose Clean
Project.
A Java EE Application That Uses the JMS API with a Session Bean
The Java EE 5 Tutorial · September 2007
968