The J2EETM Tutorial
Home
TOC
Index
PREV TOP NEXT Search
Feedback

Running the SimpleMessageEJB Example

Starting the J2EE Server

To view the output of the message-driven bean, you must start the server in verbose mode:

j2ee -verbose
 

Creating the Queue

  1. Create the queue with the j2eeadmin command:
    j2eeadmin -addJmsDestination jms/MyQueue queue
     
    
  2. Verify that the queue was created:
    j2eeadmin -listJmsDestination
     
    

Deploying the Application

  1. In deploytool, open the j2eetutorial/examples/ears/SimpleMessageApp.ear file (FileOpen).
  2. Deploy the SimpleMessageApp application (ToolsDeploy). In the Introduction dialog box, make sure that you select the Return Client JAR checkbox. For detailed instructions, see Deploying the J2EE Application.

Running the Client

  1. In a terminal window, go to the j2eetutorial/examples/ears directory.
  2. Set the APPCPATH environment variable to SimpleMessageAppClient.jar.
  3. Type the following command on a single line:
       runclient -client SimpleMessageApp.ear -name	
       SimpleMessageClient -textauth
     
    
  4. At the login prompts, enter j2ee for the user name and j2ee for the password.
  5. The client displays these lines:
    Sending message: This is message 1	
    Sending message: This is message 2	
    Sending message: This is message 3
     
    
  6. In the terminal window in which you've started the J2EE server (in verbose mode), the following lines should be displayed:
    MESSAGE BEAN: Message received: This is message 1	
    MESSAGE BEAN: Message received: This is message 2	
    MESSAGE BEAN: Message received: This is message 3
     
    
Home
TOC
Index
PREV TOP NEXT Search
Feedback