Professional Documents
Culture Documents
1
Instructor Exercises Guide
EXempty
Introduction
The integrated development environment of IBM Rational Application Developer has many advantages, not the least of which is the behind-the-scenes aspect of testing. This means that Run on Server will automatically deploy and install code, open a browser, and run a Web application. However, a completed application will need to be packaged, exported from this environment, and installed on a remote server. This exercise simulates this process. Although the server is the same local server that has been used for testing, it is in fact a stand-alone WebSphere Application Server that can be used outside of the Rational Application Server environment. In this exercise, you will export the Web application (packaged in an EAR file), then use the WebSphere Application Server Administrative console to install and configure it. Finally, you will test it using an external browser.
13-1
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Required Materials
This exercise requires the database to be set up in a specific way using files that can be found in the <LAB_FILES>\Deploy\imports directory. Make sure you have these files before starting the lab.
All the required steps are simple, and students will have done many of them several times during the week. It is therefore very important to set the scene and explain exactly why they are doing this exercise.
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
V4.1
Instructor Exercises Guide
EXempty
Exercise Instructions
Preface
The following references in the exercise instructions represent directory locations in your workstation: <LAB_FILES>: C:\LabFiles70 <SDP_DIR>: C:\IBM\SDP70
13-3
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
V4.1
Instructor Exercises Guide
EXempty
13-5
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
__ f.
Click Finish.
__ 4. Recreate the database. __ a. In the Project Explorer, expand LibraryDatabaseSetup driver. Java
__ b. Right-click SetUpLibraryDatabase.java and select Run As Application. __ c. The following messages should be shown in the Console view. Drop existing tables SQL Executed with no SQL Executed with no SQL Executed with no SQL Executed with no SQL Executed with no SQL Executed with no (if they exist) errors: errors: errors: errors: errors: errors:
Create the library tables SQL Executed with no errors: SQL Executed with no errors: SQL Executed with no errors: SQL Executed with no errors: SQL Executed with no errors: SQL Executed with no errors: Load the item table A total of 6 records were processed There were 6 rows added without errors There were 0 warnings and 0 errors Load the patron table A total of 6 records were processed There were 6 rows added without errors There were 0 warnings and 0 errors Load the copy table A total of 13 records were processed There were 13 rows added without errors There were 0 warnings and 0 errors Load the onloan table A total of 6 records were processed There were 6 rows added without errors There were 0 warnings and 0 errors
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
V4.1
Instructor Exercises Guide
EXempty
Load the tablemax table A total of 3 records were processed There were 3 rows added without errors There were 0 warnings and 0 errors
13-7
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
__ b. In the Project Explorer view, right-click LibraryEAR, and select Export file.
EAR
__ c. In the EAR Export dialog, select LibraryEAR as the EAR application, and browse to <LAB_FILES>\Deploy\exports\library.ear for the Destination.
__ d. Click Finish. __ e. You should now be able to locate the library.ear file in the <LAB_FILES>\Deploy\exports directory.
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
V4.1
Instructor Exercises Guide
EXempty
13-9
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
__ b. In the Preparing for the application installation page, select Local file system and click Browse. Navigate to the <LAB_FILES>\deploy\exports directory where the library.ear was saved in the previous step. Select library.ear and click Open. The Local file system field should now contain the path of the EAR file.
__ c. Click Next. __ d. The next page will show Step 1: Select installation options. On the left side menu, notice that there are three steps to complete. You can complete each step
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
V4.1
Instructor Exercises Guide
EXempty
in turn and press Next to navigate to the next step, or you can jump directly to a step by clicking on its link.
__ e. In Step 1, select the check box to enable Pre-compile JSP. This operation takes a little while to complete, but is an excellent option to select when testing. This way you can ensure that all JSPs will compile. In production, this is a way to
13-11
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
reduce the response time for the first request of a JSP page. Change the Application name to LibraryApplication. Click Next.
__ f.
Step 2 will now be displayed. Notice that Step 1 is still listed as a hyperlink, allowing you to return to any previous step. Step 2 allows you to map modules
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
V4.1
Instructor Exercises Guide
EXempty
that are contained in your application. You have only one module, LibraryWeb, which has already been configured to deploy to server1. Click Next.
__ g. Step 3 displays a summary of the configurations set in the previous steps. Verify the information, then click Finish.
__ h. You should see a page headed Installing, and messages will scroll down to indicate the progress of the installation. The application server will step through
13-13
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
the module to performing installation tasks. Look for the following message to confirm that the enterprise application was successfully installed.
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
V4.1
Instructor Exercises Guide
EXempty
__ b. Select the check-box next to LibraryApplication and Click Start. This will attempt to start the LibraryApplication enterprise application. __ c. Once completed, look for a message at the top of the screen indicating that LibraryApplication started successfully.
__ d. Scroll down to the list of enterprise applications table, and you should also see that LibraryApplication has a status of Started. Note If an error is reported, use the command prompt to change to the <SDP_DIR>\runtimes\base_v61\profiles\AppSrv01\logs\server1 directory and display the contents of SystemOut.log. Scroll down to the bottom of the file to see the latest messages. This should provide more information about the error. Verify that you followed all of the above steps correctly, and try restarting the server if you still experience problems.
13-15
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
__ b. In the Web browser, enter the address http://localhost:9080/Library/List. A list of all the patrons and their on loan items should be displayed.
__ 12. Test the JSP pages. __ a. In the Web browser, specify the address http://localhost:9080/Library/search.jsp.
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
V4.1
Instructor Exercises Guide
EXempty
__ 13. Test the Struts pages. __ a. Type http://localhost:9080/Library/login.jsp in the browser address to go to a login page. __ b. Type 2 in User ID and vogel in Password, then click Login.
13-17
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
__ 14. Test the JSF pages. __ a. Type http://localhost:9080/Library/faces/register.jsp in the browser address to load the Register A New Patron page. __ b. Enter the following information, then click Register. First Name: Jimmy Last Name: World Email: jv@ibm.com Password: donuts
__ c. The registration successful page should now show, with a random ID generated for the patron.
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
V4.1
Instructor Exercises Guide
EXempty
END OF LAB
13-19
Course materials may not be reproduced in whole or in part without the prior written permission of IBM.