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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

An Application ExampleThat Consumes Messages from a Remote Server<br />

974<br />

Building, Deploying, and Running the<br />

consumeremoteModules Using NetBeans IDE<br />

To package the modules using NetBeans IDE, perform these steps:<br />

1. In NetBeans IDE, choose Open Project from the File menu.<br />

2. In the Open Project dialog, navigate to<br />

tut-install/javaeetutorial5/examples/jms/consumeremote/.<br />

3. Select the earthmdb folder.<br />

4. Select the Open as Main Project check box.<br />

5. Click Open Project.<br />

6. Right-click the earthmdb project and choose Build.<br />

This command creates a JAR file that contains the bean class file and the sun-ejb-jar.xml<br />

deployment descriptor file.<br />

7. Choose Open Project from the File menu.<br />

8. Select the jupiterclient folder.<br />

9. Select the Open as Main Project check box.<br />

10. Click Open Project.<br />

11. Right-click the jupiterclient project and choose Build.<br />

This target creates a JAR file that contains the client class file and a manifest file.<br />

To deploy the earthmdb module and run the application client, perform these steps:<br />

1. Right-click the earthmdb project and choose Set as Main Project.<br />

2. Right-click the earthmdb project and choose Undeploy and Deploy.<br />

3. Copy the jupiterclient module to the remote system (jupiter):<br />

a. In a terminal window, change to the directory<br />

tut-install/javaeetutorial5/examples/jms/consumeremote/jupiterclient/dist/.<br />

b. Type a command like the following:<br />

cp jupiterclient.jar F:/<br />

That is, copy the client JAR file to a location on the remote filesystem.<br />

4. Go to the directory on the remote system where you copied the client JAR file.<br />

5. Use the following command:<br />

appclient -client jupiterclient.jar<br />

On jupiter, the output of the appclient command looks like this:<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!