1、安装Microsoft Visual C++ 6.0 简体中文企业版,安装完成时选择添加环境变量。我的电脑——属性——高级——环境变量,可以看到已经有C:\Program Files\Microsoft Visual Studio\VC98\bin等变量信息。
2、将lic.txt放在C:\bea\tuxedo8.1下,然后使用bealic将lic.txt文件放到C:\bea\tuxedo8.1\udataobj下,下面的lic.txt我是从官方网站下载的。
[BEA JOLT]
DEVELOPERS=1000000
LICENSEE=Customer
SERIAL=454493271161-2664947729544
TYPE=SDK
USERS=1000000
VERSION=8.1
SIGNATURE=MC0CFA05ssv2fYfhJhAualf4eGzh6rfdAhUAz529Ucna102HFlbm3/k5FQZ01wU=
[BEA TUXEDO]
DEVELOPERS=1000000
LICENSEE=Customer
SERIAL=454493271161-2664947729544
TYPE=SDK
USERS=1000000
VERSION=8.1
SIGNATURE=MCwCFBdTc8UBbmQzQX3Cso5mJSX2H3CTAhRZe7fsIJ27H0YpTZHxJaAPzVz5wQ==
[LINK ENCRYPTION]
DEVELOPERS=1000000
LICENSEE=Customer
SERIAL=454493271161-2664947729544
STRENGTH=128
TYPE=SDK
USERS=1000000
VERSION=8.1
SIGNATURE=MCwCFAdzWrwSCma+O/cj7Myh3dVqPYqSAhR5ta/3tVX6NrKKw5i2gW+YtLtiCQ==
[PK ENCRYPTION]
DEVELOPERS=1000000
LICENSEE=Customer
SERIAL=454493271161-2664947729544
STRENGTH=128
TYPE=SDK
USERS=1000000
VERSION=8.1
SIGNATURE=MCwCFDcGB9krLDTEAh0tvm3IZ44yGdXMAhRjCW7AgyLpb5Xk5ABBJs1B7iBK4Q==
[PK SIGNATURE]
DEVELOPERS=1000000
LICENSEE=Customer
SERIAL=454493271161-2664947729544
STRENGTH=128
TYPE=SDK
USERS=1000000
VERSION=8.1
SIGNATURE=MCwCFCaWNsKF1J9Jw6+Vqz3TxulZ8AuqAhQ0esTq5Ztz+laOzDoP9XWPXxky7w==
[SNMP]
DEVELOPERS=1000000
LICENSEE=Customer
SERIAL=454493271161-2664947729544
TYPE=SDK
USERS=1000000
VERSION=8.1
SIGNATURE=MC0CFQCBo+QhoBAKOixx0WIS7fSJGDY1PwIUGqLcfXS0xjBMAfWCkolvAcD96+Y=
[SSL ENCRYPTION]
DEVELOPERS=1000000
LICENSEE=Customer
SERIAL=454493271161-2664947729544
STRENGTH=128
TYPE=SDK
USERS=1000000
VERSION=8.1
SIGNATURE=MC4CFQCyX6CBxcgasIwTEILXihBAxSV5yAIVANnxZhhxasRhFBeK3x0lLzHxZFAV
3、配置环境变量
(1)
其中:Administrator的用户变量
lib添加C:\bea\tuxedo8.1\lib
include添加C:\bea\tuxedo8.1\include
PATH添加C:\bea\tuxedo8.1\bin
添加LD_LIBARARY_PATH=%TUXDIR%\lib
其中:系统变量
path=%TUXDIR%\bin;%PATH%
添加下面两个新项
TUXDIR C:\bea\tuxedo8.1(默认就有,没有就新建)
WSNADDR //本机IP:4050 Tuxedo服务器IP与端口
根据应用程序实际情况添加,我用的是Tuxedo 8.1自带的例子(C:\bea\tuxedo8.1\samples\atmi\simpapp)
APPDIR C:\bea\tuxedo8.1\samples\atmi\simpapp
TUXCONFIG C:\bea\tuxedo8.1\samples\atmi\simpapp\tuxconfig
(2)直接修改C:\bea\tuxedo8.1\samples\atmi\simpapp下的setenv.cmd,通过运行setenv.cmd设置环境变量
set TUXDIR=C:\bea\tuxedo8.1
set WSNADDR=//10.0.0.31:8888
set APPDIR=C:\bea\tuxedo8.1\apps
set PATH=%TUXDIR%\bin;%APPDIR%;%PATH%
set TUXCONFIG=%APPDIR%\tuxconfig
4、修改ubbsimple
cmd命令提示符获取计算机名
C:\bea\tuxedo8.1\samples\atmi\simpapp>hostname
root
下面是我修改后的ubbsimple文件内容,其中注意计算机名root改为大写ROOT,对于计算机名带有.等字符需要用双引号:
# (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 <bracketed> items with the appropriate values.
*RESOURCES
IPCKEY 123456
DOMAINID simpapp
MASTER simple
MAXACCESSERS 200
MAXSERVERS 50
MAXSERVICES 200
MODEL SHM
LDBAL N
*MACHINES
DEFAULT:
APPDIR="C:\bea\tuxedo8.1\samples\atmi\simpapp"
TUXCONFIG="C:\bea\tuxedo8.1\samples\atmi\simpapp\tuxconfig"
TUXDIR="C:\bea\tuxedo8.1"
ROOT LMID=simple
MAXWSCLIENTS=10
*GROUPS
GROUP1
LMID=simple GRPNO=1 OPENINFO=NONE
*SERVERS
DEFAULT:
CLOPT="-A"
simpserv SRVGRP=GROUP1 SRVID=1 RESTART=Y MAXGEN=5 GRACE=3600
MIN=3 MAX=10
RQADDR=simpQ REPLYQ=Y
CLOPT="-s TOUPPER -s TOLOWER -r -p 2,1:5,3"
*SERVICES
TOUPPER
TOLOWER
5、开始——运行——cmd:
C:\Documents and Settings\Administrator>cd C:\bea\tuxedo8.1\samples\atmi\simpapp
C:\bea\tuxedo8.1\samples\atmi\simpapp>tmloadcf ubbsimple
CMDTUX_CAT:866: ERROR: tmloadcf: Severe error found. Stop syntax checking.
C:\bea\tuxedo8.1\samples\atmi\simpapp>buildclient -o simpcl -f simpcl.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
simpcl.c
Microsoft (R) Incremental Linker Version 6.00.8168
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
/out:simpcl.exe
-implib:BC-f18.lib
simpcl.obj
C:\bea\tuxedo8.1\lib\libtux.lib
C:\bea\tuxedo8.1\lib\libbuft.lib
C:\bea\tuxedo8.1\lib\libfml.lib
C:\bea\tuxedo8.1\lib\libfml32.lib
C:\bea\tuxedo8.1\lib\libengine.lib
wsock32.lib
kernel32.lib
advapi32.lib
user32.lib
gdi32.lib
comdlg32.lib
winspool.lib
C:\bea\tuxedo8.1\samples\atmi\simpapp>buildserver -o simpserv -f simpserv.c -s TOUPPER
cl /MD -I"%TUXDIR%"\include -Fesimpserv BS-894.c simpserv.c "%TUXDIR%"\lib\lib
tux.lib "%TUXDIR%"\lib\libbuft.lib "%TUXDIR%"\lib\libfml.lib "%TUXDIR%"\lib\l
ibfml32.lib "%TUXDIR%"\lib\libengine.lib wsock32.lib kernel32.lib advapi32.lib
user32.lib gdi32.lib comdlg32.lib winspool.lib -link -implib:BS-894.lib
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
BS-894.c
simpserv.c
Generating Code...
Microsoft (R) Incremental Linker Version 6.00.8168
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
/out:simpserv.exe
-implib:BS-894.lib
BS-894.obj
simpserv.obj
C:\bea\tuxedo8.1\lib\libtux.lib
C:\bea\tuxedo8.1\lib\libbuft.lib
C:\bea\tuxedo8.1\lib\libfml.lib
C:\bea\tuxedo8.1\lib\libfml32.lib
C:\bea\tuxedo8.1\lib\libengine.lib
wsock32.lib
kernel32.lib
advapi32.lib
user32.lib
gdi32.lib
comdlg32.lib
winspool.lib
*RESOURCES
IPCKEY <Replace with a valid IPC Key>
如果没改成IPCKEY 123456,运行tmloadcf ubbsimple会出现下面的错误
C:\bea\tuxedo8.1\samples\atmi\simpapp>tmloadcf ubbsimple
CMDTUX_CAT:866: ERROR: tmloadcf: Severe error found. Stop syntax checking.
修改ubbsimple文件<>中内容,完成后执行
C:\bea\tuxedo8.1\samples\atmi\simpapp>tmloadcf ubbsimple
Initialize TUXCONFIG file: C:\bea\tuxedo8.1\samples\atmi\simpapp\tuxconfig [y, q
] ? y
C:\bea\tuxedo8.1\samples\atmi\simpapp>tmboot
Boot all admin and server processes? (y/n): y
Booting all admin and server processes in C:\bea\tuxedo8.1\samples\atmi\simpapp\
tuxconfig
INFO: BEA Tuxedo, Version 8.1
INFO: Serial #: 454493271161-2664947729544, Expiration NONE, Maxusers 1000000
INFO: Licensed to: Customer
Booting admin processes ...
exec BBL -A :
process id=2580 ... Started.
Booting server processes ...
exec simpserv -s TOUPPER -s TOLOWER -r -p 2,1:5,3 :
process id=2596 ... Started.
exec simpserv -s TOUPPER -s TOLOWER -r -p 2,1:5,3 :
process id=2620 ... Started.
exec simpserv -s TOUPPER -s TOLOWER -r -p 2,1:5,3 :
process id=2644 ... Started.
4 processes started.
C:\bea\tuxedo8.1\samples\atmi\simpapp>simpcl.exe
Usage: simpcl string
C:\bea\tuxedo8.1\samples\atmi\simpapp>simpcl hello
Returned string is: HELLO
这个例子的作用是将小写字符转换成大写的字符
C:\bea\tuxedo8.1\samples\atmi\simpapp>simpcl "hello ,无敌!"
Returned string is: HELLO ,无敌!
C:\bea\tuxedo8.1\samples\atmi\simpapp>tmadmin
tmadmin - Copyright (c) 1996-1999 BEA Systems, Inc.
Portions * Copyright 1986-1997 RSA Data Security, Inc.
All Rights Reserved.
Distributed under license by BEA Systems, Inc.
Tuxedo is a registered trademark.
> psr
Prog Name Queue Name Grp Name ID RqDone Load Done Current Service
--------- ---------- -------- -- ------ --------- ---------------
BBL.exe 123456 simple 0 0 0 ( IDLE )
simpserv.exe 00001.00001 GROUP1 1 1 50 ( IDLE )
> psc
Service Name Routine Name Prog Name Grp Name ID Machine # Done Status
------------ ------------ --------- -------- -- ------- ------ ------
TOUPPER TOUPPER simpserv.+ GROUP1 1 simple 1 AVAIL
先用Ctrl+C终止命令的执行,在使用tmshutdown命令关闭应用程序。
C:\bea\tuxedo8.1\samples\atmi\simpapp>tmshutdown
Shutdown all admin and server processes? (y/n): y
Shutting down all admin and server processes in C:\bea\tuxedo8.1\samples\atmi\si
mpapp\tuxconfig
Shutting down server processes ...
Server Id = 1 Group Id = GROUP1 Machine = simple: shutdown succeed
ed
Shutting down admin processes ...
Server Id = 0 Group Id = simple Machine = simple: shutdown succeed
ed
2 processes stopped.
使用more或type命令检查ULOG文件
C:\bea\tuxedo8.1\samples\atmi\simpapp>more ULOG.021609
153954.ROOT!BBL.3532.3420.0: 02-16-2009: Tuxedo Version 8.1 32-bit Windows.
153954.ROOT!BBL.3532.3420.0: LIBTUX_CAT:262: INFO: Standard main starting
153955.ROOT!simpserv.3712.3640.0: 02-16-2009: Tuxedo Version 8.1 32-bit Windows.
153955.ROOT!simpserv.3712.3640.0: LIBTUX_CAT:262: INFO: Standard main starting
153955.ROOT!simpserv.3712.3640.0: Welcome to the simple server
154403.ROOT!simpserv.3712.3640.0: LIBTUX_CAT:522: INFO: Default tpsvrdone() func
tion used
154406.ROOT!BBL.3532.3420.0: CMDTUX_CAT:26: INFO: The BBL is exiting system