10.12.2012 Views

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Writing Simple JMS Client Applications<br />

928<br />

6. Repeat steps 2 and 3.<br />

7. Recompile and repackage the SynchConsumer example on jupiter.<br />

If you are using NetBeans IDE, right-click the synchconsumer project and choose Clean and<br />

Build.<br />

If you are using Ant, go to the synchconsumer directory and type:<br />

ant<br />

8. On earth, run Producer. If you are using NetBeans IDE on earth, perform these steps:<br />

a. Right-click the producer project and choose Properties.<br />

b. Select Run from the Categories tree.<br />

c. In the Arguments field, type the following:<br />

queue 3<br />

d. Click OK.<br />

e. Right-click the project and choose Run.<br />

If you are using the appclient command, go to the producer/dist directory and type<br />

the following:<br />

appclient -client producer.jar queue 3<br />

9. On jupiter, run SynchConsumer. If you are using NetBeans IDE on jupiter, perform these<br />

steps:<br />

a. Right-click the synchconsumer project and choose Properties.<br />

b. Select Run from the Categories tree.<br />

c. In the Arguments field, type the following:<br />

queue<br />

d. Click OK.<br />

e. Right-click the project and choose Run.<br />

If you are using the appclient command, go to the synchconsumer/dist directory and<br />

type the following:<br />

appclient -client synchconsumer.jar queue<br />

For examples showing how to deploy <strong>Java</strong> <strong>EE</strong> applications on two different systems, see “An<br />

Application Example That Consumes Messages from a Remote Server” on page 971 and “An<br />

Application Example That Deploys a Message-Driven Bean on Two Servers” on page 977.<br />

Deleting the Connection Factory and Stopping the Server<br />

You will need the connection factory jms/JupiterConnectionFactory in Chapter 32, “<strong>Java</strong> <strong>EE</strong><br />

Examples Using the JMS API.” However, if you wish to delete it, go to the producer directory<br />

and type the following command:<br />

<strong>The</strong> <strong>Java</strong> <strong>EE</strong> 5<strong>Tutorial</strong> • June 2010

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!