Download
FAQ History |
API
Search Feedback |
Deploying and Running SimpleMessageApp
To deploy and run this example, go to the
<
INSTALL
>/j2eetutorial14/examples/ejb/simplemessage
directory.Creating the Administered Objects
This example requires the following:
If you have run the simple JMS examples in Chapter 33 and have not deleted the resources, you already have these resources and do not need to perform these steps.
To start the Admin Console, follow the instructions in Starting the Admin Console.
To create the connection factory, perform the following steps:
- In the tree component, expand the Java Message Service node.
- Select the Connection Factories node.
- On the JMS Connection Factories page, click New. The Create JMS Connection Factory page appears.
- In the JNDI Name field, type
jms/QueueConnectionFactory
.- Choose
javax.jms.QueueConnectionFactory
from the Type combo box.- Select the Enabled checkbox.
- Click OK.
To create the physical destination, perform the following steps:
To create the destination resource and link it to the physical destination, perform the following steps:
- In the tree component, expand Destination Resources.
- On the JMS Destination Resources page, click New. The Create JMS Destination Resource page appears.
- In the JNDI Name field, type
jms/Queue
.- Choose
javax.jms.Queue
from the Type combo box.- Select the Enabled checkbox.
- Under Additional Properties, click Add.
- Type
Name
in the Name field.- Type
PhysicalQueue
in the Value field.- Click OK.
Deploying the Application
Running the Client
After you deploy the application, you run the client as follows:
- In the directory
<
INSTALL
>/j2eetutorial14/examples/ejb/simplemessage
, type the following command on a single line:
appclient -client SimpleMessageAppClient.jar
- The client displays these lines:
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 should be displayed, wrapped in logging information:
MESSAGE BEAN: Message received: This is message 1
MESSAGE BEAN: Message received: This is message 2
MESSAGE BEAN: Message received: This is message 3Undeploy the application after you finish running the client.
Removing the Administered Objects
After you run the example, you can use the Admin Console to delete the connection factory and queue. These resources are needed for the JMS examples in Chapters 33 and 34, however, so if you plan to run those examples, do not delete the resources.
Download
FAQ History |
API
Search Feedback |
All of the material in The J2EE(TM) 1.4 Tutorial is copyright-protected and may not be published in other works without express written permission from Sun Microsystems.