Skip navigation.
Downloads | Product Documentation | Support

WLEC to WebLogic Tuxedo Connector Migration Guide

# How to Modify WLEC Applications for WebLogic Tuxedo Connector

The following sections provide information on the steps required to convert your WLEC applications for use with WebLogic Tuxedo Connector:

- How to Modify Your Tuxedo Environment
- How to Modify your WebLogic Server Environment
- How to Modify WLEC Applications

# How to Modify Your Tuxedo Environment

Tuxedo users need to make the following environment changes:

- Create a Tuxedo dmconfig File
- Modify the Tuxedo tuxconfig File

## Create a Tuxedo dmconfig File

A new `dmconfig` file must be created to provide connectivity between your Tuxedo and WebLogic Server applications. For more information on how to create Tuxedo domains, see Planning and Configuring CORBA Domains.

## Modify the Tuxedo tuxconfig File

You will need to modify the `tuxconfig` file so your application will use the Tuxedo /T Domain gateway. Add Tuxedo the domain servers to the `*SERVERS` section of you UBB file.

Example:

>          DMADM SRVGRP=SYS_GRP SRVID=7
>          GWADM SRVGRP=SYS_GRP SRVID=8
>          GWTDOMAIN SRVGRP=SYS_GRP SRVID=9

Weblogic Tuxedo Connector does not use ISL. If you nolonger have other applications that require ISL, you can remove the `ISL` from the `*SERVERS` section.

Example: Comment out the `ISL` section.

>     #     ISL
>     #          SRVGRP  = SYS_GRP
>     #          SRVID   = 5
>     #           CLOPT   = "-A -- -n //lchp15:2468 -d /dev/tcp"

# How to Modify your WebLogic Server Environment

This section provides information on how to modify your WebLogic Server Environment.

- How to Configure WebLogic Tuxedo Connector
- How to Update the ejb-jar.xml File

## How to Configure WebLogic Tuxedo Connector

Note: For more information on how to configure WebLogic Tuxedo Connector, see Configuring WebLogic Tuxedo Connector for Your Applications.

This section provides basic information on how to create a WTC Service for a migrated WLEC application using the WebLogic Server console. A WTC Service represents configuration information that WebLogic Server uses to create a connection to a Tuxedo application. Typical WTC Service configurations for migrated WLEC applications consist of a local Tuxedo access point, a remote Tuxedo access point, and an imported service.

Use the following steps to create a configuration to administer your application:

1. Create a WTC Service
2. Create a Local Tuxedo Access Point
3. Create a Remote Tuxedo Access Point
4. Create an Imported Service

### Create a WTC Service

1. Select WTC in the navigation tree.
2. Click Configure a new WTC Service.
3. Enter a name to identify this configuration in the name field.

Example: Migrated_WLEC_Example

4. Enter a value in the Deployment Order field.
5. Click Create. The new WTC Service appears under the WTC in the navigation tree.

### Create a Local Tuxedo Access Point

1. Click WTC in the navigation tree.
2. Select the WTC Server instance and click to expand.
3. Click Local Tuxedo Access Points.
4. Click Configure a new Local Tuxedo Access Point.
5. In Access Point, enter a name that uniquely identifies this local Tuxedo access point within a WTC Service configuration. This allows you to create Local Tuxedo Access Point configurations that have the same Access Point ID.
6. In Access Point Id, enter the connection name used when establishing a session connection to remote Tuxedo access points. The Access Point Id must match the corresponding `DOMAINID` in the `*DM_REMOTE_DOMAINS` section of your Tuxedo `DMCONFIG` file.
7. In Network Address, enter the network address for this local Tuxedo access point.
8. Click Create.
9. Click Connections Tab.
10. If necessary, modify the connection attributes for your environment. For more information, see Configuring the Connections Between Domains.
11. Click Apply
12. Click Security Tab.
13. If necessary, modify the security attributes for your environment. For more information, see WebLogic Tuxedo Connector Administration.
14. Click Apply.

### Create a Remote Tuxedo Access Point

1. Click WTC in the navigation tree.
2. Select the WTC Server instance and click to expand.
3. Click Remote Tuxedo Access Points.
4. Click Configure a new Remote Tuxedo Access Point.
5. In Access Point, enter a name that uniquely identifies this remote Tuxedo access point within a WTC Service configuration. This allows you to create Remote Tuxedo Access Point configurations that have the same Access Point ID.
6. In Access Point Id, enter the connection name used to identify a remote Tuxedo access point when establishing a connection to a local Tuxedo access point. The Access Point Id of a remote Tuxedo access point must match the corresponding `DOMAINID` in the `*DM_LOCAL_DOMAINS` section of your Tuxedo `DMCONFIG` file.
7. In Local Access Point, enter the name of the local access point for this remote domain.
8. In Network Address, enter the network address for this remote domain.
9. Click Create.
10. Click Connections Tab.
11. If necessary, modify the connection attributes for your environment. For more information, see Configuring the Connections Between Domains.
12. Click Apply.
13. Click Security Tab.
14. If necessary, modify the security attributes for your environment. For more information, see WebLogic Tuxedo Connector Administration.
15. Click Apply.

### Create an Imported Service

1. Click WTC in the navigation tree.
2. Select the WTC Server instance and click to expand.
3. Click Imported Services.
4. Click Configure a new Imported Service.
5. In Resource Name, enter a name to identify this imported service configuration. This name allows you create unique Imported Services configurations that have the same Remote Name within a WTC Service.
6. Set Local Access Point to the name of the Local Tuxedo Access Point that uses the service.
7. In Remote Access Point List, enter a list of Remote Access Point names that offer this imported service.
8. Set Remote Name to "//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 //.

Example: `//simpappff`

9. Click Create.

## How to Update the ejb-jar.xml File

WebLogic Tuxedo Connector uses the Domain gateway to connect WebLogic and Tuxedo applications. IIOP connection pool are not used and the descriptors can be removed from the `ejb-jar.xml` file. The following is an example of code removed from the `wlec/ejb/simpapp` example:

Listing 2-1 IIOP Connection Pool Descriptors for the wlec/ejb/simpapp Example

>     .
>     .
>     .
>     <env-entry>
>     	  <env-entry-name>IIOPPoolName</env-entry-name>
>     	  <env-entry-type>java.lang.String</env-entry-type>
>     	  <env-entry-value>simplepool</env-entry-value>
>     	</env-entry>
>     .
>     .
>     .

# How to Modify WLEC Applications

The following sections provide information on how to modify WLEC applications to interoperate with WebLogic Server and Tuxedo CORBA objects using WebLogic Tuxedo Connector.

- How to Modify WLEC EJBs to Reference CORBA Objects Used by WebLogic Tuxedo Connector
- Transaction Issues

## How to Modify WLEC EJBs to Reference CORBA Objects Used by WebLogic Tuxedo Connector

Use the following steps to modify your EJB to use WebLogic Tuxedo Connector to invoke on CORBA objects deployed in Tuxedo:

- Initialize the WTC ORB
- Use the ORB to get the FactoryFinder Object

### Initialize the WTC ORB

WLEC uses the `weblogic.jndi.WLInitialContextFactory` to return a context used by the `Tobj_Bootstrap` object.

>     Properties p = new Properties();
>     p.put(Context.INITIAL_CONTEXT_FACTORY,
>          "weblogic.jndi.WLInitialContextFactory");
>     InitialContext ic = new InitialContext(p);
>     rootCtx = (Context)ic.lookup("java:comp/env");

Replace the WLEC context reference and instantiate the WTC ORB in your Bean. Example:

>     // Initialize the ORB.
>     String args[] = null;
>     Properties Prop;
>     Prop = new Properties();
>     Prop.put("org.omg.CORBA.ORBClass",
>     "weblogic.wtc.corba.ORB");

>     orb = (ORB)new InitialContext().lookup("java:comp/ORB");

### Use the ORB to get the FactoryFinder Object

Each WLEC connection pool has a `Tobj_Bootstrap` FactoryFinder object used to access the Tuxedo domain. Example:

>     Tobj_Bootstrap myBootstrap = Tobj_BootstrapFactory.getClientContext("myPool");
>     org.omg.CORBA.Object myFFObject =
>         myBootstrap.resolve_initial_references("FactoryFinder");

Remove references to the `Tobj_Bootstrap` Factory Finder object. Use the following method to obtain the FactoryFinder object using the ORB:

>     // String to Object.
>     org.omg.CORBA.Object fact_finder_oref = 		orb.string_to_object("corbaloc:tgiop:simpapp/FactoryFinder");

>     // Narrow the factory finder.
>     FactoryFinder fact_finder_ref =
>     FactoryFinderHelper.narrow(fact_finder_oref);

>     // Use the factory finder to find the simple factory.
>     org.omg.CORBA.Object simple_fact_oref =
>     fact_finder_ref.find_one_factory_by_id(SimpleFactoryHelper.id());

## Transaction Issues

Note: For more information how to implement JTA transactions, see Programming WebLogic JTA.

The following section provides information about how to modify WLEC applications that use transactions.

- WLEC applications using JTA transactions require no changes.
- WLEC applications using CosTransactions need to convert to JTA. If the WLEC client is running within a transaction and needs to invoke a new CosTransaction, the new transaction is implemented in a new transaction context. To implement the same behavior in JTA, do the following:

- Suspend the original transaction
- Start a new transaction
- Resume the original transaction after the new transaction has been completed.