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 Deploys a Message-Driven Bean onTwo Servers<br />

This command creates a JAR file that contains the bean class file.<br />

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

8. Select the multiclient folder.<br />

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

10. Click Open Project.<br />

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

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

To deploy the multiclient module on the local server, perform these steps:<br />

1. Right-click the multiclient project and choose Properties.<br />

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

3. From the Server list, select Sun <strong>Java</strong> System Application Server (the local server).<br />

4. Click OK.<br />

5. Right-click the multiclient project and choose Undeploy and Deploy.<br />

To deploy the replybean module on the local and remote servers, perform these steps:<br />

1. Right-click the replybean project and choose Properties.<br />

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

3. From the Server list, select Sun <strong>Java</strong> System Application Server(the local server).<br />

4. Click OK.<br />

5. Right-click the replybean project and choose Undeploy and Deploy.<br />

6. Right-click the replybean project again and choose Properties.<br />

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

8. From the Server list, select Sun <strong>Java</strong> System Application Server (1) (the remote server).<br />

9. Click OK.<br />

10. Right-click the replybean project and choose Undeploy and Deploy.<br />

You can use the Services tab to verify that multiclient is deployed as an App Client Module on<br />

the local server and that replybean is deployed as an EJB Module on both servers.<br />

To run the application client, right-click the multiclient project and choose Run.<br />

This command returns a JAR file named multiclientClient.jar and then executes it.<br />

On the local system, the output of the appclient command looks something like this:<br />

running application client container.<br />

Sent message: text: id=1 to local app server<br />

Sent message: text: id=2 to remote app server<br />

982<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!