Building, Packaging, Deploying, and Running the Application
The source code for the Coffee Break application is located in the directory
<
INSTALL
>/javaeetutorial5/examples/coffeebreak/
. Within thecb
directory are subdirectories for each web application--cb
,cb-saaj
, andcb-jaxws
--and a directory,cb-common
, for classes shared by the web applications. Each subdirectory contains abuild.xml
file. The web application subdirectories in turn contain asrc
subdirectory for Java classes and configuration files, and aweb
subdirectory for web resources.Setting the Port
The JAX-WS and SAAJ services in the Coffee Break application run at the port that you specified when you installed the Application Server. The tutorial examples assume that the Application Server runs on the default port, 8080. If you have changed the port, you must update the port number in the following files before building and running the examples:
Building, Packaging, and Deploying the JAX-WS Service
To build the JAX-WS service and client library and to package and deploy the JAX-WS service using NetBeans 5.5, follow these steps:
- In NetBeans 5.5, choose Open Project from the File menu.
- In the Open Project dialog, navigate to
<
INSTALL
>/javaeetutorial5/examples/coffeebreak/
.- Select the
cb-jaxws
folder.- Select the Open as Main Project and Open Required Projects checkboxes.
- Click Open Project Folder.
- Right-click the
cb-jaxws
project and choose Build Project.- Right-click the
cb-jaxws
project and choose Deploy Project.To build the JAX-WS service and client library and to package and deploy the JAX-WS service using Ant, follow these steps:
Building, Packaging, and Deploying the SAAJ Service
To build the SAAJ service and client library and to package and deploy the SAAJ service using NetBeans 5.5, follow these steps:
- In NetBeans 5.5, choose Open Project from the File menu.
- In the Open Project dialog, navigate to
<
INSTALL
>/javaeetutorial5/examples/coffeebreak/
.- Select the
cb-saaj
folder.- Select the Open as Main Project and Open Required Projects checkboxes.
- Click Open Project Folder.
- Right-click the
cb-saaj
project and choose Build Project.- Right-click the
cb-saaj
project and choose Deploy Project.To build the SAAJ service and client library and to package and deploy the SAAJ service using Ant, follow these steps:
Building, Packaging, and Deploying the Coffee Break Server
To build, package, and deploy the Coffee Break server using NetBeans 5.5, follow these steps:
- In NetBeans 5.5, choose Open Project from the File menu.
- In the Open Project dialog, navigate to
<
INSTALL
>/javaeetutorial5/examples/coffeebreak/
.- Select the
cb
folder.- Select the Open as Main Project and Open Required Projects checkboxes.
- Click Open Project Folder.
- Right-click the
cb
project and choose Build Project.- Right-click the
cb
project and choose Deploy Project.To build, package, and deploy the Coffee Break server using Ant, follow these steps:
Running the Coffee Break Client
After you have installed all the web applications, check that all the applications are running in the Admin Console. You should see
cb
,cb-saaj
, andcb-jaxws
in the list of applications.You can run the Coffee Break client by opening this URL in a web browser:
A page appears with the following message:
In a few seconds, you should see a page like the one shown in Figure 37-1.
![]()
After you have gone through the application screens, you will get an order confirmation that looks like the one shown in Figure 37-2.
![]()
Figure 37-2 Order Confirmation
Removing the Coffee Break Application
To remove the Coffee Break application, perform the following steps:
If you want to remove the
build
anddist
directories, runant
clean
in each directory, including<
INSTALL
>/javaeetutorial5/examples/coffeebreak/cb-common/
.