3 How to Modify the Tuxedo CORBA Simpapp Example

The following sections provide an example of how to convert a WLEC application to use Oracle WebLogic Tuxedo Connector. This example provides information on the steps required to convert the WebLogic Server 6.1 examples\wlec\ejb\simpapp example to work using the Oracle WebLogic Tuxedo Connector.

Run the Tuxedo CORBA Simpapp Example

You should run the Tuxedo CORBA simpapp example to verify your Tuxedo environment and prepare to run the WLEC simpapp application.

Use the following steps to run the Tuxedo example located at $TUXDIR/samples/corba/simpapp:

Create a working copy of the Tuxedo CORBA simpapp example. Copy the Tuxedo CORBA simpapp example from your Tuxedo installation and place it in your working simpapp directory.

Change directories to your working simpapp directory.

Build and run the example.

Set your Tuxedo environment. Windows users set %TUXDIR% in your shell environment. Unix users need to set the Tuxedo environment by running $TUXDIR/tux.env.

Make sure the C++ compiler is in your PATH.

Set the JAVA_HOME environment variable to the location of your Tuxedo Java JDK.

Set the environment by running the runme script. This will create the client stubs that provide the programming interface for CORBA object operations. A results directory is created in your working directory that contains the files used to configure the Tuxedo environment.

Run the Java client.

java -DTOBJADDR=%TOBJADDR% -classpath %CLASSPATH% SimpleClient

Shutdown the Tuxedo server.

tmshutdown -y

Modify the UBB Configuration File

In your working Tuxedo simpapp directory, use the following steps to modify your UBB configuration:

Rename the results/ubb file in your working directory as results/ubbdomain.

Modify the ejb-jar.xml File

Use a text editor such as vi or Notepad to remove connection pool descriptors and update the trans-attribute. Example 3-3 is a code example showing how to remove references to the IIOP connection pool descriptors in the WLEC simpapp example ejb-jar.xml. This example

Removes the env-entry attribute.

Sets the trans-attribute in the container-transaction to Supports. As the example does not have a transaction, the container-transaction can not be Required.

Update the build.xml File

A build.xml file is presented below to simplify compiling and deploying your migrated application in the Weblogic environment. Replace the contents of the build.xml file with the code shown in Example 3-4.

Create a WTC Service

To create and configure a WTC service using the WebLogic Server Administration Console:

In the Administration Console, expand Interoperability and select WTC Servers in the navigation tree.

On the WTC Servers page, click New.

On the Create a New WTC Server page, enter My_WLEC_App to identify this configuration in the name field.

Click OK.

Your new WTC Service appears in the WTC Servers list.

Create a Local Tuxedo Access Point

Note:

When configuring the Network Address for a local access point, the port number used should be different from any port numbers assigned to other processes. Example: Setting the Network Address to //mymachine:7001 is not valid if the WebLogic Server listening port is assigned to //mymachine:7001.

To configure a local Tuxedo access point:

In the Administration Console, expand Interoperability and select WTC Servers.

On the WTC Servers page, click the name of a WTC Service to access the settings page.

Click the Local APs tab.

Enter the following values for the following fields on the WTC Local Access Points page:

In Access Point, enter My_Local_WLS_Dom.

In Access Point Id, enter examples.

In Network Address, enter the network address and port of the WebLogic Server environment that will host this local domain. For example, //my_WLS_machine:5678.

Click OK.

Create a Remote Tuxedo Access Point

To configure a remote Tuxedo access point:

In the Administration Console, expand Interoperability and select WTC Servers.

On the WTC Servers page, click the name of a WTC Service.

Click the Remote APs tab.

Enter the following values for the following fields on the WTC Remote Access Points page:

In Access Point, enter My_WLEC_Dom.

In Access Point Id, enter TUXDOM.

In Local Access Point, enter My_Local_WLS_Dom.

In Network Address, enter the network address and port of the Tuxedo environment that will host this remote domain. For example, //my_TUX_machine:5678.

Click OK.

Create an Imported Service

To configure an imported service:

In the Administration Console, expand Interoperability and select WTC Servers.

On the WTC Servers page, click the name of a WTC Service.

Click the Imported tab.

Enter the following values for the following fields on the WTC Imported Services page:

In Resource Name, enter //simpapp.

In Local Access Point, enter My_Local_WLS_Dom.

In Remote Access Point List, enter My_WLEC_Dom.

In Remote Name, enter //domain_id where domain_id is DOMAINID specified in the Tuxedo UBBCONFIG file. The maximum length of this unique identifier for CORBA domains is 15 characters and includes the //. For example, //simpappff.

Click OK.

Run the simpapp Example

To run the simpapp example, complete the following steps:

Open a new shell and change directories to your working Tuxedo CORBA simpapp example.

Set environment variables.

For Windows NT and 2000 systems, run the following command:

results\setenv.cmd

For UNIX systems, run the following command:

results\setenv.sh

Boot the Tuxedo domain:

tmboot -y

Open a new shell and change directories to your WebLogic Server WLEC simpapp example.

Set environment variables. Update the following parameters:

Note:

On Windows NT or 2000 systems, modify and run the setExamplesEnv.cmd script. On Unix systems, copy the ./config/examples/setExamplesEnv.sh script to your WLEC simpapp directory, then modify and run the setExamplesEnv.sh script.

Beginning simpapp.Client...
Start of Conversion for: It Works
Converting to lower case: It Works
...Converted: it works
Converting to upper case: It Works
...Converted: IT WORKS
Removing Converter
End simpapp.Client...