Java Reference
In-Depth Information
Click here to view code image
MESSAGE BEAN: Message received: This is message 1
MESSAGE BEAN: Message received: This is message 2
MESSAGE BEAN: Message received: This is message 3
The received messages may appear in a different order from the order in which
they were sent.
To Run the simplemessage Application Using Ant
1. In a terminal window, go to:
tut-install /examples/ejb/simplemessage/
2. To compile the source files and package the application, use the following
command:
ant
This target packages the application client and the message-driven bean, then cre-
ates a file named simplemessage.ear in the dist directory.
By using resource injection and annotations, you avoid having to create deploy-
ment descriptor files for the message-driven bean and application client. You need
to use deployment descriptors only if you want to override the values specified in
the annotated source files.
3. To create any needed resources, deploy the application, and run the client us-
ing Ant, use the following command:
ant run
Ignore the message that states that the application is deployed at a URL.
The output in the terminal window looks like this (preceded by application client
container output):
Click here to view code image
Sending message: This is message 1
Sending message: This is message 2
Sending message: This is message 3
To see if the bean received the messages,
check <install_dir>/domains/domain1/logs/server.log.
In the server log file, the following lines appear, wrapped in logging information:
Search WWH ::




Custom Search