Welcome!

Websphere Authors: Reuven Cohen, Dana Gardner, John Ryan, Yeshim Deniz, Dustin Amrhein

Related Topics: Websphere

Websphere: Article

Migrating WebSphere

Migrating WebSphere

Since the release of IBM VisualAge for Java Enterprise Edition v3.53, the Enterprise Access Builder (EAB) tools have been able to generate code that conforms to the J2EE Connector Architecture (JCA) specification, which allows Java programs to access Enterprise Information Systems (EIS), such as SAP, CICS, IMS, and other back-end systems, using a standard interface.

IBM WebSphere Studio Application Developer Integration Edition (hereafter called Integration Edition) provides the next-generation tooling for enterprise connectivity. It features a WebSphere Test Environment that targets the powerful WebSphere Application Server Enterprise Edition.

A fix pack is now available that enables you to run JCA applications developed in Integration Edition on the WebSphere Application Server Advanced Edition (hereafter called Advanced Edition). This article describes best practices for migrating your Integration Edition JCA applications to Advanced Edition.

Flow-Based JCA Applications
Business Process Flow technology is an important piece of the middleware stack that has recently been offered as part of the WebSphere platform. IBM has been offering flow technology in a number of products (most notably WebSphere MQ Workflow for people-based workflows, WebSphere MQ Integrator for message flows, WebSphere MQ Adapter Offering for MQ-based adapters, and Enterprise Access Builder for Java-based adapters), but no tight integration of flow technology has been available in the WebSphere platform until now. The pure-Java flow engine, written as a WebSphere enterprise service, allows you to tightly integrate flow technology with all the other services offered by J2EE.

Integration Edition provides visual flow-based tools in order to visually define the sequence and flow of information between application artifacts such as application adapters, JavaBean and enterprise bean components, Web services, or other flows. In Integration Edition v4.11, only noninterruptible, short-running, and synchronous flows are supported. This type of flow is referred to as a microflow or a service flow. Interruptible, long-running, and asynchronous flows are being planned for future releases of Integration Edition.

Flows can only be run in the WebSphere Application Server Enterprise Edition. Therefore, it is important to note that this article is only relevant to non-flow-based JCA applications.

Overview
Create, Deploy, and Test the Application in Integration Edition

Integration Edition v4.11 contains a local copy of the complete runtime environment of the WebSphere Application Server Advanced Single Server Edition (hereafter called Advanced Single Server Edition) v4.02 with enhancements to support JCA and some features of the WebSphere Enterprise Extensions. This environment is called the WebSphere Test Environment. The JCA tooling combined with the Test Environment provides you with a complete environment to develop and test your JCA applications. The high-level steps to creating, deploying, and testing the JCA application in Integration Edition are depicted in Figure 1.

Deploy and Test the Application in Advanced Single Server Edition
The release of Fix Pack 4 makes it possible to take JCA applications developed in Integration Edition and deploy and execute them in Advanced Edition. You simply export the JCA application from Integration Edition as an Enterprise Archive EAR file and then use the Administrative Console to deploy it into Advanced Edition. However, before moving your JCA application directly to an Advanced Edition application server, it is recommended that you test the JCA application in the steps outlined in this article in order to make the porting process as smooth as possible.

In addition to testing JCA applications in the Test Environment's local copy of the WebSphere Application Server, Integration Edition provides the capability to test your JCA applications on a remote copy of the WebSphere Application Server product. Consequently, by configuring an Advanced Single Server Edition with Fix Pack 4, you can use Integration Edition to remotely deploy and run your JCA application. WebSphere Application Server Advanced Single Server Edition is required since the Test Environment does not support it. The high-level steps to deploying and testing the JCA application in Advanced Single Server Edition are depicted in Figure 2.

Deploy and Run the Application in Advanced Edition
Once you have verified that the JCA application executes successfully in Advanced Single Server Edition, it is ready to be deployed in Advanced Edition. The high-level steps to deploying and running the JCA application in Advanced Edition are depicted in Figure 3.

The rest of this article takes you through a real example, the Phone Book IMS application included in Integration Edition.

Getting Started
The following software is required. Follow the installation instructions included with the software.

  • WebSphere Studio Application Developer Integration Edition v4.11
  • WebSphere Application Server Advanced Edition (AE) v4.01, v4.02, or v4.03
  • WebSphere Application Server Advanced Single Server Edition (AEs) v4.01, v4.02, or v4.03
  • WebSphere Application Server v4 Fix Pack 4 (v4.04) for AE
  • WebSphere Application Server v4 Fix Pack 4 (v4.04) for AEs
  • DB2 Universal Database v7.2 Fix Pack 5, 6, or 7
  • Microsoft Windows 2000 Service Pack 1 or 2, or Windows NT 4.0 with Service Pack 6a or higher

    To apply Fix Pack 4, go to the WebSphere Application Server Support link, www.ibm.com/software/webservers/appserv/support.html. In the Search this product field, type "Version 4.0.4" and click Submit. This will bring up a link to the Fix Pack 4 download site.

    When installing the Fix Pack for Advanced Edition, ensure that you run the install -connectors command if you have not already installed the J2C (J2EE Connector) runtime support in the application server.

    To install the J2C runtime support in Advanced Single Server Edition, copy the following JAR files from the /lib directory| to the /lib directory:

  • recjava.jar
  • jca.jar
  • j2c.jar
  • eablib.jar
  • ccf2poolmgr.jar
  • ccf2.jar
  • ccf.jar

    Create, Deploy and Test the Application in Integration Edition
    Create the Application

    Integration Edition includes a sample that documents how to build, deploy, and run the Phone Book IMS application in the Test Environment. Since the intent of this article is to show how JCA applications can be deployed and executed in Advanced Edition, this sample is not built but loaded into the workbench instead. To install the Phone Book IMS application in the workbench, complete the following steps:

    Install the Phone Book IMS Application
    1.  Start Integration Edition. The workbench launches the Enterprise Services perspective (see Figure 4).
    2.  Select File -> New -> Other.
    3.  Expand Examples from the left frame and select Enterprise Services Samples.
    4.  From the right frame, select Phone Book.
    5.  Click Next.
    6.  Click Finish. This will load the Phone Book IMS sample in the workbench. It may take several minutes. Once the sample has been loaded, the Help perspective opens and you will see four errors in the task list, which can be ignored. 7.  Go back to the Enterprise Services perspective.
    8.  To remove the list of referenced libraries from this view, go to the top right-hand corner of the Packages view, click the Menu icon and ensure that Show Referenced Libraries is unchecked.

    Test the Application
    Before the Phone Book IMS application is deployed and executed, it is a good idea to verify that the Phone Book IMS application was installed correctly, and to verify connectivity to IMS.

    Configure Connection Information in the Phone Book IMS Application
    1.  From the Enterprise Services perspective, click the Packages tab. Expand the IMSSample project, sample.ims package, and double-click PhoneBookIMS.wsdl. PhoneBookIMS.wsdl will open in the WSDL editor.
    2.  In the Services section, click PhoneBookIMSService.
    3.  In the Ports section, click imsPort.
    4.  Click Extensibility Elements.
    5.  Select IMSAddress. The Extensibility Element Properties appear (see Figure 5).
    6.  Type the appropriate connection information for your IMS system.
    7.  Close the editor and click Yes to save your changes.

    Run the Java Client Application
    The Phone Book IMS application includes a fat Java client application that communicates directly with the IMS system.
    1.  In the same sample.ims package, select TestPhoneBookIMS.java class and expand the Run icon on the toolbar by selecting the arrow beside it. From the pop-up menu, select Run -> Java Application.
    2.  Verify that the output is similar to that shown in Figure 6.

    Add a Local WebSphere Test Server
    The Test Environment uses server instances and server configurations to test J2EE applications. Server instances identify servers that can test J2EE applications, whereas server configurations contain setup information. Server instances and server configurations are created using the Create a New Server Instance and Configuration wizard.

    Create a Server Instance and Server Configuration
    1.  From the Enterprise Service perspective, click the Server Configuration tab to open the Server Configuration view. Right-click Server Configurations. Select New -> Server Instance and Configuration. The Create a New Server Instance and Configuration wizard opens.
    2.  In the Server name field, type ServicesServer.
    3.  In the Folder field, type ServicesServer.
    4.  Expand WebSphere Servers from the Server instance type list.
    5.  Select WebSphere v4.0 Test Environment. Leave the template set to None. Click Next.
    6.  Click Yes to create a ServicesServer server project.
    7.  Click Finish. The new server instance appears in the Server Configuration view and in the Servers view. The server configuration appears in the Server Configuration view.

    Install and Configure the Resource Adapter
    Integration Edition comes with four resource adapters: CICS ECI, CICS EPI, IMS, and HOD 3270. In order for a WebSphere Test Server to use these resource adapters, they must be installed and configured appropriately:
    1.  Expand Server Configurations in the Server Configuration view.
    2.  Double-click the server configuration ServicesServer. The server configuration editor opens.
    3.  Click the J2C tab.
    4.  Click Add beside the J2C Resource Adapters pane. The Create Resource Adapter window opens.
    5.  In the Resource Adapter Name dropdown list, select IMS.
    6.  Click OK.

    To add a connection factory:
    1.  Click Add beside the J2C Connection Factories pane.
    2.  In the Create Connection Factory window, click Name in the Name column, and then click in the Value column beside Name. Type ims_cf.
    3.  Click JNDI name in the Name column, and then click in the Value column beside JNDI name. Type "myIMS".
    4.  Click on another field to set the new values, and then click OK.
    5.  In the Resource Properties pane, complete the necessary resource properties for your IMS system (see Figure 7).
    6.  Close the editor and click Yes to save the changes.

    Deploy the Application
    Add the JCA Application to the Local WebSphere Test Server

    Deploying a JCA application involves the simple step of adding the EAR project to the server configuration:
    1.  In the Server Configuration view, expand Server Configurations and right-click ServicesServer.
    2.  Select Add Project -> IMSClient.

    Test the JCA Application
    Start the Local WebSphere Test Server

    1.  Click the Servers tab to open the Servers view.
    2.  Under Server Instance in the Servers view, right-click ServicesServer, and then select Start from the pop-up menu. The server status should change to "Started". (If it doesn't, click the Console tab and look for exceptions or load module errors.)

    Run the Java Client Application
    The Phone Book IMS application includes a Java client application that invokes the application's session bean.
    1.  From the Enterprise Services perspective, click on the Packages tab. Expand the Services_CLIENT project, appClientModule folder, and sample.ims.client package.
    2.  Select TestPhoneBookEJB.java and expand the Run icon on the toolbar by selecting the arrow beside it. From the pop-up menu, select Run -> Java Application.
    3.  Verify that the output is similar to that shown in Figure 8.
    4.  Under Server Instance in the Servers view, right- click ServicesServer, and then from the pop-up menu, select Stop. The server status should change to "Stopped". (If it doesn't, click the Console tab and look for exceptions.)

    At this point, you have completed building your JCA application and verified that it executes successfully with your EIS. The next step is to test the same JCA application in a different WebSphere Test Environment.

    Deploy and Test the JCA Application in Advanced Single Server Edition
    Add a Remote WebSphere Test Server

    The process of adding a remote WebSphere Test Server to your Test Environment is quite similar to adding a local test server.

    Create a Server Instance and Server Configuration
    1.  From the Enterprise Service perspective, click the Server Configuration tab to open the Server Configuration view. Right-click Server Configurations. Select New -> Server Instance and Configuration. The Create a New Server Instance and Configuration wizard will open.
    2.  In the Server name field, type AEs.
    3.  In the Folder field, select ServicesServer.
    4.  Expand WebSphere Servers from the Server instance type list.
    5.  Select WebSphere v4.0 Remote Server. Leave the tem- plate set to None.
    6.  Click Next (see Figure 9).
    7.  In the WebSphere installation directory field, type the path where Advanced Single Server Edition is installed.
    8.  Click Next twice.
    9.  In the Remote target directory field, type the path of the Advanced Single Server Edition seen on the local machine. Most likely, the Single Server Edition is installed on the same physical machine as the Integration Edition. This means the remote target- directory will be same as the WebSphere installation directory.
    10.  Click Finish. The new server instance appears in the Server Configuration view and in the Servers view. The server configuration appears in the Server Configuration view.

    Install and Configure a Resource Adapter
    Installing and configuring resource adapters in a remote test server is identical to installing and configuring resource adapters in a local test server. Consequently, follow the steps as outlined above to install and configure a resource adapter in a local test server.

    If the remote test server is not on the same physical machine as the Integration Edition, then additional steps are needed to configure the resource adapter. If this is the case, then see the "Additional Steps to Configure a Resource Adapter in a Remote Test Server" section in the "Hints and Tips" section of this article.

    Deploy the JCA Application
    Add the JCA Application to a Remote WebSphere Test Server

    Deploying a JCA application to a remote WebSphere Test Server involves adding the EAR project to the server configuration, which is done as follows:
    1.  In the Server Configuration view, expand Server Configurations and right-click AEs.
    2.  Select Add Project -> IMSClient.

    Test the JCA Application
    Start the Remote WebSphere Test Server

    1.  Click the Servers tab to open the Servers view.
    2.  Under Server Instance in the Servers view, right-click AEs, and then from the pop-up menu, select Start. The server status should change to "Started". (If it doesn't, click the Console tab and look for exceptions or load module errors.) In the Console window, you will notice that the Advanced Single Server Edition with the applied Fix Pack 4 will start up (see Figure 10).

    Run a Java Client Application
    The same Java client application used earlier with the local test server is invoked here.
    1.  From the Enterprise Services perspective, click on the Packages tab. Expand the Services_CLIENT project, appClientModule folder, and sample.ims.client package.
    2.  Select TestPhoneBookEJB.java and expand the Run icon on the toolbar by selecting the arrow beside it. From the pop-up menu, select Run -> Java Application.
    3.  Verify that the output is similar to that running in the local test server.

    At this point, you have verified that your JCA application executes successfully with your EIS in an environment similar to Advanced Edition. The final step is to move the JCA application over to the Advanced Edition.

    Deploy and Run a JCA Application in Advanced Edition
    The Advanced Edition does not come with the resource adapters that a JCA application requires to access enterprise information systems using SAP, CICS, IMS, and other back-end systems. You must obtain the appropriate Resource Adapter Archive (RAR) file for your EIS before you can execute your JCA application in Advanced Edition.

    In the case of the Phone Book IMS sample, you can obtain the IMS RAR file from the IMS Connector for Java link, www.ibm.com/software/data/ims/ about/imsico/downloads.htm.

    The WebSphere Application Server InfoCenter contains extensive documentation on the application server, including how to install resource adapters, how to create JCA connection factories and how to install EAR files. Consequently, some of the instructions below are not detailed. See www.ibm.com/software/webservers/appserv/infocenter.html for more details on these tasks.

    Install and Configure a Resource Adapter
    Start the Administrative Server

    1.  From a command window, type the command adminserver to start the Administrative server. Once the message "Server __adminServer open for e-business" appears in the command window, the server is up

    Start the Administrative Console
    Click Start -> Programs -> IBM WebSphere -> Application Server V4.0 AE -> Administrator's Console to open the Administrative Console.

    Install a Resource Adapter
    1.  In the Administrative Console, select New -> J2C Resource Adapter. The J2C Resource Adapter Properties window comes up.
    2.  In the Name field, type ims_ra.
    3.  Beside the Archive file name field, click the small square button to open the Install Driver page.
    4.  Select the node that you want to use to install the resource adapter.
    5.  Beside the RAR file field, click Browse, and then navigate the file system and select the IMS RAR file.
    6.  Click Install.
    7.  Click OK.

    Add a Connection Factory
    1.  From the Console menu, select New -> J2C Connection Factory. The J2C Connection Factory wizard appears.
    2.  In the J2C resource adapter dropdown list, select ims_ra.
    3.  In the Name field, type "ims_cf".
    4.  In the JNDI binding path field, type "myIMS".
    5.  Click the Connections tab and type the property values appropriate to your environment.
    6.  Click OK.

    Deploy the JCA Application
    Export an EAR File

    The Integration Edition includes an Export EAR wizard that conveniently packages a JCA application into an EAR file. This EAR file can then be installed in Advanced Edition using the Administrative Console.
    1.  From Integration Edition, select File -> Export. The Export wizard opens.
    2.  In the left frame, select EAR file.
    3.  Click Next.
    4.  Click Finish.

    Install EAR File
    Use the Administrative Console to install the EAR file in Advanced Edition. Since the EAR file was packaged with all the deployment information in Integration Edition, installing it into the application server is very simple.
    1.  From the Administrative Console menu, select Wizards -> Install Enterprise Application. The Install Enterprise Application wizard opens.
    2.  In the Path field, click Browse, navigate to your EAR file, and select it. Click Open.
    3.  Click Next 10 times to accept the defaults.
    4.  Click Finish. When a message appears that asks you if you want to regenerate code, click No.

    Run the JCA Application
    Start the Default Application Server

    1.  In the left frame of the Administrative console, expand WebSphere Administrative Domain, Nodes, your_node_name, and Application Servers.
    2.  Right-click Default Server and select Start.

    Run the Java Client Application
    The same Java client application used with the local and remote test servers in earlier is invoked here.
    1.  From a command window, type "launchclient< Advanced Edition_Installdir>/installed Apps/ServicesEAR.ear".
    2.  Verify that the output is similar to that shown in Figure 11.

    Congratulations! You have now successfully deployed and executed a JCA application in Advanced Edition.

    Hints and Tips
    Problems with Launching the Remote Test Server

    The most likely scenario is that you already had Agent Controller installed on a machine and then you installed Advanced Single Server Edition on the same machine. In this case, you must edit the settings in the server configuration file after you install Advanced Single Server Edition:
    1.  Open the serviceconfig.xml file, which is located in the /config directory.
    2.  In the file, search for the Application executable="wte Remote.exe" tag. Change all occurrences of

    path="%WAS_HOME%"

    within the tag to

    path="AdvancedSingleServerEdition_Installdir"

    3.  Save your changes and close the file.

    It is also possible that Agent Controller is not running. Agent Controller is a daemon process that provides the mechanism by which client applications either launch new host processes or attach to agents that coexist within existing host processes. Agent Controller is automatically installed with Integration Edition as a Windows service. You do not have to provide any information (such as the installation path and JAVA_HOME environment) when you install Agent Controller with Integration Edition. Integration Edition will provide all necessary information to Agent Controller. Check your list of Windows services and ensure that the Agent Controller service is running.

    Additional Steps to Configure a Resource Adapter in a Remote Test Server
    Additional steps to configure a resource adapter in a remote test server are necessary when the remote test server is on a different physical machine from the Integration Edition. This is due to a limitation of Integration Edition's Test Environment for publishing resource adapters to the remote test server. When the remote test server is on the same physical machine as Integration Edition, this limitation is transparent because the Test Environment configures the remote test server to point to the pre-installed resource adapters. If the remote test server is on a different machine, then the configuration settings for the resource adapters become invalid because the directory structure will be different on the two machines. In order to configure a resource adapter in the remote test server that is on a different physical machine from Integration Edition, follow these steps:
    1.  Navigate to the directory \workspace\Installed Resource Adapters. This directory contains all your installed resource adapters, including IMS.
    2.  Copy the appropriate group of JAR files to the machine where Advanced Single Server Edition is installed.
    3.  Open the server-cfg.xml file, which is located in the \workspace\\.wsc directory.
    4.  In that file, search for the installedResourceProviders tag. Modify its classpath attribute to point to the location where the JAR files were moved to in Step 2.

    Note: The Integration Edition v4.11 licensing agreement permits you to copy the resource adapter files to Advanced Single Server Edition and use them in conjunction with the Integration Edition product for development and testing purposes only. For additional information, see the licensing agreement located in the \license directory.

    Conclusion
    The target platform for applications developed with Integration Edition v4.11 is Enterprise Edition. However, the release of the WebSphere Application Server v4 Fix Pack 4 makes it possible to deploy and run JCA applications in Advanced Edition. This article provides best practices for moving your non-flow-based JCA applications to Advanced Edition.

    References

  • WebSphere Studio Application Developer Integration Edition: www.ibm.com/software/ad/studiointegration
  • Running JCA Applications in Advanced Edition: www-1.ibm.com/support/docview.wss?uid =swg27002269&aid=1
  • WebSphere Application Server Support: www.ibm.com/software/webservers/ appserv/support.html
  • WebSphere Application Server InfoCenter: www.ibm.com/software/webservers/ appserv/infocenter.html
  • IMS Connector for Java: www.ibm.com/software/data/ims/ about/imsico/downloads.htm
  • Connector Architecture: http://java.sun.com/j2ee/connector
  • WebSphere Adapters: www-3.ibm.com/software/ts/mqseries/adapter/ws
  • IBM WebSphere V4 Advanced Edition Handbook: http://publib-b.boulder.ibm.com/Redbooks.nsf/ 9445fa5b416f6e32852569ae006bb65f/f1d70f465728 f28e85256b7300549ca6?OpenDocument&Highlight =0,WebSphere,Handbook
  • About Sandy Minocha

    Sandy Minocha works for the WebSphere Studio Jumpstart ISV Enablement team at the IBM Toronto Software Lab. The team engages with key WebSphere Studio tools partners, providing technical guidance and support as they integrate into the WebSphere Studio set of products. The team also performs technical validations of partner plug-ins for the Ready for WebSphere Studio partner program. Sandy holds a bachelor’s in electrical engineering from the University of Waterloo and a master’s in Telecommunications from the University of Toronto, and is a PEng.

    Comments (0)

    Share your thoughts on this story.

    Add your comment
    You must be signed in to add a comment. Sign-in | Register

    In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.