1、下载tuxedo
我这了选择的是tuxedo 11gR1,可以去oracle官网下载,我下载的是 tuxedo111130_64_Linux_01_x86.bin,linux系统64位版本
[root@tiger ~]# groupadd oracle
[root@tiger ~]# useradd oracle -g oracle
进入/opt目录,建立tuxedo目录,更改目录属主
[root@tiger ~]# cd /opt
[root@tiger opt]# mkdir tuxedo
[root@tiger opt]# chmod -R 755 tuxedo/
[root@tiger opt]# chown -R oracle:oracle tuxedo/
[root@tiger opt]#
上传tuxedo111130_64_Linux_01_x86.bin至/opt/tuxedo下,更改文件属主为oracle,完成后给oracle用户设置密码
[root@tiger tuxedo]# chown -R oracle:oracle tuxedo111130_64_Linux_01_x86.bin[root@tiger tuxedo]# ll
total 84012
-rw-r--r-- 1 oracle oracle 86027903 Feb 12 10:46 tuxedo111130_64_Linux_01_x86.bin
[root@tiger tuxedo]# chmod -R 755 tuxedo111130_64_Linux_01_x86.bin
[root@tiger tuxedo]# ll
total 84012
-rwxr-xr-x 1 oracle oracle 86027903 Feb 12 10:46 tuxedo111130_64_Linux_01_x86.bin
[root@tiger tuxedo]# pwd oracle
/opt/tuxedo
[root@tiger tuxedo]# passwd oracle
Changing password for user oracle.
New password:
BAD PASSWORD: it is based on a dictionary word
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.
[root@tiger tuxedo]#
之后的操作,会在oracle用户进行
[root@tiger tuxedo]# su oracle [oracle@tiger tuxedo]$
[oracle@tiger tuxedo]$ /tuxedo111130_64_Linux_01_x86.bin -i console
一以下是安装时的交互
Preparing to install...
Extracting the JRE from the installer archive...
Unpacking the JRE...
Extracting the installation resources from the installer archive...
Configuring the installer for this system's environment...
strings: '/lib/libc.so.6': No such file
Launching installer...
Preparing CONSOLE Mode Installation...
===============================================================================
Choose Locale...
----------------
->1- English
CHOOSE LOCALE BY NUMBER: 1
===============================================================================
Tuxedo 11.1.1.3.0 (created with InstallAnywhere by Macrovision)
-------------------------------------------------------------------------------
Command.run(): process completed before monitors could start.
===============================================================================
Introduction
------------
InstallAnywhere will guide you through the Tuxedo 11.1.1.3.0 installation.
It is strongly recommended that you quit all programs before continuing with
this installation.
Enter "next' to proceed to the next screen. Enter "back" to modify the prevIoUs
screen.
You may cancel this installation at any time by typing "quit".
WARNING: "Quitting" creates an incomplete Tuxedo 11.1.1.3.0 installation.You
must re-install Tuxedo 11.1.1.3.0. For more information,see "Preparing to
Install the Oracle Tuxedo System" in the Tuxedo 11.1.1.3.0 Installation Guide.
PRESS <ENTER> TO CONTINUE:
===============================================================================
Choose Install Set
------------------
Please choose the Install Set to be installed by this installer.
->1- Full Install
2- Server Install
3- Full Client Install
4- Jolt Client Install
5- ATMI Client Install
6- CORBA Client Install
7- Customize...
ENTER THE NUMBER FOR THE INSTALL SET,OR PRESS <ENTER> TO ACCEPT THE DEFAULT
: 1
===============================================================================
Choose Oracle Home
------------------
1- Create new Oracle Home
Enter a number: 1
Specify a new Oracle Home directory: /opt/tuxedo/app
===============================================================================
Choose Product Directory
------------------------
1- Modify Current Selection (/opt/tuxedo/app/tuxedo11gR1)
2- Use Current Selection (/opt/tuxedo/app/tuxedo11gR1)
Enter a number: 2
Install Samples (Y/N): Y
===============================================================================
Pre-Installation Summary
------------------------
Please Review the Following Before Continuing:
Product Name:
Tuxedo 11.1.1.3.0
Install Folder:
/opt/tuxedo/app/tuxedo11gR1
Link Folder:
/home/oracle
required Space:
187 MB
Available Space:
16923 MB
PRESS <ENTER> TO CONTINUE:
===============================================================================
Ready To Install
----------------
InstallAnywhere is now ready to install Tuxedo 11.1.1.3.0 onto your system at
the following location:
/opt/tuxedo/app/tuxedo11gR1
PRESS <ENTER> TO INSTALL:
===============================================================================
Installing...
-------------
[==================|==================|==================|==================]
[------------------|------------------|------------------|------------------]
===============================================================================
Configure tlisten Service
-------------------------
Password:
Verify Password:
Password Accepted! Please wait...
===============================================================================
SSL Installation Choice.
------------------------
Would you like to install SSL Support?
->1- Yes
2- No
ENTER THE NUMBER FOR YOUR CHOICE,OR PRESS <ENTER> TO ACCEPT THE DEFAULT:
: 2
===============================================================================
Installation Complete
---------------------
Congratulations. Tuxedo 11.1.1.3.0 has been successfully installed to:
/opt/tuxedo/app/tuxedo11gR1
PRESS <ENTER> TO EXIT THE INSTALLER:
至此,安装完成。
4、tuxedo配置
进入目录 /opt/tuxedo/app/tuxedo11gR1,更改文件 tux.env为755,执行如下命令:
chmod 755 tux.env
[oracle@tiger tuxedo11gR1]$ source tux.env
[oracle@tiger tuxedo11gR1]$ env |grep TUX
TUXDIR=/opt/tuxedo/app/tuxedo11gR1 //如果查找到了,说明环境变量设置成功。
(此文件初始化tuxedo相关的环境变量,我是把此文件的内容加入到. bash_profile中去了,方便机器重启时使用)
5、配置一个服务(用自带的例子simpapp测试)
执行下面命令
[oracle@tiger atmi]$ cd /opt/tuxedo/app/tuxedo11gR1/samples/atmi
[oracle@tiger atmi]$ cd simpapp/
[oracle@tiger simpapp]$ ll
total 16
-rw-r----- 1 oracle oracle 2943 Feb 12 10:57 README
-rw-r----- 1 oracle oracle 1826 Feb 12 10:57 simpcl.c
-rw-r----- 1 oracle oracle 2155 Feb 12 10:57 simpserv.c
-rw-r----- 1 oracle oracle 886 Feb 12 10:57 ubbsimple
[oracle@tiger simpapp]$
备份 ubbsimple,新建一个ubbsimple,拷贝以下内容:
# 2003 BEA Systems,Inc. All Rights Reserved. #ident "@(#) samples/atmi/simpapp/ubbsimple $Revision: 1.7 $" #Skeleton UBBCONFIG file for the TUXEDO Simple Application. #Replace the <bracketed> items with the appropriate values. *RESOURCES IPCKEY 123456 #Example: #IPCKEY 123456 DOMAINID simpapp MASTER simple MAXACCESSERS 900 MAXSERVERS 10 MAXSERVICES 20 MODEL SHM LDBAL N *MACHINES DEFAULT: APPDIR="/opt/tuxedo/app/tuxedo11gR1/samples/atmi/simpapp" TUXCONFIG="/opt/tuxedo/app/tuxedo11gR1/samples/atmi/simpapp/tuconfig" TUXDIR="/opt/tuxedo/app/tuxedo11gR1" MAXWSCLIENTS=2 #Example: # APPDIR="/home/me/simpapp" # TUXCONFIG="/home/me/simpapp/tuxconfig" # TUXDIR="/usr/tuxedo" "tiger" LMID=simple #Example: #beatux LMID=simple *GROUPS GROUP1 LMID=simple GRPNO=1 OPENINFO=NONE JSLGRP LMID=simple GRPNO=2 JREPGRP LMID=simple GRPNO=3 *SERVERS DEFAULT: CLOPT="-A" simpserv SRVGRP=GROUP1 SRVID=1 JSL SRVGRP=JSLGRP SRVID=755 CLOPT="-A -- -n //192.168.109.66:8888 -m 5 -M 10 -x 5" JREPSVR SRVGRP=JREPGRP SRVID=302 CLOPT="-A -- -W -P /opt/tuxedo/app/tuxedo11gR1/udataobj/jolt/repository/jrepository" *SERVICES TOUPPER
根据不同情况,调整内容。
编译UBBCONFIG
[oracle@tiger simpapp]$tmloadcf -y ubbsimple编译服务代码,设置环境变量
[oracle@tiger simpapp]$ buildserver -o simpserv -f simpserv.c -s TOUPPER
[oracle@tiger simpapp]$ export TUXCONFIG="/opt/tuxedo/app/tuxedo11gR1/samples/atmi/simpapp/tuconfig"
启动 tmboot -y
[oracle@tiger simpapp]$ tmboot -y
Booting all admin and server processes in /opt/tuxedo/app/tuxedo11gR1/samples/atmi/simpapp/tuconfig
INFO: Oracle Tuxedo,Version 11.1.1.3.0,64-bit,Patch Level (none)
Booting admin processes ...
exec BBL -A :
process id=28111 ... Started.
Booting server processes ...
exec simpserv -A :
process id=28112 ... Started.
exec JSL -A -- -n //192.168.109.66:8888 -m 5 -M 10 -x 5 :
process id=28113 ... Started.
exec JREPSVR -A -- -W -P /opt/tuxedo/app/tuxedo11gR1/udataobj/jolt/repository/jrepository :
process id=28119 ... Started.
4 processes started.
可以看到已经启动成功,停止服务: tmshutdown -y
6、java通过jolt调用服务测试
新建一个java工程,拷贝/opt/tuxedo/app/tuxedo11gR1/udataobj/jolt/jolt.jar、/opt/tuxedo/app/tuxedo11gR1/udataobj/jolt/joltjse.jar两个jar包加入编译路径,测试类代码如下:
package my.jolt.servlet; import bea.jolt.JoltDefinition; import bea.jolt.JoltMessage; import bea.jolt.JoltRemoteService; import bea.jolt.JoltSession; import bea.jolt.JoltSessionAttributes; import bea.jolt.JoltTransaction; public class Test { public static void main(String[] args) throws Exception { JoltSessionAttributes sattr = null; JoltRemoteService toupper = null; JoltTransaction trans = null; String userName = ""; String userPassword = ""; String appPassword = ""; String userRole = ""; String outstr; sattr = new JoltSessionAttributes(); // 建立目标连接地址 sattr.setString(sattr.APPADDRESS,"//192.168.109.66:8888"); // TIMEOUT时间 sattr.setInt(sattr.IDLETIMEOUT,300); // 建立连接,初始化 bea.jolt.JoltSession session = new JoltSession(sattr,userName,userRole,userPassword,appPassword); // 需要的总控 toupper = new JoltRemoteService("TOUPPER",session); toupper.addString("STRING","if i am ajfgfdgdf gdg"); try{ // 调用,返回 toupper.call(null); JoltDefinition jd = toupper.getDefinition(); JoltMessage jm = toupper.getOutputs(); System.out.println("返回:" + jm.toString()); }catch (Exception e) { e.printStackTrace(); }finally{ session.endSession(); } } }运行结果: 返回:STRING[0]S="IF I AM AJFGFDGDF GDG": 当然也可以建立web工程测试,/opt/tuxedo/app/tuxedo11gR1/samples/jolt/wls/servlet/simpapp目录下有例子代码, tomcat部署可以参照:http://www.myexception.cn/software-architecture-design/895271.html 原文链接:https://www.f2er.com/centos/378771.html