Package examples.wtc.corba.simpappcns
This example demonstrates the ability to use WTC to allow Tuxedo or WLS clients to run CORBA applications using the Corba Name Service.See:
Interface Summary
ToupperCorba The methods in this interface are the public face of the simpapp client. ToupperCorbaHome This interface is the home interface for the ToupperCorbaBean.java, which in WebLogic is implemented by the code-generated container class ToupperCorbaBeanC.
Class Summary
Client This class illustrates calling a stateful SessionBean and performing the following exercises: Create a ToupperCorba Convert a string using ToupperCorba Remove the ToupperCorba ToupperCorbaBean ToupperCorbaBean is a stateful SessionBean. Package examples.wtc.corba.simpappcns Description
This example demonstrates the ability to use WTC to allow Tuxedo or WLS clients to run CORBA applications using the Corba Name Service.
The
simpappcns
example takes the Tuxedo 8.0 CORBAcnssimpapp
application and extends it to run over domains, such that the clients for theto_upper
method can either run on Tuxedo or on WLS.This example uses two domains:
- The classical TUXEDO domain is called TUXDOM.
- A WLS domain called examples.
Note: NT/2000 machines with multi-homed Ethernet adapter may have difficulty running this example. If you continually receive the following message:
Error connecting to Tuxedo Domain
, consider using a machine with an Ethernet adapter having a single address.
Configure the example
You need to configure Tuxedo and WLS.Tuxedo configuration
- Create a working directory containing the
cnssimpapp
example. Copy the TUXEDO CORBAcnssimpapp
example from your Tuxedo installation and place it in your workingcnssimpapp
directory. Make sure the qualified path name and file name for thetuxconfig
file contains less that 64 characters.
- 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
- TOBJADDR - hostname and port of the Tuxedo Object
- NT/2000 users modify
setEnv.cmd
located at %TUXDIR%. Unix users modify thetux.env
file located at $TUXDIR.
- Build the clients:
NT/2000 users enter the following command: nmake -f makefile.nt all
Unix users enter the following command: nmake -f makefile.mk all
- Copy the files
ubbdomain
anddom1config
from theWL_HOME/samples/server/examples/src/examples/wtc/corba/simpappcns
directory. Paste them into your workingcnssimpapp
directory.
- 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="my_apps/cnssimpapp"
TUXCONFIG="my_apps/cnssimpapp/tuxconfig"
TUXDIR="bea/tuxedo8.0"
- Modify the
dom1config
for your Tuxedo environment. This includes creating log devices and updating the network addresses.
- Logs
Example:
DMTLOGDEV="d:\my_apps\cnssimpapp\DMTLOG"
DMTLOGNAME="DMTLOG_TUXDOM"
- NWADDR
Example:
TUXDOM NWADDR="//TuxMachine:20305"
examples NWADDR="//WLSMachine:20304"
- Load the
ubbdomain
fileExample:
tmloadcf -y ubbdomain
- Set the location of your bdmconfig file and load the
dom1config
fileExample:
then:
set BDMCONFIG=my_apps\cnssimpapp\bdmconfig
dmloadcf -y dom1config
- Boot the Tuxedo domain
tmboot -y
- Verify your Tuxedo configuration by running a remote client using the following command:
You should be prompted for a string. A Tuxedo process will convert the string to all capital letters.
simple_client -ORBid BEA_IIOP
You should recieve the following messages:
String? helloworld
HELLOWORLD
helloworld
WLS Configuration
- Boot your WebLogic Examples Server
- Make sure that no other WTC services are targeted to the examplesServer
- Change directories to the WTC
simpappcns
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 WTCsimpappcns
directory, then modify and run the setExamplesEnv.sh script.- Build the
wtc_toupper_corba.jar
file using ant.
- Enter the following command:
ant
- Check to see that the
wtc_toupper_corba.jar
is deployed. Use the WLS console or check the config.xml file. Manually deploy the EJB if needed.- Configure your WTC
simpappcns
service.
- Enter the following command:
ant setwtc
You will be promped for your username, password, and the network addresses for your examples local Tuxedo access point and your TUXDOM 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, examples:
- //WLSMachine:20304
- [input] Enter the Network Address for your remote access point, TUXDOM:
- //TuxMachine:20305
- [java] Ok
- [java] Ok
- [java] Ok
- [java] Ok
- [java] Ok
- [java] Ok
- [java] Ok
- [java] Ok
- [java] Ok
- [java] Ok
- [java] Ok
- BUILD SUCCESSFUL
Run the example
Start a WLS client which connects to the Tuxedo CORBA application and invokesto_upper
.From the WTC
simpappcns
directory, start a client:
- Use the following command:
ant run
The service returns the following:
Buildfile: build.xml
- run:
- [java]
- [java] Beginning statefulSession.Client...
- [java]
- [java] Creating ToupperCorba
- [java]
- [java] converting HereIsAString
- [java] converted to: HEREISASTRING
- [java]
- [java] End statefulSession.Client...
- [java]
- BUILD SUCCESSFUL
Use the WLS Console to untarget the WTCsimpappcns service from the
examplesServer
.Use TraceLevel
If you have a problem running thesimpappcns
example, use the WTC tracing feature. Add the TraceLevel attribute to yourstartWebLogic
script.Example: -Dweblogic.wtc.TraceLevel=100000A TraceLevel of 100000 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 the WebLogic Tuxedo Connector