日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程语言 > java >内容正文

java

java jolt tuxedo_Java中使用Jolt访问Tuxedo服务 – Tomcat环境部署测试

發(fā)布時間:2023/12/29 java 39 豆豆
生活随笔 收集整理的這篇文章主要介紹了 java jolt tuxedo_Java中使用Jolt访问Tuxedo服务 – Tomcat环境部署测试 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

Java中使用Jolt訪問Tuxedo服務(wù) – Tomcat環(huán)境部署測試

Java中使用Jolt訪問Tuxedo服務(wù) – Tomcat環(huán)境部署測試

最近在學(xué)習(xí)基于Tuxedo的系統(tǒng)架構(gòu),網(wǎng)上討論最多的,比較流行的3層架構(gòu)是基于Weglogic+Tuxedo+DB的模式,關(guān)于這類模式的文章也比較多,可以參見鏈接:

http://blog.csdn.net/liwei_cmg/article/details/769150

一般來說,Java可用使用3種聯(lián)機(jī)方式訪問Tuxedo的服務(wù):

1.WTC????????? 用于Weblogic與Tuxedo的互訪,可以實現(xiàn)雙向的調(diào)用。

2.JOLT????????? 用于Tomcat, Weblogic, Websphere 和其他應(yīng)用服務(wù)器訪問Tuxedo,為單向調(diào)用。

3.CORBA??????? (網(wǎng)上有介紹,自己沒實踐過)

作為學(xué)習(xí)了解Java如何通過Jolt調(diào)用Tuxedo服務(wù),以及如何使用Jolt的鏈接池技術(shù),本文沒有使用Weblogic作為應(yīng)用服務(wù)器,而是直接在Tomcat應(yīng)用服務(wù)器中配置部署了Html+ Servlet來調(diào)用Tuxedo的服務(wù)。

實現(xiàn)環(huán)境:

服務(wù)端:?????? GUN/Linux 2.6.32?? +Tuxedo 11gR1

應(yīng)用服務(wù)器:?? Apache-tomcat-6.0.29 for Windows

開發(fā)工具:???? Myeclipse 8.5

實現(xiàn)步驟如下:

1)準(zhǔn)備Tuxedo服務(wù)程序

2)修改配置ubbconfig

3)修改Jolt訪問服務(wù)的jrepository文件

4)啟動Tuxedo服務(wù)

5)創(chuàng)建Web project

6)準(zhǔn)備Servlet 和 html程序

7)準(zhǔn)備Jolt 連接池配置文件

8)配置web.xml文件

9)部署Web項目simpapp

10)Linux服務(wù)器防火墻設(shè)置

1. 準(zhǔn)備Tuxedo服務(wù)程序

這里我們還是用examples中的simpserv.c程序,以及TOUPPER服務(wù),比較容易。

//simpserv.c

#include

#include

#include ??? /* TUXEDO Header File */

#include /* TUXEDO Header File */

#if defined(__STDC__) || defined(__cplusplus)

tpsvrinit(int argc, char *argv[])

#else

tpsvrinit(argc, argv)

int argc;

char **argv;

#endif

{

/* Some compilers warn if argc and argv aren't used. */

argc = argc;

argv = argv;

/* userlog writes to the central TUXEDO message log */

userlog("Welcome to the simple server 2");

return(0);

}

#ifdef __cplusplus

extern "C"

#endif

void

#if defined(__STDC__) || defined(__cplusplus)

TOUPPER(TPSVCINFO *rqst)

#else

TOUPPER(rqst)

TPSVCINFO *rqst;

#endif

{

int i;

for(i = 0; i < rqst->len-1; i++)

rqst->data[i] = toupper(rqst->data[i]);

/* Return the transformed buffer to the requestor. */

tpreturn(TPSUCCESS, 0, rqst->data, 0L, 0);

}

編譯服務(wù)程序,

buildserver -f simpserv.c -o simpserv -s TOUPPER

2.修改配置ubbconfig, 加入如下的組和服務(wù)

*GROUPS

JSLGRP????????? LMID=simpapp1?? GRPNO=101

JREPGRP???????? LMID=simpapp1?? GRPNO=102

*SERVERS

JSL???????????? SRVGRP=JSLGRP SRVID=1

CLOPT="-A -- -n //192.168.1.100:8850 -m 5 -M 5 -x 10"

JREPSVR???????? SRVGRP=JREPGRP SRVID=1

CLOPT="-A -- -W –P /home/tuxedo/udataobj/jolt/repository/jrepository"

JSL 為Java通過Jolt訪問Tuxedo的監(jiān)聽服務(wù),

//192.168.1.100:8850為Tuxedo服務(wù)器的地址和端口,在Java客戶端要用。

(注意:Jolt不通過WSL來訪問Tuxedo服務(wù)。)

編譯ubbconfig配置文件,

tmloadcf –y ubbconfig

3.修改Jolt訪問服務(wù)的jrepository文件,加入TOUPPER服務(wù)的定義如下(也可以采用RE.html配置):

add SVC/TOUPPER:vs=1:ex=1:bt=STRING:\

bp:pn=STRING:pt=string:pf=167772161:pa=rw:ep:

4.啟動Tuxedo服務(wù)

服務(wù)端配置完畢。

5. 在Myeclipse下創(chuàng)建Web project,項目名為simpapp,位于 d:\worksapce\simpapp

創(chuàng)建新的 src包,? my.jolt.servlet,位于d:\worksapce\simpapp\src

6.準(zhǔn)備Servlet 和 html程序

程序來自Tuxedo的examples,調(diào)試的時候進(jìn)行了修改。

網(wǎng)頁程序 simp.html,? d:\worksapce\simpapp\WebRoot\simp.html

Jolt SimpApp Example

Jolt SimpApp Example

This examples demonstrates how a Java HTTP Servlet running in the

Weblogic Server services a POST request from a

<FORM> in

this HTML file. The simpapp

servlet invokes a service on the BEA TUXEDO Server that converts the

text you enter here into uppercase. The result is posted back inside

a servlet-generated html file.

Type some text here and click the Post button:

Click here for session pools statistics

原程序中一行如下,調(diào)試的時候報錯,刪掉了。

錯誤如下:

嚴(yán)重: Servlet.service() for servlet SimpAppServlet threw exception

java.lang.NoSuchFieldError: SVCNAME

Servlet程序,SimpAppServlet.java,位于? d:\worksapce\simpapp\src\my\jolt\servlet

package my.jolt.servlet;

import bea.jolt.pool.servlet.*;

import bea.jolt.pool.ApplicationException;

import bea.jolt.pool.SessionPoolException;

import bea.jolt.pool.ServiceException;

import java.util.Properties;

import java.util.Hashtable;

import java.io.IOException;

import javax.servlet.*;

import javax.servlet.http.*;

/**

* This example demonstrates how a Servlet may connect to Tuxedo

* and call upon one of its services; it should be invoked from the

* simpapp.html file. The servlet creates a session pool

* manager at initialization, which is used to obtain a session when the

* doPost() method is invoked. This session is used to connect to a service

* in Tuxedo with a name described by the posted "SVCNAME" argument. In this

* example the service is called "TOUPPER", which transposes the posted

* "STRING" argument text into uppercase, and returns the result. This is

* returned to the client browser within some generated HTML.

* THIS IS SOURCE CODE PUBLISHED FOR DEMONSTRATION PURPOSES

*

* @author Copyright (c) 1999 BEA Systems, Inc.? All rights reserved.

*/

public class SimpAppServlet extends HttpServlet {

/**

* Private variable to hold the pool manager object.

*/

private ServletSessionPoolManager b_mgr;

/**

* Initializes the servlet.? The session pool manager and the

* simpapp session pool is established here.? The properties of

* the session pool is specified through an external property

* file whose path comes from the servlet initial parameter "properties".

*

* @param config??????????? Servlet configuration

* @exception?????????????? ServletException if the servlet fails

*/

public void init(ServletConfig config) throws ServletException {

super.init(config);

try {

// Create a session pool and get the session pool manager through

// a property file.

String path = config.getServletContext().getRealPath("/") +

"simpapp.properties";

Properties prop = ServletPoolManagerConfig.load(path);

if (prop == null)

throw new ServletException(path + " not found");

ServletPoolManagerConfig.startup(prop);

b_mgr = ServletPoolManagerConfig.getSessionPoolManager();

}

catch (Exception e) {

throw new ServletException(e.toString());

}

}

/**

* Destroys this servlet. The ServletSessionPoolManager

* resource is deallocated.

*/

public void destroy() {

b_mgr = null;

}

/**

* Implements the HttpServlet doPost() method.

* This method expects POSTed arguments for:

*

*

"SVCNAME"The name of the service to be invoked in Tuxedo.

*

"STRING"The text to be transposed to uppercase.

*

*

*

See the provided simpapp.html for the HTML form

* used to submit the data.

*/

public void doPost(HttpServletRequest req, HttpServletResponse resp)

throws ServletException, IOException

{

ServletResult result;

ServletOutputStream out = resp.getOutputStream();

out.println("

Jolt SimpApp Example Response");

out.println("

" +

"

" +

"This is the response from the SimpAppServlet:" +

"

");

// Get the "simpapp" session pool

ServletSessionPool session = (ServletSessionPool)

b_mgr.getSessionPool("simpapp");

if (session == null) {

out.println("The servlet failed to obtain a SessionPool for simpapp. "+

"
"+

"Possibly the Tuxedo server is not running, "+

"or there is a configuration problem."+

"

");

out.close();

return;

}

//String svcnm[] = req.getParameterValues("SVCNAME");

// Invoke a service and get the result.? Process the

// template with input and result if there is no error.

try {

//result = session.call(svcnm[0], req);

Result = session.call("TOUPPER");

// No error; present the result page.

out.println("The simpapp sevice was successfully called, and "+

"responded with the output string: ");

out.println("

"+

result.getValue("STRING", "")+

"


");

}

catch (SessionPoolException e) {

// All sessions are busy.

out.println("Your request cannot be completed at this moment.\n"+

"

Diagnostic Message is: "+e.getMessage()+"

\n"+

"Possible reasons:

  • \n"+

"

No sessions are available\n"+

"

The session pool is suspended\n"+

"

The session pool is shutdown\n"+

"

Please resubmit your request later.");

}

catch (ServiceException e) {

// There is a Service Exception.

out.println("

Service exception

"

Error message:"+e.getMessage()+

"

Error number:"+e.getErrno()+

"

");

}

catch (ApplicationException e) {

// There is an application error.

result = (ServletResult) e.getResult();

out.println("

Application error

\n"+

"

Application code is "+result.getApplicationCode());

}

catch (Exception e) {

out.println("

Unexpected exception

"+

"

Exception is "+

"");

}

out.println("

總結(jié)

以上是生活随笔為你收集整理的java jolt tuxedo_Java中使用Jolt访问Tuxedo服务 – Tomcat环境部署测试的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 97超碰人 | 日本午夜精华 | 国产精品福利在线 | 色老头综合网 | 97超碰人人爱 | 成人高清网站 | 秋霞午夜伦理 | 国产一区二区三区久久 | 奇米91| 少妇aaaa| 性生交大片免费看女人按摩 | 99精品一区二区 | 麻豆md0049免费 | av成人在线网站 | 天天人人精品 | 舐め犯し波多野结衣在线观看 | 少妇全黄性生交片 | 亚洲欧美日韩免费 | 国产毛片视频网站 | 成人免费观看视频网站 | 91免费福利视频 | 亚洲一区电影在线观看 | 成人免费av | 亚洲天堂一级 | 91免费视频国产 | www婷婷av久久久影片 | 国产av电影一区二区三区 | 久久大胆人体 | 网站黄色在线观看 | 欧美成人黄色小视频 | 亚洲a网站 | 蜜桃精品噜噜噜成人av | 久久久久亚洲av片无码下载蜜桃 | 日本www| 男人插入女人下面的视频 | 91九色丨porny丨国产jk | 国产在线观 | 国产精品999| 国产精品500部 | 久久这里只有精品8 | 日韩av线观看 | 啦啦啦视频在线观看 | 开心激情五月婷婷 | 精品少妇人妻av一区二区三区 | 欧美 日韩 国产在线 | 狠狠干快播 | 91麻豆影院| avtt国产| 久草欧美视频 | 欧美日韩一区电影 | 久久久精品中文字幕麻豆发布 | 免费看成人片 | 香蕉视频免费网站 | 免费久久精品 | 欧美午夜精品久久久久久孕妇 | 久久av资源| 成人免费激情视频 | 日韩青青草 | 不卡av中文字幕 | 日韩福利影院 | 一级片在线免费观看 | 亚一区 | www黄色大片 | 久久高潮视频 | 中文字幕在线2018 | 少妇高潮一区二区三区99小说 | 无套白嫩进入乌克兰美女 | 国产精品丝袜视频无码一区69 | 一区二区三区精品久久久 | 亚洲成人中文字幕 | 亚洲最大的av网站 | 丰满大乳国产精品 | jizz中国少妇高潮出水 | 欧美一区二区公司 | 操bbbbb| 精品美女一区 | 性一交一乱一伧老太 | 少妇高潮久久久 | 国产精品成人免费视频 | 国产又粗又猛又爽又黄的视频一 | 97视频一区二区 | 欧美无砖砖区免费 | 蜜臀久久99精品久久久 | 国产喷潮 | 老汉色老汉首页av亚洲 | 日韩一区免费 | 土耳其xxxx性hd极品 | 欧美黄色aaa | 在线欧美日韩国产 | 欧美瑟瑟 | 涩色视频 | 荫道bbwbbb高潮潮喷 | 神马影院午夜伦理 | 九九视频免费 | 亚洲精品视频一区二区三区 | 寻找身体恐怖电影免费播放 | 日本久久久久久 | 91激情在线观看 | 国产专区一 |