Package examples.wtc.atmi.convsimp
This example demonstrates the ability of WebLogic Tuxedo Connector to allow WebLogic Server to interoperate with Tuxedo using conversations.See:
Interface Summary
TuxedoConversation The methods in this interface are the public face of the simpapp client. TuxedoConversationHome This interface is the home interface for the TraderBean.java, which in WebLogic is implemented by the code-generated container class TraderBeanC.
Class Summary
Client This class illustrates calling a stateful SessionBean and performing the following exercises: Create a TuxedoConversation Buy some shares using the TuxedoConversation Sell some shares using the TuxedoConversation Remove the TuxedoConversation TuxedoConversationBean ToupperBean is a stateful SessionBean. Package examples.wtc.atmi.convsimp Description
This example demonstrates the ability of WebLogic Tuxedo Connector to allow WebLogic Server to interoperate with Tuxedo using conversations.
Configure the example
You need to configure Tuxedo and WLS.Tuxedo configuration
- Your PATH environment variable needs to include the path of your C compiler. Use
set PATH
to check the status and add the path if necessary.- Create a working Tuxedo
convsimp
directory.Example:
d:\my_apps\convsimp
- Copy the following files from the examples.wtc.atmi.convsimp package to your working Tuxedo
convsimp
directory.
ubbdomain
dom1config
convcl.c
convsimp.c
- Change directories to the working Tuxedo
convsimp
directory- Set environment variables. Update the following parameters:
- TUXDIR - base directory of the TUXEDO Software
- APPDIR - base directory of the sample program
- PATH - must include
%TUXDIR%\bin
- TUXCONFIG - full pathname of binary tuxconfig file
- NT/2000 users modify
setEnv.cmd
located at %TUXDIR%. Unix users modify thetux.env
file located at $TUXDIR.- Build the clients:
buildclient -o convcl -f convcl.c
buildserver -o convsimp -f convsimp.c -s CTOUPPER
- Modify the
ubbdomain
for your Tuxedo environment. This includes setting the pathnames for APPDIR, TUXCONFIG, and TUXDIR and setting the machine name. Replace all<bracked>
items with information for your environment.Example:
APPDIR="d:\my_apps\convsimp"
TUXCONFIG="d:\my_apps\convsimp\tuxconfig""
TUXDIR="d:\bea\tuxedo"
- Load the
ubbdomain
fileExample:
tmloadcf -y ubbdomain
- Modify the
dom1config
for your Tuxedo environment. This includes creating log devices and updating the network addresses.
- Logs
Example:
DMTLOGDEV="d:\my_apps\tlog"
AUDITLOG="d:\my_apps\aud"
DMTLOGNAME="DMTLOG_TDOM1"
- NWADDR
Example:
TDOM1 NWADDR="//TuxedoMachine:1234"
TDOM2 NWADDR="//WTCMachine:5678"
- Load the
dom1config
fileExample:
set BDMCONFIG=d:\my_apps\convsimp\bdmconfig
dmloadcf -y dom1config
- Boot the Tuxedo domain
tmboot -y
- Verify all processes have started using the
tmadmin psc
command.The following domain processes should have booted:
DMADM
,GWADM
, andGWTDOMAIN
- The
CTOUPPER
serviceWLS Configuration
- Boot your WebLogic Examples Server
- Make sure that no other WTCServer Mbeans are targeted to the examplesServer
- Add TDOM1 to your WebLogic Server User list in the Security node.
- Change directories to the
simpconv
directory- Set environment variables. Update the following parameters:
- Set the APPLICATIONS to the location of the
applications
directory in your WebLogic Server installation- Set the CLIENT_CLASSES to
build
- NT/2000 users modify and run the
setExamplesEnv.cmd
. Unix users copy./config/examples/setExamplesEnv.sh
script to your WTCsimpapp
directory, then modify and run the setExamplesEnv.sh script.- Build the
wtc_tux_server_Conversations.jar
file using ant.
- Enter the following command:
ant
- Change directories to the WTC
convsimp
directory- Build the
wtc_tux_Conversations.jar
file using ant.
- Enter the following command:
ant
- Check to see that the
wtc_tux_Conversations.jar
andwtc_tux_server_Conversations.jar
are deployed. Use the WLS console or check the config.xml file. Manually deploy the EJBs if needed.- Configure your WTC
convsimp
service.
- Enter the following command:
ant setwtc
You will be promped for your username, password, and the network addresses for your TDOM2 local Tuxedo access point and your TDOM1 remote Tuxedo access point. The following is an example of a successful configuration:
Buildfile: build.xml
- setwtc:
- [input] Enter system username:
- weblogic
- [input] Enter system password:
- weblogic
- [input] Enter the Network Address for your local access point, TDOM2:
- //WTCMachine:5678
- [input] Enter the Network Address for your remote access point, TDOM1:
- //TuxedoMachine:1234
- [java] Ok
- [java] Ok
- [java] Ok
- [java] Ok
- [java] Ok
- [java] Ok
- [java] Ok
- [java] Ok
- [java] Ok
- [java] Ok
- [java] Ok
- BUILD SUCCESSFUL
Note: If you are using a Tuxedo 6.5 service, you will need to set Interoperate in your Local Tuxedo Access Point Connections tab. You will need to untarget the WTC service, set Interoperate to yes, and then target and deploy the WTC service.
Run the example
Start a WLS client. From the WTCconvsimp
directory, start a client:
- Use the following command:
ant run
The Tuxedo service replies to your WLS application with:
Buildfile: build.xml
- run:
- [java]
- [java] Beginning statefulSession.Client...
- [java]
- [java] Creating TuxedoConversation
- [java]
- [java] datasize: 1 iterations: 1
- [java]
- [java] End statefulSession.Client...
- [java]
- BUILD SUCCESSFUL
Your WebLogic Server display the following:
setSessionContext called
- ejbCreate called
- conversation called, datasize:1 iterations: 1
- About to start convesation
- tpconnect successfull!
- first send successful!
- first receive successful!
- second send successful!
- second receive successful!
You are ready to run the
simpconv
example.Use TraceLevel
If you have a problem running thesimpapp
example, use the WTC tracing feature. Add the TraceLevel attribute to yourstartWebLogic
script.Example: -Dweblogic.wtc.TraceLevel=20000A TraceLevel of 20000 traces all of the calls to the Tuxedo object in the client.
There's more...
For more information about WebLogic Server WebLogic Tuxedo Connector, see:
- WebLogic Tuxedo Connector Administration Guide
- WebLogic Tuxedo Connector Programmer's Guide
- WebLogic Tuxedo Connector Examples
- Javadocs for WebLogic Classes - weblogic.wtc.jatmi