Building, Packaging, and Deploying and Running the Example Application
This chapter details how to build, deploy, and run the pre-coded example application included in the firstcup download bundle using the Ant build tool. If you want to build, deploy, and run the example that you built in the previous chapter, please use NetBeans rather than the Ant build tool by following the instructions in the previous chapter.
Building and Packaging the Example Application
This section describes how to build the example application.
Building and Packaging the Example Application using ant
Building and Packaging firstcup-dukes-age using ant
After you complete this task will build firstcup-dukes-age and create a WAR file, firstcup-dukes-age.war in the dist directory.
Verify that you have added the Ant build tool that comes with the Application Server to your path. The location is the lib/ant/bin directory of your Application Server installation.
In a terminal, go to <INSTALL>/firstcup/example/firstcup-dukes-age.
If you are building the version of the example you created in the previous chapter rather than the pre-bundled example code, copy the
Enter the following command:
ant
You should see Build Successful when the command finishes.
Deploying firstcup-dukes-age.war using ant
This task gives instructions on deploying firstcup-dukes-age.war using ant.
Start the Application Server if you haven't already. Refer to your Application Server documentation if you are not sure how to start the server.
In a terminal go to <INSTALL>/firstcup/example/firstcup-dukes-age.
Enter the following command:
ant deploy
You should see Build Successful when the command finishes.
Building and Packaging DukesBirthdayBean and firstcup using ant
In a terminal, go to <INSTALL>/firstcup/example/firstcup.
Enter the following command:
ant
You should see Build Successful when the command finishes.
Deploying the Example Application
This section describes how to deploy the example application.
Deploying the Enterprise Bean and Web Client
The DukesBirthdayBean enterprise bean and firstcup web client were packaged in firstcup.ear. Now you'll deploy them to the Application Server.
Deploying firstcup.ear using ant
This task gives instructions on deploying firstcup.ear using ant.
In a terminal go to <INSTALL>/firstcup/example/firstcup.
Enter the following command:
ant deploy
You should see Build Successful when the command finishes.
Running the Web Client
This section describes how to run the firstcup application.
To run the application, do the following.
Running the firstcup Application
Launch an internet browser.
Enter the following URL in the address field of the browser:
http://localhost:8080/firstcup
Enter your birth date in the Your birthday text field. Make sure you use the date pattern specified on the page: MM/dd/yyyy.
Click Submit.
After the response.jsp page is launched, click Back to return to the greeting.jsp page.
Undeploying the Application
Undeploying with Ant
Go to the <INSTALL>/firstcup/example/firstcup directory.
Run ant undeploy.
Go to the <INSTALL>/firstcup/example/firstcup-dukes-age directory.
Run ant undeploy.
Undeploying with Asadmin
Run asadmin undeploy firstcup-dukes-age.
Run asadmin undeploy firstcup.

Previous