一、WTC配置步骤: 1. Tuxedo的配置 2.1.1. 设置环境变量: rem (c) 2003 BEA Systems, Inc. All Rights Reserved. rem Copyright (c) 2000 BEA Systems, Inc. rem All Rights Reserved rem THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF rem BEA Systems, Inc. rem The copyright notice above does not evidence any rem actual or intended publication of such source code. rem Copyright (c) 2000 BEA Systems, Inc. rem All rights reserved rem ident "@(#) apps/simpapp/setenv.cmd $Revision: 1.5 $" set TUXDIR=c:/bea/tuxedo8.1 set WSNADDR=//192.168.57.41:8888 set APPDIR=c:/tuxedo_test/simpapp set PATH=%TUXDIR%/bin;%APPDIR%;%PATH% set TUXCONFIG=%APPDIR%/tuxconfig set BDMCONFIG=%APPDIR%/bdmconfig 2.1.3. 配置ubbconfig # (c) 2003 BEA Systems, Inc. All Rights Reserved. #ident "@(#) samples/atmi/simpapp/ubbsimple $Revision: 1.5 $" #Skeleton UBBCONFIG file for the TUXEDO Simple Application. #Replace the items with the appropriate values. *RESOURCES IPCKEY 123456 #Example: #IPCKEY 123456 DOMAINID simpapp MASTER simple MAXACCESSERS 50 MAXSERVERS 50 MAXSERVICES 50 MODEL SHM LDBAL N *MACHINES DEFAULT: 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=simple MAXWSCLIENTS=5 #指定的最大客户端连接数 #Example: #beatux LMID=simple *GROUPS GROUP1 LMID=simple GRPNO=1 OPENINFO=NONE JSLGRP LMID=simple GRPNO = 2 JREPGRP LMID=simple GRPNO = 3 GROUP4 LMID=simple GRPNO=4 OPENINFO=NONE *SERVERS DEFAULT: CLOPT="-A" simpserv SRVGRP=GROUP1 SRVID=1 WSL 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 -P C:/bea/tuxedo8.1/udataobj/jolt/repository/jrepository" JSL SRVGRP=JSLGRP SRVID=15 CLOPT="-A -- -n //192.168.57.41:7777 -M 5 -x 10 -m 2" DMADM SRVGRP=GROUP4 SRVID=20 GWADM SRVGRP=GROUP4 SRVID=30 GWTDOMAIN SRVGRP=GROUP4 SRVID=40 *SERVICES TOUPPER 红色为jolt服务需要的配置,jolt需要单独的license。 蓝色为wtc服务需要的配置。 2.1.4. 编译ubbconfig文件 tmloadcf -y ubbconfig 2.1.5. 配置domconfig *DM_RESOURCES VERSION=U22 *DM_LOCAL_DOMAINS TDOM1 GWGRP=GROUP4 TYPE=TDOMAIN DOMAINID="TDOM1" BLOCKTIME=20 MAXDATALEN=56 MAXRDOM=89 DMTLOGDEV="c:/tuxedo_test/simpapp/TLOG" AUDITLOG="c:/tuxedo_test/simpapp/AUDITLOG" DMTLOGNAME="DMTLOG_TUXDOM" *DM_REMOTE_DOMAINS TDOM2 TYPE=TDOMAIN DOMAINID="TDOM2" *DM_TDOMAIN TDOM1 NWADDR="//192.168.57.41:9998" TDOM2 NWADDR="//192.168.57.41:9999" *DM_REMOTE_SERVICES TOLOWER RDOM="TDOM2" *DM_LOCAL_SERVICES TOUPPER RNAME="TOUPPER" 红色为tuxedo为接入的weblogic的IP地址。(因此对于新接入的weblogic,tuxedo需要增加配置)。 2.1.6. 编译domconfig dmloadcf -y domconfig 2. Weblogic配置(9.2为例) 2.1.7. 配置config.xml MyWTCServer examplesServer LocalAP-n0 TDOM2 TDOM2 //192.168.57.41:9999 RemoteAP-n0 TDOM1 TDOM1 TDOM2 //192.168.57.41:9998 WTCImportedService-0 TOUPPER TDOM2 TDOM1 TOUPPER 或通过控制台进行配置: 新增一个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(" "); } %> 上面jsp执行结果为: 以上为在weblogic 9.2上的配置过程,在weblogic 8.1上也可以配置wtc。 Weblogic 8.1中的config.xml相关部分如下: 如果出现错误,可以同时检查weblogic日志和tuxedo日志,看错误原因。
WTC配置步骤
最新推荐文章于 2021-02-24 13:41:32 发布