Copyright IBM Corporation 2005. All rights reserved IBM WebSphere Application Server Version 6: Proof of Technology Lab 04-Websphere Rapid Deployment What You should be able to do The objective of this lab is to provide an understanding of WebSphere Rapid Deployments(WRD) deployment automation features. Wrd gives administrators and developers a simpler and faster way to develop, deploy, construct, install, update, and uninstall a J2EE application. By configuring "watched"directory within the file system, installing an enterprise application is as easy as dropping the ear file into a folder This lab will entail configuring two styles of deployment automation. The first, called autoappinstall will automatically install, update, and uninstall an enterprise application on Web Sphere. You will add the file to the monitored directory, which will cause an install, then overwrite the file, which will cause an update, and finally remove the file which will cause an uninstall. In the final part of this lab you will construct another WRD deployment automation project. However, this new project will use the freeform style. Using this style you will place simple J2EE artifacts, like servlets, jsps, etc, inside the directory and WRD will automatically place those files in the correct J2EE project structure and install the application for you. You will then make updates by overwriting the individual J2EE artifacts instead of the having to overwrite the entire web module or enterprise application Lab requirements List of system and software required for the student to complete the lab Windows 2000 Professional Service Pack 4 is required for this lab exercise Web Sphere Application Server v6.0 has successfully installed The lab source files(LabFiles60. Zip)must be extracted to the root directory (i.e, C: Experience with previous versions of Web Sphere Application Server and the J2EE programming model are also required What you should be able to do At the end of this lab you should be able to Configure WebSphere Rapid Deployment for the autoappinstall deployment automation style Configure Web Sphere Rapid Deployment for the freeform deployment automation style Product Introduction+ Exploration(PI+E) Page 1 of 28
© Copyright IBM Corporation 2005. All rights reserved. Proof of Technology L04 – WebSphere Deployment Automation and WRU Product Introduction + Exploration (PI+E) Page 1 of 28 IBM WebSphere Application Server Version 6: Proof of Technology Lab 04 - WebSphere Rapid Deployment What You Should Be Able to Do The objective of this lab is to provide an understanding of WebSphere Rapid Deployment’s (WRD) deployment automation features. WRD gives administrators and developers a simpler and faster way to develop, deploy, construct, install, update, and uninstall a J2EE application. By configuring a “watched” directory within the file system, installing an enterprise application is as easy as dropping the EAR file into a folder. This lab will entail configuring two styles of deployment automation. The first, called autoappinstall, will automatically install, update, and uninstall an enterprise application on WebSphere. You will add the file to the monitored directory, which will cause an install, then overwrite the file, which will cause an update, and finally remove the file which will cause an uninstall. In the final part of this lab you will construct another WRD deployment automation project. However, this new project will use the freeform style. Using this style you will place simple J2EE artifacts, like servlets, jsps, etc, inside the directory and WRD will automatically place those files in the correct J2EE project structure and install the application for you. You will then make updates by overwriting the individual J2EE artifacts instead of the having to overwrite the entire web module or enterprise application. Lab Requirements List of system and software required for the student to complete the lab. • Windows 2000 Professional Service Pack 4 is required for this lab exercise. • WebSphere Application Server v6.0 has successfully installed. • The lab source files (LabFiles60.zip) must be extracted to the root directory (i.e., C:\). • Experience with previous versions of WebSphere Application Server and the J2EE programming model are also required. What you should be able to do At the end of this lab you should be able to: • Configure WebSphere Rapid Deployment for the autoappinstall deployment automation style. • Configure WebSphere Rapid Deployment for the freeform deployment automation style
g Copynight IBM Corporation 2005. All nights reserved Introduction The J2EE 1. 4 application you will be using is a simple banking application named Web Sphere Bank. It is composed of an EJB, Web, and Application Client module. In the EJB module there is a session bean and an two entity beans. Before being able to fully use the application, you will need to create the database and tables required to run the application and create the datasource resource in WebSphere Application Server so your application can persist data to the database. You will be using a Cloudscape database which is a small footprint, object-relational database based purely on Java. It can be set up very easily and you can quickly test your application to ensure it is working properly. The EJB to RDB mappings and the deploy code have already been generated for you In the first part of the lab you construct the resources necessary to run the WebSphere Bank which the Web Sphere Bank application will use to persist data to the database. In the secong application. This entails creating a database using Cloudscape and then creating a datasourc part of the lab you will create a WRD deployment automation project using the autoappinstall style. This will create a monitored directory on your file system. Once it's configured you will place the Web Sphere Bank EAR file in the directory and verify that the application was installed by using the administrative console and accessing the application itself. However, this version of WebSphere Bank will not have any functionality to perform a transfer of funds or a retrieve balances. The next step will be to take a new Web Sphere Bank Ear file with transfer and file from the directory and check through the administrative console that the application a the at retrieve funds function and overwrite the old Web Sphere Bank EAR file. Again, you will verify tha the application did get updated. The final step of the autoappinstall style will be to remove t indeed, get uninstalled. In the final section of this lab you will create another WRD deployment automation project using the freeform style. You will be using a simple web application that contains one servlet. This level of simplicity will show you the basics of how the freeform style works Exercise Instructions Establish the WebSphere Environment 1. Ensure that the Deployment Manager(dmgr)is started a Open a command prompt and navigate to c: IWeb Sphere\\\ bin c Command Prompt C:\WebSphere \AppServer\profiles\dmgr\bin>. Proof of Technology L04-Web Sphere Deployment Automation and WRU age 2 of
© Copyright IBM Corporation 2005. All rights reserved Proof of Technology L04 – WebSphere Deployment Automation and WRU Product Introduction + Exploration (PI+E) Page 2 of 28 Introduction The J2EE 1.4 application you will be using is a simple banking application named WebSphereBank. It is composed of an EJB, Web, and Application Client module. In the EJB module there is a session bean and an two entity beans. Before being able to fully use the application, you will need to create the database and tables required to run the application and create the datasource resource in WebSphere Application Server so your application can persist data to the database. You will be using a Cloudscape database which is a small footprint, object-relational database based purely on Java. It can be set up very easily and you can quickly test your application to ensure it is working properly. The EJB to RDB mappings and the deploy code have already been generated for you. In the first part of the lab you construct the resources necessary to run the WebSphereBank application. This entails creating a database using Cloudscape and then creating a datasource which the WebSphereBank application will use to persist data to the database. In the second part of the lab you will create a WRD deployment automation project using the autoappinstall style. This will create a monitored directory on your file system. Once it’s configured you will place the WebSphereBank EAR file in the directory and verify that the application was installed by using the administrative console and accessing the application itself. However, this version of WebSphereBank will not have any functionality to perform a transfer of funds or a retrieve balances. The next step will be to take a new WebSphereBank EAR file with transfer and retrieve funds function and overwrite the old WebSphereBank EAR file. Again, you will verify that the application did get updated. The final step of the autoappinstall style will be to remove the file from the directory and check through the administrative console that the application did indeed, get uninstalled. In the final section of this lab you will create another WRD deployment automation project using the freeform style. You will be using a simple web application that contains one servlet. This level of simplicity will show you the basics of how the freeform style works. Exercise Instructions Establish the WebSphere Environment ____ 1. Ensure that the Deployment Manager (dmgr) is started. __ a. Open a command prompt and navigate to c:\WebSphere\AppServer\profiles\dmgr\bin
b issue the command server Status -all 画 Command Prompt -回x C:\WebSphere\AppServerprofiles\dmgr\bin>serverstatus -all ADMU0116I:T informat is be it in file C: We sPhere、RppS dmgr\logs\serverStatus log ADMU0128I: Starting tool with Retrieving server status servers ADMUG5G ervers found in configuration: ADMU0506I: Se ame: dmgr ADMU0509I: The Deployment Manager "dmgr "cannot be reached. It appears stopped C: \WebSphere \AppServer\profiles\dmgr\bin) C If the processes is not running, issue the command startManager Command Prompt ADMU05891: the deployment Manager"dmgr" cannot be reached. It appears C: \We bSphere \AppServer\profiles \dmgr\bin >startmanager ool information is being logged in file eDs phere r\profiles\dmgr\logs\dmgr\startserver ADMU3100I: Reading configuration for server: dmgr DMU3200I: Server launched. Waiting for initialization status ADMU3000I: Server dmgr open for iness; process id is 2060 \We bSphe re \AppServer\profiles\dmgr\bin> 2. Ensure that the managed processes for profile 1(nodeagent and server1)are started a Navigate to the profile 1 \bin directory cd WWebSpherelAppServerlprofileslprofile1 \bin Command Prompt C:\WebSphere\AppServer\profilesprofile\bin>- b. Check the status of managed processes for profile 1 Proof of Technology L04-Web Sphere Deployment Automation and WRU Page 3 of 28
© Copyright IBM Corporation 2005. All rights reserved Proof of Technology L04 – WebSphere Deployment Automation and WRU Product Introduction + Exploration (PI+E) Page 3 of 28 __ b. Issue the command serverStatus –all. __ c. If the processes is not running, issue the command startManager. ____ 2. Ensure that the managed processes for profile1 (nodeagent and server1) are started. __ a. Navigate to the profile1\bin directory. cd \WebSphere\AppServer\profiles\profile1\bin __ b. Check the status of managed processes for profile1
g Copynight IBM Corporation 2005. All nights reserved C Issue the command server Status -all cA command Prompt C: \WebSphere erver\profiles\profiled\bin )serverstatus -all ADMUG1 WWe sPhere \A ADMU0128I: Starting tool wit lei profile\logs\serverStatul profile 0503I: Retriev atus for all servers 05I: Servers found in configuration Server name: nodeagent a erver name: server1 ADMU6509 Agent "nodeagent cannot be reached. It appears ADMU0509I: The Application Server "server1"cannot be reached. It apl stopped C: \WebSphere \AppServerprofiles \profile\bin)- d If the Node Agent is stopped, issue the command startNode ci\ Command Prompt 口 C: \We bS phere \AppServer\profiles\profile\bin >startnode ADMU0116I: Tool information is being logged in file C: \We bSphere \AppServer\profiles\profile\logs \nodeagent\s U0128I: Starting tool with the profile profile 1U3100I: Reading configuration for MU3200I: Server launched. Waiting for initialization status U3000I: Server nodeagent open for e-business; process id is 2080 C: \We bSphere \AppServer\profiles\profile\bin> e If server 1 is stopped, issue the command startServer server1 cA Command Prompt We sPhere \AppServer iles\profile\bin >startserver server1 ADMU01161: Tool information is being logged in C: \We bS phere \AppServer\profiles\profile\logs \server1\stal ADMU Starting tool with the profile profile ADMU Reading configuration f Server launched. Waiting for initialization status Server serverl open for e-business; process id is 2136 C:\WebSphere\AppServer\prof iles\profile\bin Setting up Resources(Database and Datasource) 1. Create the Cloudscape database to support the Web Sphere Bank application Proof of Technology L04-Web Sphere Deployment Automation and WRU Page 4 of 28
© Copyright IBM Corporation 2005. All rights reserved Proof of Technology L04 – WebSphere Deployment Automation and WRU Product Introduction + Exploration (PI+E) Page 4 of 28 __ c. Issue the command serverStatus –all. __ d. If the Node Agent is stopped, issue the command startNode. __ e. If server1 is stopped, issue the command startServer server1. Setting up Resources (Database and Datasource) ____ 1. Create the Cloudscape database to support the WebSphereBank application
g Copynight IBM Corporation 2005. All nights reserved a. Use the Windows command prompt and navigate to C: \LabFiles60IWRDLab COmmand Prompt c:\ LabFiles6、 WRDLab 2. At the prompt, type the following command to create the database: setupBankDB bat and press Enter. C: \LabFiles60\RDLab>setupBankDB bat a Following output will appear ompt Aaction gah\databases\BANKDB reat ing the BANKDB database systenf iness ooee e BANKDB database created LabFiles6、 Connon> b. the database has now been created 3. The application uses a datasource to persist the information to a Cloudscape database that was just created. This step will create the necessary datasource for the Web Sphere Bank application. a Run the command setupCmdLine. bat from the deployment manager profilelbin b In the command prompt, navigate to C: \LabFiles60IWRDLab Proof of Technology L04-Web Sphere Deployment Automation and WRU Page 5 of 28
© Copyright IBM Corporation 2005. All rights reserved Proof of Technology L04 – WebSphere Deployment Automation and WRU Product Introduction + Exploration (PI+E) Page 5 of 28 __ a. Use the Windows command prompt and navigate to C:\LabFiles60\WRDLab. ____ 2. At the prompt, type the following command to create the database: setupBankDB.bat and press Enter. __ a. Following output will appear: __ b. The database has now been created. ____ 3. The application uses a datasource to persist the information to a Cloudscape database that was just created. This step will create the necessary datasource for the WebSphereBank application. __ a. Run the command setupCmdLine.bat from the deployment manager profile\bin directory. __ b. In the command prompt, navigate to C:\LabFiles60\WRDLab
g Copynight IBM Corporation 2005. All nights reserved At the command prompt type in: setupBank bat and press Enter Note: this operation may take a minute or so to complete C. You will get a prompt to select the desired node: Enter node1 A Command Prompt- setupbank J挺 not wish for this to happen ntinue to process dngron node dmgrNode us ing SoAP connector; sx73031: The following unrecogn ized options are passed to the script ing envirol ment and are available as argu: [C: /LabFiles60/WRDlab/databases/ BANKDB tupBank: Configure WebSphere Bank resources Available nodes elect the desired node (press enter to take the default) [Default: dmgrNode]: d The setup Bank script will continue to run. If successful the following output should etupBank: Checking to see if connection Factory BANKDS-CF for database BANKDS e ank: Create connection Factory BANKDS_CF for database BANKDS xresource.cci Connection Factory Save the configuration Proof of Technology L04-Web Sphere Deployment Automation and WRU Page 6 of 28
© Copyright IBM Corporation 2005. All rights reserved Proof of Technology L04 – WebSphere Deployment Automation and WRU Product Introduction + Exploration (PI+E) Page 6 of 28 At the command prompt type in: setupBank.bat and press Enter. Note: this operation may take a minute or so to complete. __ c. You will get a prompt to select the desired node: Enter node1 __ d. The setupBank script will continue to run. If successful the following output should appear:
g Copynight IBM Corporation 2005. All nights reserved Part 1: WRD Deployment Automation"autoappinstall"style: WebSphere Bank In this part you will set up a WRD workspace that supports the Auto Application Install style. You will add an EAR file to the project, update it, and then remove it to see how the changes are reflected on the application server. The automatic application installation configuration creates a single monitored directory that listens for fully composed EAR files or application modules such as War files, EJB jar files, or stand-alone RAR files. If you place EAR files inside this monitored directory, the EAR is automatically deployed to the server. If you delete the EAR file from the monitored directory, then that application is uninstalled from the server. If you place WAR files or EJB jar files in the monitored directory, the rapid deployment tool generates the necessary EAR wrapper and then publishes that EAR file on the server. For RAR files, a wrapper is not created The stand-alone RaR files are published to the server 1. In the command prompt type md C: WRD to create a folder called WRD which will hold the WRD projects that will be defined 口区 : \We bSphere \AppServer\profiles\profile\bin )md C: \WRD \We bSphere \AppServer\profiles\profiled\bin) 2. Navigate to C: WebSphere\profileslprofile1 bin if not already there cd \WebSphere \AppServer\profiles \profile\bin 3. Configure the WRD Deployment Automation project using the"autoappinstall style a. At the command prompt type SET WORKSPACE=C: WRD and press enter. This will set the WRD workspace directory to the folder created in step 3 C: \e bSphere \AppServer\profiles \profile\bin >SET WORKSPACE=C: \RD C: \WebSphere\AppServerprofiles \profile\bin>. b. At the command prompt type wrd-config. bat -project " AutoInstall style " autoappinstall" and press Enter: Note:-project is the name of your WRD deployment automation project and-style is the style that applies to the project C. This command will execute for a minute as it starts to build the project. It will then ask for configuration parameters. You will need to enter the correct information for server Proof of Technology L04-Web Sphere Deployment Automation and WRU Page 7 of 28
© Copyright IBM Corporation 2005. All rights reserved Proof of Technology L04 – WebSphere Deployment Automation and WRU Product Introduction + Exploration (PI+E) Page 7 of 28 Part 1: WRD Deployment Automation “autoappinstall” style: WebSphereBank In this part you will set up a WRD workspace that supports the Auto Application Install style. You will add an EAR file to the project, update it, and then remove it to see how the changes are reflected on the application server. The automatic application installation configuration creates a single monitored directory that listens for fully composed EAR files or application modules such as WAR files, EJB jar files, or stand-alone RAR files. If you place EAR files inside this monitored directory, the EAR is automatically deployed to the server. If you delete the EAR file from the monitored directory, then that application is uninstalled from the server. If you place WAR files or EJB jar files in the monitored directory, the rapid deployment tool generates the necessary EAR wrapper and then publishes that EAR file on the server. For RAR files, a wrapper is not created. The stand-alone RAR files are published to the server. ____ 1. In the command prompt type md C:\WRD to create a folder called WRD which will hold the WRD projects that will be defined. ____ 2. Navigate to C:\WebSphere\AppServer\profiles\profile1\bin if not already there. cd \WebSphere\AppServer\profiles\profile1\bin ____ 3. Configure the WRD Deployment Automation project using the “autoappinstall” style. __ a. At the command prompt type SET WORKSPACE=C:\WRD and press enter. This will set the WRD workspace directory to the folder created in step 3. __ b. At the command prompt type wrd-config.bat –project “AutoInstall” – style “autoappinstall” and press Enter: Note: -project is the name of your WRD deployment automation project and –style is the style that applies to the project __ c. This command will execute for a minute as it starts to build the project. It will then ask for configuration parameters. You will need to enter the correct information for server
g Copynight IBM Corporation 2005. All nights reserved name and JMX port number when responding to prompts. You can take the default values for all other prompts Enter the server name*( server1): dmgrcell/node 1/server1 [Enter Enter the server JMX host name*(localhost ) [Enter Enter the server JMX port number*(8880): 8879 [Enter Enter your server username(-): [Enter Enter your server password(-): [Enter ci C: WINNT\system32\cmd. nstaii \profiles\profiler\bin wrd-config -project"autolnstall"a sPhere Rapid Deplo yment configuration. Please wait tarting Workbench Initializing the workspace Enter the server nane*( serverl ) dmgr Ce ll/node1/serverl 888E 8879 Enter your server username Enter your server password WebSphere Rapid Deplo yment configuration complete d. Once the configuration of the project is complete a confirmation message " WebSphere t configuration completed will 4. Start the WRD project a. At the command prompt type: WRD. bat-monitor and press Enter. The command may take a minute to process. After it,'s complete the following output will appear: 口 \e bS phere \AppServer\profiles\profile \bin )WRD bat -monitor Sphere Rapid Deple Please wait webSphere Rapid Deplo g', quit, or 'exit' to shut down We bSphere Rapid Deplo yment processes Proof of Technology L04-Web Sphere Deployment Automation and WRU Page 8 of 28
© Copyright IBM Corporation 2005. All rights reserved Proof of Technology L04 – WebSphere Deployment Automation and WRU Product Introduction + Exploration (PI+E) Page 8 of 28 name and JMX port number when responding to prompts. You can take the default values for all other prompts: __ Enter the server name* ( server1 ) : dmgrCell/node1/server1 [Enter] __ Enter the server JMX host name* (localhost ) : [Enter] __ Enter the server JMX port number* ( 8880 ) : 8879 [Enter] __ Enter your server username ( -- ) : [Enter] __ Enter your server password ( -- ) : [Enter] __ d. Once the configuration of the project is complete a confirmation message “WebSphere Rapid Deployment configuration completed” will appear. ____ 4. Start the WRD project. __ a. At the command prompt type: WRD.bat –monitor and press Enter. The command may take a minute to process. After it’s complete the following output will appear:
g Copynight IBM Corporation 2005. All nights reserved Note: Specifying the -monitor parameter will allow the console output to be directed at the command prompt window to detect error, success, and overall status messaging. A log file can also be used 5. Install an application using the WRD Auto App Install project just created a Open Windows Explorer and navigate to C: \LabFiles60IWRDLablWebSphere BankNoTransferEAR 6WebSphereBankNoTransferEAR 回区 Eile Edit View Favorites Tools Help d Desktop owebSphereBank 白 My Documents g My Comput 日 Local Disk(c) 由□DB2 中□ DB2CTLSV □DE2oG □ Documents and Settings 白□ Labiales60 □ Common 白□ WRDLab WebSphereBankNoTransferEAR Program Files 1 object(s)(Disk free space: 1.49 GB) 回 My Computer Proof of Technology L04-Web Sphere Deployment Automation and WRU 9of28
© Copyright IBM Corporation 2005. All rights reserved Proof of Technology L04 – WebSphere Deployment Automation and WRU Product Introduction + Exploration (PI+E) Page 9 of 28 Note: Specifying the –monitor parameter will allow the console output to be directed at the command prompt window to detect error, success, and overall status messaging. A log file can also be used. ____ 5. Install an application using the WRD Auto App Install project just created. __ a. Open Windows Explorer and navigate to C:\LabFiles60\WRDLab\WebSphereBankNoTransferEAR
b. Right-click on the file Web Bank. ear and choose Copy. Name sawebSph Open 211KB Open With 55 WinZip Send T Create shortcut C. Staying in Windows Explorer, navigate to C: WRDLAutolnstall directory File Edit yiew Favorites Tools Help Folders Address口 C: lWRD Autolnst Folders O webSphereBankNoTransferEAR 由 Websphere 白 PAGEFILE(D;) Compact Disc(E: Es instal on'sfmL d Paste the WebSphere Bank. ear file copied in step b above to the C WRD\Autolnstall Proof of Technology L04-Web Sphere Deployment Automation and WRU Page 10 of 28
© Copyright IBM Corporation 2005. All rights reserved Proof of Technology L04 – WebSphere Deployment Automation and WRU Product Introduction + Exploration (PI+E) Page 10 of 28 __ b. Right-click on the file WebSphereBank.ear and choose Copy. __ c. Staying in Windows Explorer, navigate to C:\WRD\AutoInstall directory. __ d. Paste the WebSphereBank.ear file copied in step b above to the C:\WRD\AutoInstall directory