Java Solaris Communities My SDN Account Join SDN

Previous Previous     Contents     Next Next
Chapter 4

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

ProcedureBuilding 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.

  1. 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.

  2. In a terminal, go to <INSTALL>/firstcup/example/firstcup-dukes-age.

  3. If you are building the version of the example you created in the previous chapter rather than the pre-bundled example code, copy the

  4. Enter the following command:

    ant

    You should see Build Successful when the command finishes.

ProcedureDeploying firstcup-dukes-age.war using ant

This task gives instructions on deploying firstcup-dukes-age.war using ant.

  1. 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.

  2. In a terminal go to <INSTALL>/firstcup/example/firstcup-dukes-age.

  3. Enter the following command:

    ant deploy

    You should see Build Successful when the command finishes.

ProcedureBuilding and Packaging DukesBirthdayBean and firstcup using ant

  1. In a terminal, go to <INSTALL>/firstcup/example/firstcup.

  2. 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.

ProcedureDeploying firstcup.ear using ant

This task gives instructions on deploying firstcup.ear using ant.

  1. In a terminal go to <INSTALL>/firstcup/example/firstcup.

  2. 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.

ProcedureRunning the firstcup Application

  1. Launch an internet browser.

  2. Enter the following URL in the address field of the browser:

    http://localhost:8080/firstcup

  3. Enter your birth date in the Your birthday text field. Make sure you use the date pattern specified on the page: MM/dd/yyyy.

  4. Click Submit.

  5. After the response.jsp page is launched, click Back to return to the greeting.jsp page.

Undeploying the Application

ProcedureUndeploying with Ant

  1. Go to the <INSTALL>/firstcup/example/firstcup directory.

  2. Run ant undeploy.

  3. Go to the <INSTALL>/firstcup/example/firstcup-dukes-age directory.

  4. Run ant undeploy.

ProcedureUndeploying with Asadmin

  1. Run asadmin undeploy firstcup-dukes-age.

  2. Run asadmin undeploy firstcup.

Previous Previous     Contents     Next Next
Company Info Contact Terms of Use Privacy Copyright 1994-2006 Sun Microsystems, Inc.