最新weblogic与tuxedo配置详解

合集下载

tuxedo配置参数详解及远程客户端配置

tuxedo配置参数详解及远程客户端配置

tuxedo配置参数详解及远程客户端配置TUXEDO应用系统的配置3.1 TUXEDO应用系统的常见配置配置文件UBBCONFIG介绍一个TUXEDO应用系统的所有资源都在一个文本文件中进行定义,该文件称为UBBCONFIG,在配置完成后,UBBCONFIG被编译成一个二进制的文件TUXCONFI G.在TUXEDO系统启动时,从该文件中读取系统的配置信息。

UBBCONFIG文件类似WINDOWS下的*.INI文件。

它包括以下9大部分, 我们称之为节,RESOURCE S,MACHIENS,GROUPS这三个节必须的,其他的节是可选的。

RESOURCES(必需): 与整个系统有关的配置信息MACHINES(必需): 一个TUXEDO应用系统可以跨越多台服务器,在该节中配置与每台服务器有关的信息GROUPS(必需): TUXEDO中的服务可被分为多个组,在该节中配置与组有关的信息SERVERS(可选): 与SERVER有关的信息在该节配置SERVICES(可选): 与SERVICES有关的信息在该节配置NETWORK(可选):与网络有关的信息在该节配置ROUTING(可选) :路由规则在该节配置NETGROUPS(可选):与网络分组有关的信息在该节配置名称解释:TUXEDO应用系统一个TUXEDO应用系统包括服务端,客户端,服务端安装在服务器上,客户端一般安装在PC机上,从开发角度看,一个TUXEDO应用系统包括服务端程序,客户端程序,一个配置文件。

此外,一个TUXEDO应用系统可以部署在一台服务器上,也可以部署在多台服务器上。

SERVER:服务端程序用C或COBAL编写,每一个程序文件编译成一个相应可执行文件,该可执行文件在运行时称为SERVER,它实际上就是一个进程。

每个SERVER都有一个名字,也就是该进程的名字。

为与TUXEDO应用系统的服务端区分,我们在本书中,我们用SERVER表示该进程,用服务端表示TUXEDO应用系统的服务端。

通过wtc使tuxedo与weblogic通信开发

通过wtc使tuxedo与weblogic通信开发

标题:通过wtc、jolt进行tuxedo与weblogic通信开发[评论]作者:李振嘉(dev2dev ID:lizhenjia)(一)摘要bea tuxedo与weblogic作为业界优秀的交易与应用服务器中间件产品,在电信,银行,金融等领域广泛应用,通常由tuxedo处理系统的核心业务,weblogic将业务应用扩展到internet平台,实现电子商务,由weblogic调用tuxedo的服务或者由tuxedo的服务调用通过weblogic部署的ejb,所以tuxedo与weblogic 之间的互连通信会经常遇到,本文通过2个例子介绍tuxedo与weblogic通信的配置与开发,两个例子分别通过wtc(weblogic tuxedo connector)、jolt实现weblogic与tuxedo通信的配置与开发.本文所有例子程序与配置均在Sun Solaris,weblogic8.1,tuxedo8.0平台上进行,如在windows等其他平台开发配置方法大同小异;另外为了减少篇幅文中涉及的例子代码没有全部罗列,只选择粘贴了关键部分的代码.(二)通过wtc进行tuxedo与weblogic通信的配置与开发1)域间通信以及wtc介绍Tuxedo的域间通信进程介绍Wtc是tuxedo通过域间通信实现的,所以需要tuxedo启动用于域间通信的进程,介绍wtc之前先介绍以下几个域间通信的进程.*DMADM(DOMAIN ADMINISTRATOR SERVER)管理域的server,在运行时管理BDMCONFIG,对已登记的gateway group提供支持,在tuxedo系统中,只能有一个DMADM进程,且不能对它采用MSSQ,不能有REPLYQ.*GWADM(GATEWAY ADMINISTRATOR SERVER)管理域的域网关进程,在运行时可以对某一组域网关进行管理,主要从DMADM那里取得域的配置信息,并对域网管进程及跨越域的全局事务的LOG文件进行管理.*GWTDOMIN(GATEWAY PROCESS)处理域之前的互操作,使本地域和调用远程域可以互相调用彼此的service,其中GMADM和GWTDOMAIN 必须在一个组中,一个tuxedo应用可以有多个GWADM,GWTDOMAIN对,一个组只能有一个GMADM,GWTDOMAIN对,但一个tuxedo应用只能有一个DMADM,DMADM可以在如何一个组中,一个本地域可以和多个远程域实现互操作.Wtc介绍Wtc(weblogic tuxedo connector)是weblogic server的一个组成部分,可以实现tuxedo和weblogic之间的应用集成,为weblogic和tuxedo提供了双向的互操作性,即tuxedo service可以调用在weblogic上部署的ejb,在weblogic上部署的ejb可以调用tuxedo的service.2)Tuxedo方面需要进行的工作修改并编译ubb文件1)在ubb文件*GROUPS节点中增加如下3个tuxedo Group:DMGroupLMID=simple GRPNO=2 OPENINFO=NONEDMGroupLMID=simple GRPNO=3 OPENINFO=NONEWSGroupLMID=simple GRPNO=4 OPENINFO=NONE2)在ubb文件*SERVERS节点中增加如下3个tuxedo server:DMADMSRVGRP=DMGroup SRVID=22230GWADMSRVGRP=GWGroup SRVID=22340GWTDOMAINSRVGRP=GWGroup SRVID=22350其中GWADM和GWTDOMAIN应该在同一个组中,保存ubb文件并按如下完成编译:tmloadcf ubb_filename之后tmboot-y启动tuxedo server,如果启动以上3个server时报类似Application initialization failure的启动失败的提示信息,那么注意查看tuxedo的ULOG日志文件,通过日志的提示排除错误,这里常见的一个错误是没有在系统环境变量中定义BDMCONFIG或者指定该文件路径错误.(关于环境变量的修改见下文).增加并编译dm文件dm文件是tuxedo进行域间通信时的配置文件,tuxedo与weblogic通过wtc通信是通过域间通信实现的,所以dm文件需要创建,dm文件通常可以存放在ubb文件所在的路径下.Dm需要做的配置如下:*DM_LOCAL_DOMAINStuxedo_domain GWGRP=GWGroupTYPE=TDOMAINDOMAINID=billingDMTLOGDEV="/../../log/DLOG"*DM_REMOTE_DOMAINSweblogic_domain TYPE=TDOMAINDOMAINID=weblogic*DM_TDOMAINtuxedo_domain NWADDR="//tuxedoserver_domain_ip:portNWDEVICE="../../bin"weblogic_domain NWADDR="//weblogicserver_domain_ip:port*DM_REMOTE_SERVICES*DM_LOCAL_SERVICESfml32_test RNAME="fml32_test"*DM_LOCAL_DOMAINS定义本地tuxedo域的信息,分别定义该域所在的组,域类型,域的唯一标识,域间通信时日志的全路径,其中GWGRP, DOMAINID的值要与ubb文件中的定义匹配.*DM_REMOTE_DOMAINS定义远程weblogic域的信息,分别定义域类型,域的唯一性标识,该id标识需要与在weblogic server中的配置名称吻合,否则通信将会失败,关于在weblogic中的相应配置下文将作详细描述. *DM_TDOMAIN定义在DM_LOCAL_DOMAIN中已经说明的本地域和在DM_REMOTE_DOMAINS中已经说明的远程域的具体的通信ip地址以及通信端口,其中NWDEVICE指定tuxedo发布的server通信进程文件所在的路径. *DM_REMOTE_SERVICES定义当前域需要调用远程域的服务名称,本例中的服务作为被调用服务,所以此处可以为空.*DM_LOCAL_SERVICES定义当前域对外发布的tuxedo service名称,可以通过RNAME重新命名service.在以上NWADDR中指定的端口一定不能是已经被占用的端口,否则通信将失败,之前应该用netstat命令查询得到空闲的端口.保存dm文件并按如下完成编译:dmloadcf dm_filename修改系统环境变量在系统环境变量中增加:export BDMCONFIG=$HOME/your_path/bdmconfig其中bdmconfig文件为dmloadcf dm_filename编译之后生成的2进制配置文件.编写基于tuxedo的程序以及makefile.说明Tuxedo支持string,carry,view,view32,fml,fml32等数据缓冲区,其中fml32类型相对复杂且比较常用,本例子采用fml32数据缓冲区开发,首先需要编写fml32数据缓冲区的定义文件,包括fml32数据缓冲区各个字段的名称已经长度等等,并将该文件生成相应的c语言.h头文件,在应用程序中需要包含该头文件,这样应用程序中即可以使用fml32数据缓冲区, fml32类型通常在开发数据库应用程序的时候比较常用,以下的例子完成的功能是:根据输入的学生学号从数据库中查询得到该学生的姓名和年龄,其实输入和输出参数采用fml32类型.编写并编译fml32数据缓冲区定义文件定义fml32数据缓冲区文件student_fld文件如下:*base 10000# name number type flags commentsstudent_id 1 long - 学生学号student_name 2 string - 学生姓名student_age 3 long - 学生年龄student_id等3项就是自定义fml32类型的域字段,其中每一个字段都对应一个number,这些number有一个公共的起始值,通过*base 10000定义.定义之后通过mkfldhdr32 student_fld编译该文件,之后生成student_fld.h头文件,在应用程序中将引用该文件.编写源程序以及定义表定义t_student表,其中id表示学号,name表示学生姓名,age定义表示姓名.进入oracle sqlplus,键入:create table t_student (id number(10), name varchar2(20), age number(3));源程序文件wtc_jolt.pc(该程序通过pro*c文件访问数据库oracle数据库):#include <atmi.h>#include <userlog.h>#include <sqlca.h>#include <fml32.h>#include "student_fld.h"EXEC ORACLE OPTION (RELEASE_CURSOR = YES);#if defined(__STDC__) || defined(__cplusplus)tpsvrinit(int argc, char *argv[])#elsetpsvrinit(argc, argv)int argc;char **argv;#endif{EXEC SQL BEGIN DECLARE SECTION;char sConnStr [100];EXEC SQL END DECLARE SECTION;argc = argc;argv = argv;memset(sConnStr, 0x00, sizeof(sConnStr));strcpy(sConnStr, “数据库连接串”);EXEC SQL Connect :sConnStr;if (sqlca.sqlcode){userlog("连接数据库失败,错误号码:%d,详细原因:%s ", sqlca.sqlcode, sqlca.sqlerrm.sqlerrmc);return -1;}}#ifdef __cplusplusextern "C"#endifvoid#if defined(__STDC__) || defined(__cplusplus) fml32_test(TPSVCINFO *rqst)#elsefml32_test(rqst)TPSVCINFO *rqst;#endif{FBFR32 *recebuf = NULL;FBFR32 *sendbuf = NULL;FLDLEN32 recebuflen = 0;EXEC SQL BEGIN DECLARE SECTION;long lStudentId = 0;char sName[15] = "";long lAge = 0;EXEC SQL END DECLARE SECTION;recebuf = (FBFR32 *)rqst->data;if ((sendbuf = (FBFR32 *)tpalloc("FML32", NULL, 1024)) == NULL){tpterm();exit(-1);}recebuflen=0;Fget32(recebuf, student_id, 0, (char *)&lStudentId, &recebuflen);EXEC SQL Select age, name Into :lAge, :sNameFrom t_studentWhere student_id = :lStudentId;if (sqlca.sqlcode){userlog("查询失败,code=%d,detail=%s ", sqlca.sqlcode, sqlca.sqlerrm.sqlerrmc);exit(-2);}Fchg32(sendbuf, student_age, 0, (char *)&lAge, 0);Fchg32(sendbuf, student_name, 0, sName, 0);tpreturn(TPSUCCESS , 0, (char *)sendbuf, 0, 0);}编写makefile文件.SUFFIXES:.pc .cCC=ccTUXINCLUDE=$(TUXDIR)/includeORAINCLUDE=$(ORACLE_HOME)/precomp/public WORKPATH=$(HOME)/../../...APPPATH=$(HOME)/binTARGET=wtc_joltall: $(TARGET)-@echo "build successfully!"wtc_jolt:wtc_jolt.cbuildserver -f wtc_jolt.o -o wtc_jolt -s "fml32_test" -r Oracle_XA -v.pc.c:proc iname=$<$(PROCPLSFLAGS) oname=$*.c parse=full hold_cursor=no release_cursor=yesinclude=$(TUXINCLUDE) include=$(ORAINCLUDE)$(CC) -I$(ORAINCLUDE) -I$(TUXINCLUDE) -c $(ORACFLAGS) $*.c将例子文件发布成tuxedo server和service.通过makefile将wtc_jolt.pc编译成可执行文件wtc_jolt之后.(一)修改tuxedo ubb配置文件.1)在 *server节点中添加:wtc_jolt SRVGRP=GROUP SRVID=1100其中GROUP是tuxedo应用所在的组, SRVID是该server的标识id,注意不要与其他SRVID重复,wtc_jolt 是刚刚编译生成的可执行文件名字,这样该文件就被发布为tuxedo server.2)在*service节点中添加:fml32_test其中fml32_test是wtc_jolt.pc文件中的函数名字,这样该函数就被发布为属于server:wtc_jolt中的一个tuxedo service.3)编译修改之后的ubb文件:tmloadcf ubb_filename(二)修改tuxedo dm配置文件.1)在*DM_LOCAL_SERVICES节点中添加:fml32_test RNAME="fml32_test"发布fml32_test service,使该service可以被其他域中的服务调用.2)编译修改之后的dm文件:dmloadcf dm_filename以上配置和开发工作完成之后tuxedo方面的工作完成,tmboot ?y启动tuxedo,如有以下提示信息,tuxedo 方面的工作宣告成功.1) exec DMADM -A :process id=28863 ... Started.exec GWADM -A :process id=28864 ... Started.exec GWTDOMAIN -A :process id=28865 ... Started.以上信息说明域间通信进程启动成功!2) exec wtc_jolt -A :process id=28950 ... Started.以上信息说明发布的server进程启动成功!此时键入命令tmadmin, 键入子命令psc, 如有以下提示信,说明发布service成功.Service Name Routine Name Prog Name Grp Name ID Machine # Done Status---------------------------------------------------------------------fml32_test fml32_test wtc_jolt GROUP 1100 simple 0 AVAIL进行到这里tuxedo方面所有的工作已经完成,下面进入weblogic方面的工作.3)Weblogic方面需要进行的工作.创建tuxedo fml(32) 数据缓冲区定义文件对应的java类文件本文例子用到tuxedo fml32数据缓冲区,所以首先要创建该fml32数据缓冲区定义文件对应的java描述文件的类文件,将前面定义的文件student_fld.1)执行weblogic环境变量setWLSEnv.sh,使weblogic环境变量生效.2)运行: java weblogic.wtc.jatmi.mkfldclass32 student_fld生成student_fld.java描述文件.3)运行: javac ?d student_fld.java生成student_fld.class文件.4)该类文件的存放路径一定可以被weblogic识别,即保存在weblogic启动后CLASSPATH的路径中,否则在后面配置wtc resource时会失败.配置weblogic wtc service进入weblgoic console,mydomain->services->wtc->Co nfigure a new WTC service…Name属性键入: WTC_Service,create保存设置,此时WTC_Service将生成local tuxedo access等若干子项,在下面将一步一步配置这些项目.配置local tuxedo accessmydomain->services->wtc-> WTC_Service-> Configure a new local tuxedo access point…依次填写Access Point: Local_Wls_DomainAccess Point ID: weblogicNetwork Address: //weblogicserver_ip:port注意:1)Access Point ID的值应该与在tuxedo dm文件中*DM_REMOTE_DOMAINS节中指定的domainid 相同.2)Network Address中指定的通信端口一定是weblogic server上未被占用的端口.以上信息填写完成后点击create保存.配置remote tuxedo domainmydomain->services->wtc-> WTC_Service-> Configure a new remote tuxedo access point…依次填写Access Point: Remote_Tuxedo_DomainAccess Point ID: billingLocal Access Point: Local_Wls_DomainNetwork Address: //tuxedoserver_ip:port注意:1)Access Point ID的值是远程tuxedo domain 的domain_id.2)Local Access Point的值是上面配置的local tuxedo access point的名字.以上信息填写完成后点击create保存.导入tuxedo servicesmydomain->services->wtc-> WTC_Service->Imported services->Configure a new imported service…Resource Name: fml32_testLocal Access Point: Local_Wls_DomainRemote Access Point List: Remote_Tuxedo_DomainRemote Name: fml32_test注意:1)Local Access Point是上面配置的local tuxedo access point的名字.2)Remote Access Point List是上面配置的remote tuxedo access point的名字.3)Remote Name是可供weblogic调用的远程tuxedo发布的service名字,即在Tuxedo dm文件的*DM_LOCAL_SERVICES节点中发布的service名字.配置wtc resourcemydomain->services->wtc-> WTC_Service->resources->Configure a new Resource….FldTbl32 classes: student_fld注意:1)resource定义fml(32),view(32)等数据缓冲区的类文件定义,其中student_fld就是上面编译得到的类,如果源文件包含在包中那么要标明包名称在内的全路径,如:com.bea.wtc.test.classname2)其中fml和fml32类型的java类在这里要分别指定,不能通用,view(32)也是一样.以上信息填写完成后点击create保存,至此wtc service全部配置完成,单击wtc_service的Target and deploy标签,选择server,apply以上应用.编写通过wls访问tuxedo service的程序为了减少篇幅例子代码没有全部罗列,只选择粘贴了代码中的关键部分.编写访问tuxedo service的ejb关键函数介绍创建本地接口文件,远程接口文件以及bean文件,公布以下远程方法:1)public CallDescriptor Tpacall(String service, TypedFML32 in_params)throws TPException, TPReplyException, RemoteException;2)public TypedFML32 Tpgetrply(CallDescriptor cd)throws TPException, TPReplyException, RemoteException;3)public TypedFML32 Tpcall(String service_name, TypedFML32 in_params)throws TPException, TPReplyException, RemoteException;Tpcall : 同步调用tuxedo service.Tpacall : 异步调用tuxedo service.Tpgetrply: 等待异步调用service的返回结果.关键函数代码import weblogic.wtc.jatmi.Reply;import weblogic.wtc.jatmi.TypedFML32;import weblogic.wtc.jatmi.TPException;import weblogic.wtc.jatmi.TPReplyException;import weblogic.wtc.gwt.TuxedoConnection;import weblogic.wtc.gwt.TuxedoConnectionFactory;import weblogic.wtc.jatmi.Ferror;import weblogic.wtc.jatmi.CallDescriptor;import weblogic.wtc.jatmi.ApplicationToMonitorInterface;private TuxedoConnection tuxConn = null;函数setUpConnectionpublic TuxedoConnection setUpConnection() throws TPException{Context ctx = null;TuxedoConnectionFactory tcf = null;try{ctx = new InitialContext();tcf= (TuxedoConnectionFactory)ctx.lookup(TUXEDOCONN_JNDI_NAME);}catch (NamingException ne){throw new TPException(TPException.TPENOENT, "Could not get TuxedoConnectionFactory : " + ne);}try{tuxConn = tcf.getTuxedoConnection();}catch (TPException e){throw new TPException(TPException.TPENOENT, "getTuxedoConnection threw exception: " + e);}return tuxConn;}函数Tpcallpublic TypedFML32 Tpcall(String service_name, TypedFML32 in_params) throws TPException, TPReplyException{Reply tuxReply = null;TypedFML32 tuxRtn = null;try{if (tuxConn == null) tuxConn = this.setUpConnection();}catch (TPException e){System.out.println("setUpConnection throw exception:" + e); throw e;}try{tuxReply = tuxConn.tpcall(service_name, in_params, 0);}catch (TPReplyException tre){System.out.println("tpcall threw TPReplyExcption " + tre); throw tre;}catch (TPException te){System.out.println("tpcall threw TPException " + te);throw te;}catch (Exception ee){System.out.println("tpcall threw exception: " + ee);throw new TPException(TPException.TPESYSTEM, "Exception: " + ee);}tuxRtn = (TypedFML32)tuxReply.getReplyBuffer();return tuxRtn;}函数Tpacallpublic CallDescriptor Tpacall(String service_name, TypedFML32 in_params) throws TPException, TPReplyException{CallDescriptor tuxRtn = null;try{tuxConn = this.setUpConnection();}catch (TPException e){System.out.println("setUpConnection throw exception:" + e);throw e;}try{tuxRtn=tuxConn.tpacall(service_name,in_params, ApplicationToMonitorInterface.TPNOTIME);}catch (TPReplyException tre){System.out.println("tpacall threw TPReplyExcption " + tre);throw tre;}catch (TPException te){System.out.println("tpacall threw TPException " + te);throw te;}catch (Exception ee){System.out.println("tpacall threw exception: " + ee);throw new TPException(TPException.TPESYSTEM, "Exception: " + ee);}return tuxRtn;}函数Tpgetrplypublic TypedFML32 Tpgetrply(CallDescriptor cd) throws TPException, TPReplyException {Reply tuxRtn = null;TypedFML32 result = null;tryif (tuxConn == null) tuxConn = this.setUpConnection();}catch (TPException e){System.out.println("setUpConnection throw exception:" + e);throw e;}try{tuxRtn = tuxConn.tpgetrply(cd, ApplicationToMonitorInterface.TPNOTIME); }catch (TPReplyException tre){System.out.println("tpgetrply threw TPReplyExcption " + tre);throw tre;}tryresult = (TypedFML32)tuxRtn.getReplyBuffer();}catch (Exception e){System.out.println("getReplyBuffer threw exception: " + e);result = null;}tuxConn.tpterm();return result;}关于避免调用超时有时Tuxedo service需要做时间较长的处理,超过了tuxedo默认的调用超时时间,为了避免超时需要使客户端一直阻塞知道服务器端service返回结果;在传统tuxedo的c语言程序客户端可以指定tp(a)call函数的第6个参数flag为TPNOTIME,此时客户端如果有阻塞条件存在,客户端会一直阻塞即使超时也不返回;但通过weblogic的java客户端如果想要达到这个目的,如果采用异步tpacall 调用,不仅仅要在tpacall中指定flag值为ApplicationToMonitorInterface.TPNOTIME,在tpgetrply等待结果时也同样需要指定第2个参数为ApplicationToMonitorInterface.TPNOTIME,否则仅在tpacall中指定不能达到避免超时的目的.编写ejb客户端关键函数介绍:Public int selectService ();连接weblogic server,调用具体的函数调用tuxedo service.Public int callTestService(String service_name);根据输入参数学号,调用tuxedo service,获得返回结果学生姓名和年龄. 关键函数代码函数selectServiceimport weblogic.wtc.jatmi.Ferror;import weblogic.wtc.jatmi.TypedFML32;import weblogic.wtc.jatmi.CallDescriptor;Public int selectService (){try{…连接weblogic server…………obj = ctx.lookup(ejb的jndiname);}catch (Exception e)…………………}wtcHome=(WtcInstanceHome)javax.rmi.PortableRemoteObject.narrow(obj, WtcInstanceHome.class); try{wtcRemote = wtcHome.create();}catch (Exception e){………….}callTestService(service_name);try{wtcRemote.remove();}catch (Exception e)………………}}函数callTestServicepublic String callTestService (String service_name){CallDescriptor tuxRtn = null;TypedFML32 inParams = null, tuxResult = null;try{//创建fml32缓冲区java描述类的实例inParams = new TypedFML32(new student_fld());//填写输入参数:学号inParams.Fchg(student_fld.student_id , 0, getStudentId());}catch (Ferror e){……}try{ //异步调用tuxedo service.tuxRtn = wtcRemote.Tpacall(service_name, inParams); }catch (Exception e){………}try{ //等待异步调用的service返回结果.tuxResult = wtcRemote.Tpgetrply(tuxRtn);}catch (Exception e){………}try{//得到学生的姓名和年龄…stuName = (String)tuxResult.Fget(student_fld.student_name, 0); stuAge = (Integer) tuxResult.Fget(student_fld.student_age, 0);}catch (Ferror e){………}………}。

BEA WebLogic Server Tuxedo Connector版本6.1文档说明书

BEA WebLogic Server Tuxedo Connector版本6.1文档说明书

BEA WebLogic Server WebLogic Tuxedo ConnectorQuick Start GuideB E A W e b L o g i c S e r v e r V e r s i o n 6.1D o c u m e n t D a t e:A p r i l24,2003Copyright © 2002BEA Systems, Inc. All Rights Reserved.Restricted Rights LegendThis software and documentation is subject to and made available only pursuant to the terms of the BEA Systems License Agreement and may be used or copied only in accordance with the terms of that agreement. It is against the law to copy the software except as specifically allowed in the agreement. This document may not, in whole or in part, be copied photocopied, reproduced, translated, or reduced to any electronic medium or machine readable form without prior consent, in writing, from BEA Systems, Inc.Use, duplication or disclosure by the U.S. Government is subject to restrictions set forth in the BEA Systems License Agreement and in subparagraph (c)(1) of the Commercial Computer Software-Restricted Rights Clause at FAR 52.227-19; subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013, subparagraph (d) of the Commercial Computer Software--Licensing clause at NASA FAR supplement 16-52.227-86; or their equivalent.Information in this document is subject to change without notice and does not represent a commitment on the part of BEA Systems. THE SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. FURTHER, BEA Systems DOES NOT WARRANT, GUARANTEE, OR MAKE ANY REPRESENTATIONS REGARDING THE USE, OR THE RESULTS OF THE USE, OF THE SOFTWARE OR WRITTEN MATERIAL IN TERMS OF CORRECTNESS, ACCURACY, RELIABILITY, OR OTHERWISE.Trademarks or Service MarksBEA, Jolt, Tuxedo, and WebLogic are registered trademarks of BEA Systems, Inc. BEA Builder, BEA Campaign Manager for WebLogic, BEA eLink, BEA Manager, BEA WebLogic Collaborate, BEA WebLogic Commerce Server, BEA WebLogic E-Business Platform, BEA WebLogic Enterprise, BEA WebLogic Integration, BEA WebLogic Personalization Server, BEA WebLogic Process Integrator, BEA WebLogic Server, E-Business Control Center, How Business Becomes E-Business, Liquid Data, Operating System for the Internet, and Portal FrameWork are trademarks of BEA Systems, Inc.All other trademarks are the property of their respective companies.WebLogic Tuxedo Conector Quick Start GuideDocument Date Software VersionJune 24, 2002BEA WebLogic Server 6.11WebLogic TuxedoConnector Quick StartGuideWebLogic Tuxedo Connector enables interoperation between WebLogic Serverapplications and Tuxedo services. These instructions provide the main steps forconfiguring the WebLogic Tuxedo Connector to allow WebLogic Server Release 6.1to interoperate with Tuxedo Releases 6.5 and higher.Note:For more detailed information on how to configure the WebLogic TuxedoConnector in WebLogic Server Release 6.1, see the WebLogic TuxedoConnector Programmer’s Guide at/wls/docs61/wtc_admin/index.html. Configuring the WebLogic Tuxedo Connector This section summarizes how to configure the WebLogic Tuxedo Connector on anNT/2000 platform.Note:UNIX users: Make appropriate substitutions such as replacing the ‘\’ with ‘/’1.Create a WebLogic Tuxedo Connector XML configuration file by copying abdmconfig.xml file from one of the WebLogic Tuxedo Connector examplesincluded in the WebLogic Server Release 6.1 distribution.WebLogic Tuxedo Connector Quick Start Guide11WebLogic Tuxedo Connector Quick Start GuideCopy .\examples\simpapp\bdmconfig.xml to.\config\mydomain\your_configuration_file.xml.2.Edit the bdmconfig.xml file to match your application environments,including updating the NWADDR. Tuxedo 6.5 users add an Interoperate elementand set the element to Yes.3.Save the changes to your_configuration_file.xml file.4.Validate the XML configuration file:> java weblogic.wtc.gwt.WTCValidateCF your_XML_configuration_file5.Update the domain environment:> .\config\mydomain\setEnv.cmd6.Start the default server:> .\config\mydomain\startWebLogic.cmd7.Start the WebLogic Server Console.8.If necessary, right-click on the domain root and select Create or edit otherdomains. Left-click to select mydomain from the repository.9.Left-click and expand the Deployments branch.10.Right-click the Startup & Shutdown branch.11.Select Create a new Startup Class . . .The Configuration tab is active.12.Enter the Name.Example: MyWTCStartup Class13.Enter weblogic.wtc.gwt.WTCStartup for the Classname.14.Enter the Arguments. If more than one argument is used, separate them using acomma. Valid arguments include:BDMCONFIG: This required argument specifies the location of the WebLogicTuxedo Connector XML configuration file.Example: BDMCONFIG=.\config\mydomain\wtc_config.xmll TraceLevel: This optional argument specifies the level of error tracing used. 2WebLogic Tuxedo Connector Quick Start GuideConfiguring the WebLogic Tuxedo Connector Example:BDMCONFIG=.\config\mydomain\wtc_config.xml,TraceLevel=10000015.Check Abort startup on failure.16.Click Create.17.Select the Target tab.18.From the Available servers list, click myserver.myserver is highlighted.19.Click the right-arrow.myserver appears in the Chosen servers list.20.Click Apply.21.Right-click the Startup & Shutdown branch.22.Select Create a new Shutdown Class . . .23.Enter the Name.Example: MyWTCShutdown Class24.Enter weblogic.wtc.gwt.WTCShutdown for the Classname.25.Click Create.26.Restart WebLogic Server.WebLogic Tuxedo Connector is now installed on myserver.WebLogic Tuxedo Connector Quick Start Guide31WebLogic Tuxedo Connector Quick Start Guide 4WebLogic Tuxedo Connector Quick Start Guide。

配置WebLogic Tuxedo Connector

配置WebLogic Tuxedo Connector

文档说明:摘自iteye taiyuan的博客/blog/37296配置WebLogic Tuxedo Connector (转)∙博客分类:∙tuxedoWeblogic配置管理应用服务器编程全文检索WebLogic Tuxedo Connector (WTC) 是一个兼容JCA (J2EE 连接器架构)的软件组件,它提供Tuxedo 服务和WebLogic Server 部署的企业应用程序之间的互操作性。

WebLogic Server 组件能够使用WTC 与Tuxedo 服务进行通信,Tuxedo 服务也能够调交互用基于WebLogic Server 的EJB 。

手动配置WebLogic Tuxedo Connector 是非常沉闷乏味且易于出错的操作,从这种观点出发,本文提出了两种编程式可选解决方案。

第一种基于JMX ,第二种基于对命令行方式的weblogic.Admin 工具的使用。

本文提供了Java 类库,既能生成所需的JMX 对象又能生成基于weblogic.Admin 的shell 文件。

Tuxedo 服务已经存在多年了,而且很多EIS (企业信息系统)就是以这种服务功能为基础,比如事务支持、域和ACL (访问控制列表)安全、域级别故障转移和反馈、以及高级消息服务。

另一方面,J2EE 应用程序不能保持与现有的信息系统隔离;它们必须能够支持Tuxedo 事务,在CORBA Java 和CORBA C++ 之间进行互操作,同时也要能够在Java RMI/IIOP 和Tuxedo CORBA 之间互操作。

WTC 实现了所有这些方案和一些其他可能类似JATMI (Java 应用程序到事务监控器接口)的实现方案,其中JATMI 是一种与Tuxedo ATMI 类似的协议。

WTC 实现了所有这些方案和一些其他可能类似JATMI (Java 应用程序到事务监控器接口)的实现方案,其中JATMI 是一种与Tuxedo ATMI 类似的协议。

Tuxedo8.1与Weblogic之间调用环境配置

Tuxedo8.1与Weblogic之间调用环境配置

Tuxedo8.1与Weblogic之间调用环境配置使用手册目录1.引言 (2)2.环境准备 (2)3.Tuxedo安装与weblogic之间的环境配置 (2)3.1.Tuxedo安装 (2)3.2.Tuxedo配置 (5)3.2.1 环境变量的配置 (5)3.2.2 配置Ubbsimple文件 (6)3.2.3 配置domconfig文件 (8)3.2.4 编译配置文件并启动tuxedo (9)3.3.Weblogic WTC的配置 (10)3.3.1 创建WTC服务 (10)3.3.2 创建本地Tuxedo访问点 (10)3.3.3 创建远程Tuxedo访问点 (11)3.3.4 创建已导出的服务 (12)3.3.5 创建已导入的服务 (13)3.3.6 将mySimpapp指向adminServer (14)3.3.7 将CEBDB注册为WebLogic用户 (14)4.名词解释 (15)5.附1:tuxedo在AIX上环境变量的设置 (16)1.引言WTC调用方式:WebLogic Tuxedo Connector 提供WebLogic Server 应用程序和Tuxedo 服务之间的互操作性。

该连接器允许WebLogic Server 客户端调用Tuxedo 服务,并允许Tuxedo 客户端调用WebLogic Server Enterprise Java Bean (EJB) 来响应服务请求。

预期读者包括:测试人员、开发人员等。

2.环境准备Tuxedo版本:8.1操作系统Window 2003 serverWeblogic 11.0操作系统suse 11 sp23.Tuxedo安装与weblogic之间的环境配置3.1.Tuxedo安装步骤1:安装方式选择Full Install (完全安装)。

步骤2:选择BEA Home目录BEA Home目录是所有BEA产品的安装目录,如果已经有了BEA Home,选择即可,如果还没有,则可以创建一个。

2024年度TUXEDO培训教材讲述

2024年度TUXEDO培训教材讲述

22
2024/3/23
消息传递方式
消息可以通过点对点(Point-to-Point)或发布/订阅(Publish/Subscribe)方式进行传递。点对点方式中,消息被发送到一个特定的队列,等待一个消费者来接收;发布/订阅方式中,消息被发送到一个主题(Topic),多个消费者可以订阅该主题并接收消息。
服务调用机制
详细介绍TUXEDO中的异常处理机制,包括异常的分类、捕获、处理以及日志记录等。
异常处理机制
通过具体的编程示例,展示如何在TUXEDO应用中进行服务调用和异常处理,包括服务的注册、调用、异常捕获以及错误处理等。
编程示例
20
2024/3/23
04
CHAPTER
消息队列与通信机制解析
21
2024/3/23
按照安装向导的提示,逐步完成TUXEDO软件的安装,包括选择安装目录、设置环境变量等。
03
02
01
14
2024/3/23
编辑TUXEDO的配置文件(如ubbconfig文件),设置服务器参数,如服务名、监听端口、数据库连接信息等。
配置文件
详细解释每个参数的含义和作用,以及如何根据实际情况进行配置。
TUXEDO支持水平扩展和垂直扩展,可根据业务需求灵活调整系统规模。
可扩展性
TUXEDO支持多种操作系统和编程语言,方便企业构建跨平台应用。
跨平台支持
8
2024/3/23
金融行业
用于构建高性能、高可靠性的金融交易系统,如支付、结算、清算等。
电信行业
用于构建大规模、高并发的电信业务系统,如计费、营销、客服等。
发展历程
TUXEDO最初由BEA Systems公司开发,后被Oracle公司收购并成为其融合中间件的重要组成部分。经过多个版本的迭代升级,TUXEDO不断完善和扩展其功能,成为企业级分布式应用的首选解决方案。

Tuxedo与Weblogic互连指南

Tuxedo与Weblogic互连指南

Tuxedo与Weblogic互连指南前言Tuxedo与Weblogic的互连可以通过Weblogic的WTC(WebLogic Tuxedo Connection)实现。

WTC不仅能实现Weblogic调用Tuxedo的服务,还能实现Tuxedo 调用Weblogic的EJB服务。

在具体配置实现中易错点较多,建议在首次配置过程中使用与生产环境业务无关的程序尝试,如Tuxedo的示例程序simpapp。

示例环境1.Weblogic 10.3.6安装在Windows8.1中,IP为192.168.43.12.Tuxedo 8.1安装在XP虚拟机中,IP为192.168.43.128,安装目录为C:\bea\tuxedo8.1Tuxedo 8.1在Windows 7或Windows 8中安装易出错,Tuxedo 11g则可以。

其他版本未尝试。

3.VC 6.0安装在XP虚拟机中,用于编译simpapp程序4.示例程序使用Tuxedo自带的simpapp,位于tuxedo8.1\samples\atmi目录下,功能是实现小写字母转大写。

为了方便调试将simpapp文件夹复制到C:\simpapp实现步骤Tuxedo部分目标能正确编译ubb和dom配置文件,能成功启动Tuxedo服务,并实现小写字母转大写的服务调用步骤1.配置setenv命令:setenv2.配置ubbsimple并编译命令:tmloadcf –y ubbsimple3.配置domsimple并编译,示例simpapp没有自带dom文件命令:dmloadcf –y domsimple4.编译simpcl.c客户端,用于调用Tuxedo服务命令:buildclient -o simpcl -f simpcl.c5.编译simpserv.c服务端,实现小写字母转大写的功能命令:buildserver -o simpserv -f simpserv.c -s TOUPPERsimpcl和simpserv是C++所编写,执行buildclient和buildserver编译命令时,先确认系统有VC6.0的C++的编译环境,否则会提示没有cl指令。

Weblogic和Tuxedo

Weblogic和Tuxedo

adapter_jrepository文件存放导出服务名和相应的通讯报文描述
连接池方式使用TCP长连接,存在启动依 赖;
在请求不是很频繁的情况下,可采用短连 接
配置WTC服务器
本地AP 远程AP 导出服务 导入服务
部署
选择WTC服务部署的目标服务器 重启生效
配置安全用户
连接方式:启动时、按需,一般选择“启动时”
交易服务器
JOLT
• java 程序作为客户端访问 tuxedo服务
WTC
• 双向的访问
启动关闭类
建立连接池
部署
最小和最大连接数、超时时间
主服务地址和failover地址
JSL 侦听端口配置
服务容器配置
JSL SRVGRP=TRAN0 SRVID200 CLOPT=“-A –t -- -n //128.192.135.14:5005 –m 40 –M 80 –x 10 –T 1200 –K both RESTART=Y
2015/03/02
网银等前端系统 Weblogic
ECTIP后台 Weblogic
ECT务器
交易服务器 ECTIP文件服务器 Tuxedo应用
交易服务器
交易服务器
后端系统1 (Tuxedo)
交易服务器
ECTIP通讯服务器 (tuxedo) 后端系统n (Tuxedo)
}
<!-- 生成标准EJBJar包,包括XML部署描述符--> <jar jarfile="${build.deploy}/${WTC_EJB_JAR}${version.no}.jar" basedir="${build.tmp}" update="yes"/> <!--生成EJB中的容器类--> <java classname="weblogic.appc" fork="true"> <arg value="${build.deploy}/${WTC_EJB_JAR}${version.no}.jar"/> <classpath refid="classpath"/> </java>
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

一、WTC配置步骤:1. Tuxedo的配置2.1.1. 设置环境变量:2.1.3. 配置ubbconfigMASTER simpleMAXACCESSERS 50MAXSERVERS 50MAXSERVICES 50MODEL SHMLDBAL N*MACHINESDEFAULT:APPDIR="c:\tuxedo_test\simpapp"TUXCONFIG="c:\tuxedo_test\simpapp\tuxconfig"TUXDIR="c:\bea\tuxedo8.1"#Example:# APPDIR="/home/me/simpapp"# TUXCONFIG="/home/me/simpapp/tuxconfig"# TUXDIR="/usr/tuxedo"VM44 LMID=simpleMAXWSCLIENTS=5 #指定的最大客户端连接数#Example:#beatux LMID=simple*GROUPSGROUP1 LMID=simple GRPNO=1 OPENINFO=NONEJSLGRP LMID=simple GRPNO = 2JREPGRP LMID=simple GRPNO = 3GROUP4 LMID=simple GRPNO=4 OPENINFO=NONE*SERVERSDEFAULT:CLOPT="-A"simpserv SRVGRP=GROUP1 SRVID=1WSL SRVGRP=GROUP1 SRVID=5 CLOPT="-A -t -- -n //192.168.57.41:8888 -m 2 -M 5 -x 10" #WSL发布地址JREPSVR SRVGRP=JREPGRP SRVID=10 CLOPT="-A -- -W -PC:\bea\tuxedo8.1\udataobj\jolt\repository\jrepository"红色为jolt服务需要的配置,jolt需要单独的license。

蓝色为wtc服务需要的配置。

2.1.4. 编译ubbconfig文件tmloadcf -y ubbconfig2.1.5. 配置domconfig红色为tuxedo为接入的weblogic的IP地址。

(因此对于新接入的weblogic,tuxedo需要增加配置)。

2.1.6. 编译domconfigdmloadcf -y domconfig2. Weblogic配置(9.2为例)2.1.7. 配置config.xml<wtc-server><name>MyWTCServer</name><target>examplesServer</target><wtc-local-tux-dom><name>LocalAP-n0</name><access-point>TDOM2</access-point><access-point-id>TDOM2</access-point-id><nw-addr>//192.168.57.41:9999</nw-addr></wtc-local-tux-dom><wtc-remote-tux-dom><name>RemoteAP-n0</name><access-point>TDOM1</access-point><access-point-id>TDOM1</access-point-id><local-access-point>TDOM2</local-access-point><nw-addr>//192.168.57.41:9998</nw-addr><federation-url></federation-url><federation-name></federation-name></wtc-remote-tux-dom><wtc-import><name>WTCImportedService-0</name><resource-name>TOUPPER</resource-name><local-access-point>TDOM2</local-access-point><remote-access-point-list>TDOM1</remote-access-point-list><remote-name>TOUPPER</remote-name></wtc-import><wtc-tbridge-global xsi:nil="true"></wtc-tbridge-global></wtc-server>或通过控制台进行配置:新增一个WTC Server配置WTC Server(红框中的是需要配置的)配置Local AP(IP和端口为weblogic的IP和端口,Name和ID最好设置成一样的)配置Remote AP(IP和端口为Tuxedo的IP和端口,并制定一个Local AP)配置Import(resources和remote name最好一致,并等于tuxedo中配置的)配置好了之后可以看到WTC Server的control中已经有connection和service 了。

并且在context的jndi tree中可以看到tuxedo.services.TuxedoConnection。

3. Weblogic做客户端,访问Tuxedo服务(一个jsp)<%@ page import="weblogic.wtc.jatmi.*,weblogic.wtc.gwt.*, javax.naming.*,java.sql.*" %>hello<%String inStr = "hello,hello";String outStr = "";try{//调用接口服务Context ctx = new InitialContext();TuxedoConnectionFactory cdmaTuxedoFactory = (TuxedoConnectionFactory)ctx.lookup("tuxedo.services.TuxedoConnection");TuxedoConnection cdmaTuxedo =cdmaTuxedoFactory.getTuxedoConnection();TypedString cdmaData = new TypedString(inStr);Reply cdmaRtn = cdmaTuxedo.tpcall("TOUPPER", cdmaData, 0); cdmaData = (TypedString) cdmaRtn.getReplyBuffer();outStr = cdmaData.toString();cdmaTuxedo.tpterm();out.println("out = "+outStr);}catch(Exception e){outStr = e.getMessage();e.printStackTrace();//out.println("<!--");StringWriter sw = new StringWriter();PrintWriter pw = new PrintWriter(sw);e.printStackTrace(pw);out.print(sw);sw.close();pw.close();//out.println("-->");}%>上面jsp执行结果为:以上为在weblogic 9.2上的配置过程,在weblogic 8.1上也可以配置wtc。

Weblogic 8.1中的config.xml相关部分如下:<WTCServer Name="MyWTC Service" Targets="examplesServer"><WTCRemoteTuxDom AccessPoint="TDOM1" AccessPointId="TDOM1" LocalAccessPoint="TDOM2" NWAddr="//192.168.57.41:9998" Name="WTCRemoteTuxDom-1256118443265"/><WTCImport LocalAccessPoint="TDOM2"Name="WTCImport-1256118583093"RemoteAccessPointList="TDOM1"RemoteName="TOUPPER" ResourceName="TOUPPER"/><WTCLocalTuxDom AccessPoint="TDOM2" AccessPointId="TDOM2"如果出现错误,可以同时检查weblogic日志和tuxedo日志,看错误原因。

二、添加一个jolt服务(需要jolt liccense)1. Tuxedo的配置下载支持jolt的licence。

/downloads/LIC-TUX81-SDK-56B_With-Jolt. zip下载后解压,将文件名改为lic.txt,然后拷贝到TUXEDO_HOME\udataobj 目录下面就可以了。

我的TUXEDO_HOME是C:\bea\tuxedo8.1。

相关文档
最新文档