Deploying XBikes on WebSphere Application Developer Studio 5.0


Using WebSphere Application Developer Studio 5.0 to run the XBikes sample code requires you to install and configure the following software on a single computer:

  • Windows 2000 Server with Service Pack 3 or later in Workgroup mode

  • Microsoft SQL Server 2000 with mixed mode security and Service Pack 3

  • Microsoft JDBC Driver for Microsoft SQL Server 2000

  • A default installation of IBM WebSphere Application Developer Studio 5.0

  • A custom installation of IBM WebSphere MQ 5.3 (described in the following section)

  • A default installation of GLUE 4.1.2 Professional

Note

You must install a valid GLUE license file into Glue.jar. See the GLUE documentation for help.

Configuring IBM WebSphere MQ 5.3

When setting up IBM WebSphere MQ, ensure you select a custom install and add support for Java Messaging. To do this, complete the following steps.

To install IBM WebSphere MQ

  1. Open Windows Explorer, and then double-click WebSphereMQ_t_en_us.exe. The WebSphere MQ (Evaluation Copy) dialog box appears. Click Next.

  2. The Location to Save Files page prompts you for a folder into which you want to extract the installation files. Note that this is not the directory into which you install IBM WebSphere MQ. The default folder is C:\Program Files\IBM\Source\WebSphere MQ t_en_us. Either accept the default value, enter a new directory, or click the Change button and browse for a directory.

  3. Click Next to continue. The installation process extracts the WebSphere MQ installation files into the directory you specified.

  4. In the dialog box that appears after the installation files are extracted, click Yes.

  5. The WebSphere MQ Installation Launchpad appears. Click Software Prerequisites.

  6. The Launchpad checks your system for prerequisite software. Check that the check boxes next to each required component are selected. However, note that the installation routine can fail to detect the presence of a supported Java Runtime Environment 1.3 or later.

  7. Click Network Prerequisites and check that your computer meets the requirements. If the computer is in Workgroup mode, you can click No.

  8. Click WebSphere MQ Installation and check the pre-installation status. If you are certain you have already installed a Java Runtime Environment 1.3 or later, you can ignore any warnings about that component.

  9. Click the Launch WebSphere MQ Installer button. The WebSphere MQ Installation Wizard appears. Click Next.

  10. On the License Agreement page, click the option to accept the terms in the license agreement, and then click Next.

  11. On the Setup Type page, click Custom, and then click Next.

  12. Accept the default installation folder of C:\Program Files\IBM\WebSphere MQ for the program files, and then click Next.

  13. Accept the default installation folder of C:\Program Files\IBM\WebSphere MQ\ for the data files, and then click Next.

  14. Accept the default installation folder of C:\Program Files\IBM\WebSphere MQ\log\ for the log files, and then click Next.

  15. On the Features page, click the red cross next to Java Messaging, click Install this feature, and then click Next.

  16. The Ready to Install WebSphere MQ page appears. Check that the settings are correct, and then click Install.

  17. A dialog box asks if you have purchased sufficient license units to install IBM WebSphere on this computer. If you are using the evaluation version of WebSphere MQ, click Yes.

  18. After the installation process completes, click Finish.

  19. When the Prepare WebSphere MQ Wizard appears, click Next.

  20. On the WebSphere MQ Network Configuration page, click No. This assumes that your computer is a member of a Workgroup. Click Next. The WebSphere MQ Service starts.

  21. Click the Setup the Default Configuration link.

  22. When the Default Configuration Wizard appears, click Next.

  23. The next page gives you basic information on what you are doing. Click Next.

  24. On the Select Options page, leave the options for Allow remote administration of the queue manager and Join the queue manager to the default cluster selected. Click Next.

  25. On the Join Default Cluster page, select the option for Yes, make it the repository for the cluster. Click Next.

    Note

    If you are using a computer that gets its IP address dynamically, a message may appear that asks if another computer with a fixed IP address is available to hold the repository. If this message appears, click No.

  26. The Repository Location page confirms that the current computer holds the repository for the cluster. Click Next.

  27. On the Default Configuration Summary page, check that the settings are correct, and then click Finish.

  28. WebSphere MQ then sets up the default configuration. The WebSphere MQ Default Configuration dialog box appears, showing the Queue Manager and Default Cluster Membership details. Click Close.

  29. On the Prepare WebSphere MQ Wizard page, click Next.

  30. On the Completing the Prepare WebSphere MQ Wizard page, clear all check boxes, and then click Finish.

This completes the installation and configuration of IBM WebSphere MQ.

Creating the XBikesQ Queue

To create the message queue that XBikes uses, complete the following steps.

To create the XBikes message queue

  1. Start WebSphere MQ Explorer by clicking Start, pointing to All Programs, pointing to IBM WebSphere MQ, and then clicking WebSphere MQ Explorer.

  2. Expand WebSphere MQ, expand Queue Managers, and then expand QM_<machine name> (where <machine name> is the name of your computer).

  3. Right-click Queues, point to New, and then click Local Queue.

  4. In the Queue Name box, type XBikesQ, and then click OK.

  5. In the WebSphere MQ dialog box, click Don’t Share in Cluster. The WebSphere MQ dialog box closes.

  6. Close WebSphere MQ Explorer.

Installing the XBikes Sample Code

To install the XBikes sample code for the J2EE platform, complete the following steps.

Note

Check again that your system meets the prerequisites listed at the beginning of this section. For example, failure to install a component such as Microsoft SQL Server results in the database tables not installing.

To install the XBikes application and the XBikes database

  1. Open Windows Explorer, and then double-click Xbikesj2ee.msi. In the Welcome to the XBikes J2EE Setup Wizard page, click Next.

  2. On the Installation Options page, make sure Single Tier is selected, and then click Next.

  3. On the second Installation Options page, make sure the Install Source Code and Install Database check boxes are selected and the Install to WebSphere Application Server 5.0 (uncheck for single tier WSAD only) check box is not selected, and then click Next.

  4. On the Confirm Installation page, click Next to begin the installation. The installation copies the XBikes sample code and installs the XBikes database.

  5. When the installation is complete, click Close.

Configuring the JMS Queues

To configure the JMS entries for the XBikes queues, complete the following steps.

To configure the XBikes JMS queues for WebSphere Application Developer Studio 5.0

  1. Start WebSphere Application Developer Studio 5.0 by clicking Start, pointing to All Programs, pointing to IBM WebSphere Studio, and then clicking Application Developer 5.0.

  2. In the WebSphere Studio dialog box, change the workspace to C:\Xbikes\J2ee-ibm, and then click OK.

  3. The J2EE – IBM WebSphere Studio Application Developer window appears. In the left pane under J2EE Navigator, right-click XBikesWeb, and then click Run on Server.

  4. In the Server Selection dialog box, click Use an existing server, and then click Next.

  5. In the Select Tasks dialog box, ensure that both check boxes are not selected, and then click Finish.

  6. Ensure that the WebSphere server is started with WebSphere Studio.

  7. Open Internet Explorer and navigate to http://localhost:9090/admin/. This opens the Web server administration tool.

  8. In the User ID box, type Admin, and then click OK.

  9. Expand Resources, and then click WebSphere MQ JMS Provider.

  10. In the right pane, select Server for the scope, and then click Apply.

  11. Under Additional Properties, click WebSphere MQ Queue Connection Factories, and then click XBikesQCF.

  12. In the Queue Manager field under General Properties, change the value to the exact name of the Queue Manager on your computer, and then click OK under General Properties.

    Note

    If you do not know the name of the Queue Manager, open the WebSphere MQ Explorer by clicking Start, pointing to Programs, pointing to IBM WebSphere MQ, and then clicking WebSphere MQ Explorer. Expand WebSphere MQ, and then expand Queue Managers. The name of the Queue Manager displays.

  13. In the left pane, click WebSphere MQ JMS Provider.

  14. Under Additional Properties in the right pane, click WebSphere MQ Queue Destinations, and then click XBikesQ.

  15. Under General Properties, locate the Base Queue Manager Name field. As in step 9, enter the name of your Queue Manager in the form of “QM_<machine name>“ (without the quotation marks). Note that this value is case-sensitive. At the bottom of the General Properties section, click OK.

  16. Under Messages in the right pane, click Save, and then click Save under Save to Master Configuration.

  17. Click Logout, and then close Internet Explorer.

  18. Restart your WebSphere server for the changes to take effect.

Running XBikes

To execute XBikes within WebSphere Application Developer Studio, complete the following steps.

To execute the XBikes application within WebSphere Application Developer Studio

  1. Start WebSphere Application Developer Studio 5.0 by clicking Start, pointing to All Programs, pointing to IBM WebSphere Studio, and then clicking Application Developer 5.0.

  2. In the WebSphere Studio dialog box, change the workspace to C:\Xbikes\J2ee-ibm, and then click OK.

  3. The J2EE – IBM WebSphere Studio Application Developer window appears. In the left pane under J2EE Navigator, right-click XBikesWeb, and then click Run on Server.

  4. In the Server Selection dialog box, click Use an existing server, and then click Next.

  5. In the Select Tasks dialog box, ensure that both check boxes are not selected, and then click Finish.

  6. After the server starts, the XBikes application appears in the WebSphere Studio Internal Web browser window.

The XBikes Web application allows you to browse bikes by type, order bikes, change quantities, and check out your order.

Using WebSphere Studio Application Developer 5.1 with XBikes

If you want to use WebSphere Studio Application Developer 5.1 instead of version 5.0, you have to make some changes to the project. Use the following steps as a guide to resolve the configuration problems encountered when using version 5.1. You also have to install fix pack CSD05 for WebSphere MQ. For more information about the fix pack, including download information, see “WebSphere MQ Support, Service Summary for Windows NT and Windows 2000” on the IBM Web site (http://www-3.ibm.com/software/integration/mqfamily/support/summary/wnt.html).

To configure the XBikes application for WebSphere Studio 5.1

  1. Start WebSphere Application Developer Studio 5.1 by clicking Start, pointing to All Programs, pointing to IBM WebSphere Studio, and then clicking Application Developer 5.1.

  2. In the WebSphere Studio dialog box, change the workspace to C:\Xbikes\J2ee-ibm, and then click OK.

  3. In the Different Workspace Version dialog box, click OK.

  4. When the project is fully loaded in Studio, click Rebuild All on the Project menu. A number of build errors will display in the Task window.

To correct the build errors

  1. Right-click XBikesResourceInteropFactory, and then click Properties. The XBikesResourceInteropFactory Properties dialog box appears.

  2. In the left pane of the Properties dialog box, click Java Build Path, and then click the Libraries tab.

  3. Remove J2EE.jar from the JAR’s and class folders on the build path list by highlighting J2EE.jar and clicking Remove.

  4. Click Add External JARs. The JAR Selection dialog appears.

  5. Navigate to the C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1\runtimes\base_v5\lib\ folder, click J2EE.jar, and then click Open.

  6. Click OK to close the Properties dialog box.

  7. Right-click XBikesUseCase, and then click Properties. The XBikesUseCase Properties dialog box appears.

  8. In the left pane of the Properties dialog box, click Java Build Path, and then click the Libraries tab.

  9. Remove J2EE.jar from the JAR’s and class folders on the build path list by highlighting J2EE.jar, and then clicking Remove.

  10. Click Add External JARs. The Jar Selection dialog appears.

  11. Navigate to the C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1\runtimes\base_v5\lib\ folder, click J2EE.jar, and then click Open.

  12. Click OK to close the Properties dialog box.

  13. In the upper left pane, click J2EE Hierarchy.

  14. Expand the servers node and check that ServerOne is listed. If ServerOne is not listed under the Servers node, do the following:

    1. Right-click Servers, and then click Create a New Server and Server Configuration. The Create a New Server and Server Configuration dialog box appears.

    2. In the Server Name field, enter TestServer, and then click Finish.

    3. In the J2EE Hierarchy view, expand Servers, and then right-click TestServer.

    4. Click Switch Configuration, and then click WebSphere v5.0 Server Configuration.

  15. In the J2EE Hierarchy view, expand EJB Modules, and then expand Maps.

  16. Right-click XBikes:MSSQLServer_V7_1, and then click Delete Map Resource. The Delete Map Options dialog box appears.

  17. Make sure the Map and Schema check boxes are selected, and then click OK. The Delete Map Options dialog box closes.

  18. Right-click XBikesDal, click Generate, and then click EJB to RDB mapping. The EJB to RDB Mapping dialog box appears.

  19. Make sure the Create a new backend folder check box is selected, and then click Next.

  20. Select the Meet in the middle radio button, and then click Next.

  21. Select the Use Existing Connection checkbox, verify that XBikes is selected in the Existing Connection drop-down box, and then click Next.

  22. From the Import Table list, select the dbo.Categories, dbo.Customers, dbo.OrderDetails, and dbo.Orders dbo.Products tables; then click Next.

  23. Select Match By Name, and then click Finish. The Mapping file opens in the main window.

  24. In the Enterprise Beans pane, click CategoriesDataAdapter.

  25. In the Tables pane, right-click the Categories table, and then click Match By Name.

  26. Repeat steps 24 and 25 for the CustomerDataAdapter, ProductsDataAdapter, OrderDataAdapter, and OrderDetailsDataAdapter tables.

  27. Save and close the Mapping file. At this point, all build errors should be removed from the project.

  28. Right-click XBikesDAL, click Generate, and then click Deployment and RMIC code. The Generate Deployment and RMIC Code dialog box appears.

  29. Click Select All, and then click Finish.

  30. Expand the Servers node in the J2EE Hierarchy view, right-click TestServer, and then click Start.

  31. Reconfigure the Queue Manager settings using the Web admin tool. For instructions, see Configuring the JMS Queues earlier in this appendix.

  32. Restart the WebSphere server and test.




Application Interoperability. Microsoft. NET and J2EE
Application Interoperability: Microsoft .NET and J2EE: Microsoft(r) .Net and J2ee (Patterns & Practices)
ISBN: 073561847X
EAN: 2147483647
Year: 2003
Pages: 104

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