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.

This compiles the source code and creates an EAR file, confirmer.ear, in the dist<br />

directory.<br />

To deploy confirmer.ear, type the following command in a terminal window:<br />

ant deploy<br />

Running the confirmer Client in NetBeans IDE<br />

By default, the client sends a message to pig.bodine@example.com, a fictional email address. To<br />

change the email address in NetBeans IDE, do the following:<br />

1. Right-click the confirmer project in the Projects pane and select Properties.<br />

2. Click the Run category.<br />

3. In the Client Information area, under Arguments, enter the email address to which you<br />

want the message sent.<br />

4. Click OK.<br />

To run the client in NetBeans IDE, right-click the confirmer project in the Projects pane and<br />

select Run. You should see the following line when the client has successfully sent the test<br />

message:<br />

...<br />

Message sent to pig.bodine@example.com.<br />

...<br />

Running the confirmer Client Using Ant<br />

By default, the client sends a message to pig.bodine@example.com, a fictional email address. To<br />

change the email address, set the app-client.args property in<br />

tut-install/examples/ejb/confirmer/nbproject/project.properties to the email address<br />

to which you’d like the test message sent. For example:<br />

app-client.args=duke@example.com<br />

To retrieve the client JAR and run the client, enter the following command in a terminal:<br />

ant run<br />

You should see the following line when the client has successfully sent the test message:<br />

[exec] Message sent to pig.bodine@example.com.<br />

<strong>The</strong> confirmer Example Application<br />

If you changed the target email address, the test message should arrive in the user’s inbox in a<br />

few moments.<br />

Chapter 34 • Resource Connections 1009

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

Saved successfully!

Ooh no, something went wrong!