Building the Rental Enterprise Application


To build the rental enterprise application, go to the bookants directory under your bookcode-home directory. Build the clean-out target first by executing the following command:

 ant clean-out 

Assuming that you have built some of the examples from Chapters 8 and 9, you will see output that looks like the output in Listing 10-1 in Chapter 10.

By building the clean-out target first, you remove any compiled versions of the rental application classes that were built with either the rental-gui target or the rental-servlet-opr target. The rental Swing application and the rental Web application can use the versions of the application data classes built by the rental enterprise application, but the reverse is not true. The rental enterprise application cannot use the version of the application data classes built by either the rental Swing application or the rental Web application. See the section "Changes to the Application Data Classes" later in this chapter for more information.

Next, build the rental enterprise application's target. Execute the following command:

 ant rental-servlet-ejb 

You should see output that looks like the output shown in Listing 11-1. Building this target will shut down Tomcat if it is running. It does not shut down JBoss.

Listing 11-1: Excerpts of Expected Output from Building the rental-servlet-ejb Target

start example
 E:\Bookcode\bookants>ant rental-servlet-ejb Buildfile: build.xml are-we-ready: verify:      ... die-without-JBoss:      ... rental-ejb:       [jar] Building jar: E:\Bookcode\serverjars\reservationservice.jar       [jar] Building jar: E:\Bookcode\clientjars\reservationclient.jar      [echo] returned from com/ysoft/jdo/book/rental/ejb/build.xml      [copy] Copying 1 file to E:\jboss304\server\default\deploy      [echo] returned from ants/jboss.xml      [echo] deploying kodo.rar      [copy] Copying 1 file to E:\jboss304\server\default\deploy      [copy] Copying 1 file to E:\jboss304\server\default\deploy      [echo] calling com/ysoft/jdo/book/rental/ejb/build.xml      ... die-without-Tomcat: rental:      ...     [mkdir] Created dir: E:\Bookcode\warfiles\images      [copy] Copying 3 files to E:\Bookcode\warfiles\images      [copy] Copying 7 files to E:\Bookcode\warfiles\web-inf\lib    [delete] Deleting 8 files from E:\Bookcode\temp    [delete] Deleting 42 files from E:\tomcat4.1.12\webapps\rental    [delete] Deleted 14 directories from E:\tomcat4.1.12\webapps\rental      [copy] Copying 39 files to E:\tomcat4.1.12\webapps\rental      [echo] You'll have to restart Tomcat BUILD SUCCESSFUL Total time: 1 minute 7 seconds 
end example

To run the rental enterprise example, start up JBoss, start up Tomcat, and start up a Web browser. After these programs have completed their startup, visit the following URL:

http://localhost:8000/rental/controller

This will bring up a Web page that looks something like the page in Figure 10-1 in Chapter 10.

A Few Additional Tips

Although it should not happen, in fact, some JDO implementations have broken the JBoss hot-redeploy feature. As a result, you may need to stop and restart JBoss after building any of the EJB targets. Certainly, if you did not restart JBoss and something is broken, it is worth a try to see if the bounce fixes it.

If you change implementations after building some of the EJB targets, you will need to remove the old implementation's xxx.rar and xxx-service.xml files from the server/default/deploy directory under your jboss-home directory. You will also want to remove from the same directory the EJB jars that you deployed with the old implementation.

Using the Rental Enterprise Application

The user interface of the rental enterprise application is identical to the user interface of the rental Web application. As a result, to walk through the rental enterprise application, follow the instructions in Chapter 10. Remember that Tomcat is no longer configured to use its default HTTP port of 8080.




Using and Understanding Java Data Objects
Using and Understanding Java Data Objects
ISBN: 1590590430
EAN: 2147483647
Year: 2005
Pages: 156
Authors: David Ezzio

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net