|
WebLogic Server 6.1 Beta Code Examples, BEA Systems, Inc. |
This example illustrates how to call a stateless session bean from a variety of client applications through a Tuxedo Server. In conjunction with the Tuxedo Client, it also can demostrate server-to-server connectivity using the underlying WebLogic-Tuxedo-Connector technology. Make sure you have deployed the bean and run through the setup and configuration in WebLogic Server first.
Then after you have set up and run your Tuxedo Server as described in this document, try the different clients:
Note: If you are a Unix user and wish to run through Tuxedo you must have Tuxedo 8.0 with rolling patch #10. And for SunOS users you must have the Sun Workshop 6.0 with 5.1 C compiler.
Also, if you are interested in how Tuxedo and Corba clients call an EJB on WebLogic, is recommended to use this example as reference, rather than the WLStrader example included in the Tuxedo 8.0 distribution.
This example uses a stateless session EJB called TraderBean and presumes some knowledge of EJB deployment. For examples pertaining strictly to EJBs, please see our EJB examples page. Included there is a stateless session bean similar to TraderBean. This example also presumes familiarity with BEA Tuxedo. For further information on Tuxedo and especially how to administer and configure a Tuxedo Server, it is highly recommended that you view their online documentation
To get the most out of this example, first read through the source code files to see what is happening. Start with the XML deployment files to find the general structure of the EJB, i.e. which classes are used for the different objects and interfaces, then examine the other files to see how the applications work. Pay close attention to setting up your Tuxedo environment as there are many pitfalls when attempting to run Tuxedo and WebLogic in conjunction. There are three different clients that can be executed to call the EJB. Examine the XML build file carefully for each one. Take special note to see how the idl files are created for the C++ and Tuxedo clients as well as the Tuxedo server.
If you run into problems, make sure to check your environment; check especially your PATH and CLASSPATH as well as the BDMCONFIG, TOBJADDR , and TUXCONFIG variables that are used by Tuxedo. Make sure you have the proper settings that include the necessary Tuxedo directories in your PATH; make sure you have TUXDIR set to your installation of Tuxedo 8.0 and that you have included the tuxedo8.0/bin and tuxedo8.0/lib directories in your PATH. It is recommended to get these examples first working with WebLogic Server before attempting to introduce the Tuxedo Server.
The following section describes how to build and run the example:
iiop/ejb/stateless/server/wls
instructions. It is necessary that you successfully build this part of the example
first before running through Tuxedo or continuing with any of the steps below.
tuxedo8.0/bin
in your PATH.
-iiop -idl -idlOverwrite -idlDirectory
.
bdmconfig.xml
file that is included in the WL_HOME/samples/examples/iiop/ejb/stateless/server/tux
directory. This file configures the WebLogic-Tuxedo-Connector. In both T_DM_LOCAL_TDOMAIN and in T_DM_REMOTE_TDOMAIN
replace 127.0.0.1 with your own ip address in the NWADDR sections.
WL_HOME/config/examples/config.xml
file. You need to provide a classname and the fully qualified name of the bdmconfig.xml
file you are using for the example.
weblogic.wtc.gwt.WTCStartup
BDMCONFIG=path_name_of_your_bdmconfig.xml_file
For example, your config.xml
would have an entry like the following:
<StartupClass
Arguments="BDMCONFIG=c:\BEA_HOME\wlserver6.1\samples\examples\iiop\ejb\stateless\server\tux\bdmconfig.xml"
ClassName="weblogic.wtc.gwt.WTCStartup" Name="bdmconfig" Targets="examplesServer"/>
iiop_ejb_stateless.jar
is deployed. Use the WLS console or
check the config.xml
file. Take special note of the <env-entry>
in the
ejb-jar.xml
that contains the foreignOrb
property; if you are using Tuxedo, this descriptor contains the address the bean will connect to when
doing outbound calls.
<TUXDIR>/samples/corba/cnssimpapp
directory and run
runme.cmd
, this will verify that you Tuxedo installation is correct and
builds an example. There is documentation for this example included in it's own directory. For additional
information on Tuxedo examples and setting up your Tuxedo environment,
see the Tuxedo documentation.
runme.cmd
your environment will be set.
Check the following parameters:
%TUXDIR%\bin
NOTE: NT/2000 users may modify the setEnv.cmd
script included with the cnssimpapp Tuxedo example that is placed in the
cnssimpapp/results directory.
Unix users may modify the tux.env
file.
cpp/trader_server.exe
, ior.txt
, ubbdomain
, and dom1config
from the
WL_HOME/samples/examples/iiop/stateless/ejb/server/tux
directory (note that trader_Server.exe
was placed one directory down
in the cpp folder).
Paste all the files into the <TUXDIR>/samples/corba/cnssimpapp directory. If you are a Unix user, change the name of trader_server.exe to trader_server
without an extension.
ubbdomain
file that you just copied into Tuxedo for your Tuxedo environment. Modify the MACHINES section
of the UBBDOMAIN file to reflect your machine name
(change <HOSTNAME> to whatever your machine name is). Change the 127.0.0.1 entry next to CLOPT in the ISL section to be your own ip address.
Also check the pathnames for APPDIR, TUXCONFIG, and TUXDIR in the MACHINES section.
Make sure all the <bracked>
items below contain the correct path to you Tuxedo home. Then save the file.
APPDIR="<TUXDIR>/samples/corba/cnssimpapp"
ubbdomain
file. Example:
tmloadcf -y ubbdomain
bdmconfig
file. This is not to be confused with the bdmconfig.xml file that configures the
WebLogic side of Tuxedo-WebLogic communication. The Tuxedo bdmconfig
file is simply the remote domain configuration
file for Tuxedo that has been loaded and compiled into binary format from the (dom1config
file that you have just
set up. The bdmconfig
file (here named
bdmconfig
) should begin as
a blank unformatted file. To set up the bdmconfig
and load the dom1config
file, for example:
set BDMCONFIG=<TUXDIR>\samples\corba\cnssimpapp\results\bdmconfig
then:
dmloadcf -y dom1config
tmboot -y
c:/tuxedo8.0/smaples/corba/cnssimpapp>cnsbind -o ior.txt WLS
C++ Client (requires visibroker 4.1)
Tuxedo Client (requires Tuxedo 8.0)
ejb.stateless.server.tux
examples, use the WebLogic Tuxedo Connector tracing feature. Add the TraceLevel parameter to the StartUp Class Argument list.
BDMCONFIG=path_to_my_bdmconfig.xml_file,TraceLevel=65000A TraceLevel of 65000 traces all of the calls to the CORBA object in the client.
Read more about WebLogic RMI over IIOP in the Developer Guide, Using WebLogic RMI over IIOP.
Read more about WebLogic EJB in the Developer Guide, BEA WebLogic Server Enterprise JavaBeans.
Read more about WebLogic RMI in the Developer Guide, Using WebLogic RMI.
For more information about WebLogic Server WebLogic Tuxedo Connector, see:
|
Documentation is available at http://e-docs.bea.com/wls/docs61/ |