Tuxedo Service Debugging
Hi All ,
Is it possible to debug Tuxedo Services using GDB in Unix environment (AIX) ..
Could you please share your experience in this regard
Thanks in advance
Nadeer.
Nadeer,
Yes, it is possible to debug services using GDB. To get the most debugging
information, you should "export CFLAGS=-g" when running buildserver so that
your server will be compiled with debugging on. After booting the server,
you can attach to the running server using "gdb myserver process_id" and set
breakpoints. After setting breakpoints, you can give the "continue" command
and send a client request to the server.
Ed
"nadeer ahammed" <[email protected]> wrote in message
news:[email protected]..
Hi All ,
Is it possible to debug Tuxedo Services using GDB in Unix environment
(AIX) ..
Could you please share your experience in this regard
Thanks in advance
Nadeer.
Similar Messages
-
Debugging of Tuxedo Service in C/C++
Hi All,
I am trying to debug tuxedo service (C code on HP-UNIX 11.00) in the following ways :
shprod25 48: gdb csbfp001 -> csbfp001 is the application service exe
(gdb) b GetRecircRow -> GetRecircRow is the function name
(gdb) r
Starting program: /appl/bstar/bin/csbfp001
Error while reading dynamic library list.
(gdb)
Looks like it is not able to read DLL and it exists. Can anyone please tell me how can i debug the code line by line ?It's even more complex than this, because Tuxedo Services has to attach IPCS and register in the BBL/DBBL in order to communicate with the world. The problem you are facing is because you are trying to boot the server without all the variables that tuxedo programs (like tmboot) uses when starting all the stuff.
So, I will recommend you two different aproaches:
1) Start tuxedo server as usual (with tmboot a/o tmadmin) and attach gdb to the pid when it has started, debugging from then on. It is the easiest and safest way.
2) If you need to debug from the start (which is a little more complex), load the environment that starts initially the domain (BBL/DBBL), start tuxedo server as usual, take note with a "ps" of all the parameters tuxedo uses when starting this server, shutdown it and start debugging with gdb using this parameters to run the server.
Hope this helps.
Ramon -
Debugging a tuxedo service using dbx
Hi,
Is is possible to debug a tuxedo service using dbx by enabing the tmboot switches
and -g option of the compiler. I am able to step into tpsvrinit during initialisation,
but not able to do when a client calls a service. I could not step into the service
by setting breakpoints. Please help.
rgds,
DominicThe only thing to be aware of is that while you play around in the debugger, Tuxedo
is timing out your transaction.
So, if you want things to keep working while you debug, setup some nice long timouts.
...Lyall
"RC Bryan" <[email protected]> wrote:
>
I have not done this on Solaris in a while but basically, what you have
to do is
to build the process with -g and start it with tmboot as you would normally.
After the process is running, you can attach by typing:
dbx name pid
where the name is the name of the executable and pid is the process id
of the
server process (obtained either with ps -ef | grep name or with verbose
mode psr
in tmadmin). This will break into the running process. You can then
set your
break points in the service routines as required. When the service is
entered,
control will return to your debugger session and you can debug as you
normally
would.
Incidentally, I find the buildserver -k (keep) option to be useful when
debugging
servers. This allows you to debug through the startup code that is normally
deleted
as a part of the buildserver process.
Regards,
/RC Bryan
"Dominic" <[email protected]> wrote:
Hi,
Is is possible to debug a tuxedo service using dbx by enabing the tmboot
switches
and -g option of the compiler. I am able to step into tpsvrinit during
initialisation,
but not able to do when a client calls a service. I could not step into
the service
by setting breakpoints. Please help.
rgds,
Dominic -
[help]a problem about dbx/attach a tuxedo service
I attempted to trace a Tuxedo service process via dbx/attach command:
attach nnnnwhen I attached dbx to the service PID, the service process is stopped somewhere outside my service program:
(/opt/SUNWspro/bin/../WS6U2/bin/sparcv9/dbx) where
current thread: t@1
=>[1] __systemcall(0xffbfeda8, 0x31, 0x2, 0x10540c, 0x2cc0e8, 0x641dc), at 0xfe120080
[2] _libc_msgrcv(0x10540c, 0x2cc0e8, 0x641dc, 0xc0000000, 0x0, 0x2ec), at 0xfe117928
[3] msgrcv(0x10540c, 0x2cc0e8, 0x641dc, 0xc0000000, 0x0, 0x0), at 0xfe45dc40
[4] _tmmbrecvm(0x0, 0xbdb0c, 0x2, 0xa, 0x0, 0x7), at 0xfe59b658
[5] _tmmsgrcv(0xfffffffc, 0xfe5fdaa8, 0x0, 0xffff, 0xbf800, 0xb76c8), at 0xfe4bc1d0
[6] _tmrcvrq(0xae608, 0xffbff38c, 0x22, 0x10000000, 0x1000, 0xc0000000), at 0xfe4f9738
[7] _tmrunserver(0x0, 0x1400, 0x0, 0xfe5fdaa8, 0x0, 0xb76c8), at 0xfe4fe418
[8] _tmstartserver(0x15, 0x1c00, 0x8b160, 0xae608, 0x0, 0x8af88), at 0xfe4d7530
[9] main(0x15, 0xffbff4bc, 0xffbff514, 0x8b000, 0x0, 0x0), at 0x238f8However, I can not resume the service process either. when I use cont command, the dbx seems to stop there with no input prompt.
Has anyone debug a tuxedo serive in SunOS using dbx?How can I resume the server process If I want to print the local variables?Thank you in advance!
Edited by: angeloyu on Sep 16, 2008 8:02 PMangeloyu wrote:
I attempted to trace a Tuxedo service process via dbx/attach command:
attach nnnnwhen I attached dbx to the service PID, the service process is stopped somewhere outside my service program:
(/opt/SUNWspro/bin/../WS6U2/bin/sparcv9/dbx) where
current thread: t@1
[9] main(0x15, 0xffbff4bc, 0xffbff514, 0x8b000, 0x0, 0x0), at 0x238f8
Judging by WS6U2 above, I assume you are using dbx 6.2, which is very, very old. Unless you need it to work on similarly old Solaris, please consider upgrading to Sun Studio 11 (supports Solaris 8) or Sun Studio 12 (supports Solaris 9+). Both are free and contain many improvements.
angeloyu wrote:
However, I can not resume the service process either. when I use cont command, the dbx seems to stop there with no input prompt.That's kind of expected behavior from the debugger - it resumes debuggee and sits there until debuggee generates some event (like hitting breakpoint or receiving a signal). Once dbx gets notified of this event, it presents details to the user and provides input prompt.
Did you put any breakpoints in (with stop command)? You'll also need to make sure breakpoint is reached by that service you are debugging.
Anyways, if all you need is to trace the service, it might be easier to use truss(1) command like this:
$ truss -p `pgrep Tuxedo` -
TPESYSTEM error when calling tuxedo service
Hello,
I have a problem when running my own EJB as a TUXEDO service using WTC.
Im using TUXEDO 8.1 and WL 8.1.
My TUXEDO and WTC configuration seems OK, because TOLOWER example is running OK.
When im trying to run my own EJB as a TUXEDO service on TUXEDO side TPESYSTEM
error appears.
JDNI name and configuration of the EJB is correct, because when I put wrong JNDI
then on TUXEDO side TPENOENTRY error appears. Additionally - my EJB's bussines
logic is pretty the same as TOLOWER example.
I think that is EJB issue because in server logs there is an information that
domains are connected but ejbCreate method isn't called. My EJB was developed
using JBuilder 9 WebLOgic Edition and WL Workshop 8.1.
Thanks,
PatrickHi Hemant,
I'm not sure, but my guess is it was a setup problem. Perhaps not implementing the right interface in the EJB, not having the correct home specified, etc.
Usually the best way to find these errors the first time is to turn on some debugging information in WLS. More information can be found at: http://edocs.bea.com/wls/docs91/wtc_admin/Install.html
For this sort of problem, it probably makes sense to enable -Dweblogic.debug.DebugWTCGwtEx=true and/or -Dweblogic.debug.DebugWTCJatmiEx=true
The above examples are for WLS 9.1 and later. For earlier releases of WLS, check edocs for the settings of weblogic.wtc.TraceLevel
Best Regards,
Todd Little
BEA Tuxedo Chief Architect -
Wrong translation commond when I write Tuxedo Service to use Informix Database
Old Environment:
DB : Informix Dynamic Server Version 7.31.UC5
Tools : INFORMIX-ESQL Version 7.24.UC8
MIDDLE : Tuxedo 6.4 patch 341
New Environment :
DB : Informix Dynamic Server Version 9.30.FC1
Tools : IBM Informix CSDK Version 2.80,
IBM Informix-ESQL Version 9.52.UC2
MIDDLE : Tuxedo 8.0 patch 135
Event :
My old tuxedo service had wroted to communicate with Informix Database by
XA transaction. In my service code have to
prepare informix statement by command
' EXEC SQL PREPARE p_roll FROM "ROLLBACK WORK" ' And in my old environment it's
workable until I upgrade my environment.
My old tuxedo service can compile in new environment but when i try to test
service by ud32 tool the result is error "A syntax error has occurred". After
I check my code and receive statement at Database host I found some thing does
not correct.
I send to prepare ' ROLLBACK WORK ' but at database host received ' ROLLBACK WORKRK"
' that unknown command to database.
I try to write my small new code to test PREPARE command of Informix ESQL/C
without to build to Tuxedo Server, It's can work correctly.
If you had found the same case , Please advise me too.
Thanks you very much for your advise.
[roll.ec]If ud32 reported a syntax error, then your service was never called.
Normally, a service running under XA control should not issue transactional SQL
statements. Begins and Rollbacks are issued from the transaction manager, not the
application code.
Can you post the Tuxedo message catalog number, and your ud32 script, as well as
your environment variables?
Scott Orshan
Sutep wrote:
Old Environment:
DB : Informix Dynamic Server Version 7.31.UC5
Tools : INFORMIX-ESQL Version 7.24.UC8
MIDDLE : Tuxedo 6.4 patch 341
New Environment :
DB : Informix Dynamic Server Version 9.30.FC1
Tools : IBM Informix CSDK Version 2.80,
IBM Informix-ESQL Version 9.52.UC2
MIDDLE : Tuxedo 8.0 patch 135
Event :
My old tuxedo service had wroted to communicate with Informix Database by
XA transaction. In my service code have to
prepare informix statement by command
' EXEC SQL PREPARE p_roll FROM "ROLLBACK WORK" ' And in my old environment it's
workable until I upgrade my environment.
My old tuxedo service can compile in new environment but when i try to test
service by ud32 tool the result is error "A syntax error has occurred". After
I check my code and receive statement at Database host I found some thing does
not correct.
I send to prepare ' ROLLBACK WORK ' but at database host received ' ROLLBACK WORKRK"
' that unknown command to database.
I try to write my small new code to test PREPARE command of Informix ESQL/C
without to build to Tuxedo Server, It's can work correctly.
If you had found the same case , Please advise me too.
Thanks you very much for your advise.
#include <stdio.h>
#define BUFF 30
#define SQLROWCOUNT sqlca.sqlerrd[2]
exec sql define LNGTH1 40;
main()
exec sql whenever sqlerror goto :sqlx;
exec sql begin declare section;
string hs_vlue_char[LNGTH1];
string hs_sql[500];
exec sql end declare section;
long li_line;
fprintf(stderr,"\nProcessing...\n");
exec sql connect to 'sysmaster@oltp';
li_line = __LINE__;
exec sql prepare bwork from "BEGIN WORK";
li_line = __LINE__;
exec sql prepare cwork from "COMMIT WORK";
li_line = __LINE__;
exec sql prepare rwork from "ROLLBACK WORK";
printf("%d: Before Rollback Work\n", __LINE__);
EXEC SQL PREPARE p_rwork FROM "ROLLBACK WORK";
/* free(hs_v[tmp]);
hs_v[tmp] = strfmt("%s", "rollback work");
CHECK_STRFMT_ERROR( hs_v, tmp);
debug("'%s'", hs_v[tmp]);
exec sql prepare p_rwork from :hs_v[tmp];
printf("%d: After Rollback Work\n", __LINE__);
printf("%d: Before Begin Work\n", __LINE__);
EXEC SQL PREPARE p_bwork FROM "BEGIN WORK";
printf("%d: After Begin Work\n", __LINE__);
printf("%d: Before Commit Work\n", __LINE__);
EXEC SQL PREPARE p_cwork FROM "COMMIT WORK";
printf("%d: After Commit Work\n", __LINE__);
sprintf(hs_sql, "SELECT vlue_char from cs_dfpm where dfpm_code = 'LOG_PATH_NAME1'");
printf("hs_Sql = %s\n", hs_sql);
exec sql prepare sel_sql from :hs_sql;
exec sql execute sel_sql into :hs_vlue_char;
printf("hs_vlue_char = %s\n", hs_vlue_char);
exec sql free sel_sql;
exec sql execute p_bwork;
exec sql
update cs_dfpm
set vlue_char = '/test/'
where dfpm_code = 'LOG_PATH_NAME1';
if ( SQLROWCOUNT == 0 )
exec sql execute p_rwork;
exec sql execute p_cwork;
exec sql free p_bwork;
exec sql free p_cwork;
exec sql free p_rwork;
exec sql disconnect current;
fprintf(stderr, "\nProcess completed successfully.\n");
return(0);
sqlx:
fprintf(stderr,"\nDB error encountered at line = %ld(%ld)\n", li_line, SQLCODE);
fprintf(stderr,"\nDB error encountered(%ld)\n", SQLCODE);
exec sql whenever sqlerror continue;
exec sql free sel_sql;
exec sql free p_bwork;
exec sql free cwork;
exec sql free rwork;
exec sql disconnect current;
printf("%s@%d:Process completed with Error.\n", __FILE__, __LINE__); -
Troubleshooting tuxedo services .. related to Oracle deadlock errors
Afternoon all,
I support an application that allows API calls to tuxedo services using messages comprised of FML fields. Our application sits on an OracleDB that is experiencing deadlock issues, one of the tuxedo servers involved in the deadlock is one that advertises services accessed by the API calls so I'm trying to rule it out as the source.
Is there any way to trace/log the services in detail so that I can tie the deadlocks directly to a call of a tuxedo service?
I've looked into TMTRACE, but I'm not sure this is going to give me the detail I need.
Changing application code is not an option unfortunately.
Thanks,
AdamHi Todd,
Thanks for the quick response.
Aplogies for the ignorance, but what do you mean by XA / local database transaction?
Our architecture is such that a tuxedo server, that offers the services our APIs talk to, makes the Oracle updates. Is that XA or local?
Oracle's logging and deadlock messages show me what the updates are, but I'm trying to make sure 100% that an API called service is instigating that update.
Hope that is clear enough!
Cheers,
Adam
Todd Little wrote:
Hi Adam,
Are the Tuxedo services using XA transactions or only local database transactions? The reason I ask is that TSAM offers the ability to track XA transactions and might be able to tell you what's happening. It can also track services and call paths, i.e., complete end-to-end call tracking from a Tuxedo client, through intervening servers (services).
If you are not using XA transactions, I'm afraid there isn't a lot that Tuxedo can provide you as Tuxedo is unaware of the underlying database requests. In fact, if you aren't using XA transactions, Tuxedo doesn't even know a database is involved it the processing of requests.
I would think you should be able to trace things from the database side, but you'd have to ask that question over in the database forums as I'm not familiar enough with what tracing/debugging facilities on the database side to give you much help.
Regards,
Todd Little
Oracle Tuxedo Chief Architect -
I have a problem when running my own EJB as a TUXEDO service using WTC.
Hello,
I have a problem when running my own EJB as a TUXEDO service using WTC. I am using TUXEDO 8.1 and WL 9.1.
When I am trying to run my own EJB as a TUXEDO service error appears.
TPENOENT(6):0:0:TPED_MINVAL(0):QMNONE(0):0:Could not find service TOUPPER
at weblogic.wtc.gwt.WTCService.getImport(WTCService.java:4988)
at weblogic.wtc.gwt.TuxedoConnection.getImport(TuxedoConnection.java:303)
at weblogic.wtc.gwt.TuxedoConnection.tpcall(TuxedoConnection.java:1302)
at examples.MyTestSessionBean.Toupper(MyTestSessionBean.java:102)
at examples.TestSessionBean_knby6k_EOImpl.Toupper(TestSessionBean_knby6k_EOImpl.java:61)
at net.roseindia.web.servlets.SessionTestServlet.doGet(SessionTestServlet.java:69)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:272)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:165)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3153)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1973)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1880)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1310)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:179)
e8
10
java.rmi.RemoteException: EJB Exception: ; nested exception is:
java.lang.NullPointerException
at weblogic.ejb.container.internal.EJBRuntimeUtils.throwRemoteException(EJBRuntimeUtils.java:95)
at weblogic.ejb.container.internal.BaseEJBObject.handleSystemException(BaseEJBObject.java:713)
at weblogic.ejb.container.internal.BaseEJBObject.handleSystemException(BaseEJBObject.java:681)
at weblogic.ejb.container.internal.BaseEJBObject.postInvoke1(BaseEJBObject.java:447)
at weblogic.ejb.container.internal.StatelessEJBObject.postInvoke1(StatelessEJBObject.java:72)
at weblogic.ejb.container.internal.BaseEJBObject.postInvokeTxRetry(BaseEJBObject.java:374)
at examples.TestSessionBean_knby6k_EOImpl.Toupper(TestSessionBean_knby6k_EOImpl.java:75)
at net.roseindia.web.servlets.SessionTestServlet.doGet(SessionTestServlet.java:69)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:272)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:165)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3153)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1973)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1880)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1310)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:179)
Caused by: java.lang.NullPointerException
at examples.MyTestSessionBean.Toupper(MyTestSessionBean.java:130)
at examples.TestSessionBean_knby6k_EOImpl.Toupper(TestSessionBean_knby6k_EOImpl.java:61)
... 15 more
Any clue on this.
With Regards,
MVSIf you are trying to create a Tuxedo service in Java using WTC you need to develop an EJB that implements the TuxedoService interface and register its home in JNDI so WTC can look it up. Once that is done you can then export the service to a remote domain in the WTC configuration.
Regards,
Todd Little
Oracle Tuxedo Chief Architect -
Hi
I have a Tuxedo COBOL service and I have a problem: the TPSVCSTART routine it seams that not working very well.
When I start the service for the first time and I send some record to the TPSVCSTART service routine, everything goes fine. After the COBOL service is terminated (COPY TPRETURN...) and I try to connect to the service again, the VIEW record passed to the TPSVCSTART routine contains the data that I sent but contains also random chars in his string fields, although the record's string value fields and their lengths are correctly set on the client side.
Anyone knows why this is happening?
Code for the TPSVCSTART routine:
DO-TPSVCSTART.
INITIALIZE ClientData
MOVE "VIEW" TO REC-TYPE OF TPTYPE-REC.
MOVE "ClientData" TO SUB-TYPE OF TPTYPE-REC.
MOVE LENGTH OF CLIENT-DATA-REC TO LEN IN TPTYPE-REC.
CALL "TPSVCSTART" USING TPSVCDEF-REC
TPTYPE-REC
CLIENT-DATA-REC
TPSTATUS-REC.
IF TPTRUNCATE
MOVE "Input data exceeded DATA-REC length"
TO LOGMSG-TEXT
PERFORM DO-USERLOG
PERFORM EZ-EXIT.
IF NOT TPOK
MOVE "TPSVCSTART Failed" TO LOGMSG-TEXT
PERFORM DO-USERLOG
PERFORM EZ-EXIT.
IF REC-TYPE NOT = "VIEW"
MOVE "REC-TYPE is not VIEW" TO LOGMSG-TEXT
PERFORM DO-USERLOG
PERFORM EZ-EXIT.
Thanx
DanielRun the server manually using the command line from "tmboot -n -d1" and
see if it is dumping core or failing in some other manner.
Or if you already have a core file, get a stack trace with a debugger.
Paul van Rixel wrote:
Hi,
With version Tuxedo 6.4 I have a fmldef.fml with 472 entries. The number of views
is 121. So when I tried to add a service the tuxedo services will not start and
returns with an "CMDTUX_CAT:819 INFO: Process Id=.... assumed started (pipe)".
However, when I delete this service (or another one) the tmboot process does not
return an error and works fine.
So I wondered if there might be (default) value which I exceed. Anyone an idea?
Regards,
Paul -
Passing data from jsp/servlet to a Tuxedo Service thru VIEW
Hi..
We are using Tuxedo10g R3 on AIX 5.3..
We have a Tuxedo Service running which takes values from the VIEW and converts that to upper case.. From the jsp page v r passing values to the VIEW fields which will be accepted by the service..
For testing v checked the service with a tuxedo client and it is working fine..
We have defined a jolt repository file for this service and finished bulkloading and coded the servlet also.. After passing the datas from the jsp, the Tuxedo service is called and it is ended.. but in the service only blank values are passed or the datas are not passed to VIEW fields.. It is not showing any error..
The repository file for this service:
service=NSIMPSRV
export=true
inbuf=VIEW
inview=sample
outbuf=STRING
param=FIRSTSTR
type=string
access=in
param=SECONDSTR
type=string
access=in
param=THIRDSTR
type=string
access=in
param=S-FIRST
type=string
access=out
param=S-SECOND
type=string
access=out
param=S-THIRD
type=string
access=out
and the servlet code for this service:
Result result1;
ServletSessionPool servletsession = (ServletSessionPool) joltsession.getSessionPool("demojoltpool");
ServletDataSet joltdataset = new ServletDataSet();
joltdataset.setValue("FIRSTSTR","Testing");
joltdataset.setValue("SECONDSTR","Tuxedo");
joltdataset.setValue("THIRDSTR","Views");
result1 = servletsession.call("NSIMPSRV", joltdataset, null);
System.out.println("FIRSTSTR:"+result1.getValue("S-FIRST",""));
System.out.println("SECONDSTR:"+result1.getValue("S-SECOND",""));
System.out.println("THIRDSTR:"+result1.getValue("S-THIRD",""));
we are not sure why the datas have not been passed.. do anyone have any idea regarding this??
Thanks..Hi Wayne,
This is my view definition:
VIEW sample
# type cname fbna count flag size null
string firststr - 1 - 10 -
string secondstr - 1 - 10 -
string thirdstr - 1 - 10 -
ENDJolt repository file:
service=NSIMPSRV
export=true
inbuf=VIEW
inview=sample
outbuf=VIEW
outview=sample
param=FIRSTSTR
type=string
access=inout
param=SECONDSTR
type=string
access=inout
param=THIRDSTR
type=string
access=inoutThe Servlet code is:
package Servlet;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import bea.jolt.pool.servlet.weblogic.PoolManagerStartUp;
import bea.jolt.pool.servlet.*;
import bea.jolt.pool.ApplicationException;
import bea.jolt.pool.SessionPoolException;
import bea.jolt.pool.ServiceException;
import bea.jolt.pool.SessionPoolManager;
import bea.jolt.pool.*;
* Servlet implementation class ZC00582Servlet
public class VIEWServlet extends HttpServlet {
private ServletSessionPoolManager joltsession = (ServletSessionPoolManager) SessionPoolManager.poolmgr;
public VIEWServlet() {
super();
// TODO Auto-generated constructor stub
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
response.setContentType("text/html");
ServletResult result;
Result result1;
String String1 = request.getParameter("FIRSTSTR");
String String2 = request.getParameter("SECONDSTR");
String String3 = request.getParameter("THIRDSTR");
System.out.println("THE VALUES BEFORE CONVERSION");
System.out.println("FIRSTSTR:"+String1);
System.out.println("SECONDSTR:"+String2);
System.out.println("THIRDSTR:"+String3);
System.out.println("1..");
//ServletResult message;
ServletSessionPool servletsession = (ServletSessionPool) joltsession.getSessionPool("demojoltpool");
System.out.println("2..");
ServletDataSet joltdataset = new ServletDataSet();
//joltdataset.importRequest(request);
System.out.println("3..");
//joltdataset.setValue("firststr","Hi");
joltdataset.setValue("firststr",String1);
System.out.println("4..");
//joltdataset.setValue("secondstr","hello");
joltdataset.setValue("secondstr",String2);
System.out.println("5..");
//joltdataset.setValue("thridstr","fine");
joltdataset.setValue("thirdstr",String3);
System.out.println("6..");
//result = (ServletResult) servletsession.call("NSIMPSRV", joltdataset, null);
result1 = servletsession.call("NSIMPSRV", joltdataset, null);
result = (ServletResult) result1;
System.out.println("THE VALUES AFTER CONVERSION");
System.out.println("FIRSTSTR:"+result.getStringValue("firststr",""));
System.out.println("SECONDSTR:"+result.getStringValue("secondstr",""));
System.out.println("THIRDSTR:"+result.getStringValue("thirdstr",""));
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
and my server program :
IDENTIFICATION DIVISION.
PROGRAM-ID. NSIMPSRV.
AUTHOR. TUXEDO DEVELOPMENT.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
DATA DIVISION.
WORKING-STORAGE SECTION.
* Tuxedo definitions
01 TPSVCRET-REC.
COPY TPSVCRET.
01 TPTYPE-REC.
COPY TPTYPE.
01 TPSTATUS-REC.
COPY TPSTATUS.
01 TPSVCDEF-REC.
COPY TPSVCDEF.
* Log message definitions
01 LOGMSG.
05 FILLER PIC X(10) VALUE
"NSIMPSRV :".
05 LOGMSG-TEXT PIC X(50).
01 LOGMSG-LEN PIC S9(9) COMP-5.
* User defined data records
01 STRING-DATA.
COPY SAMPLE.
LINKAGE SECTION.
PROCEDURE DIVISION.
START-FUNDUPSR.
MOVE LENGTH OF LOGMSG TO LOGMSG-LEN.
MOVE "Started" TO LOGMSG-TEXT.
PERFORM DO-USERLOG.
* Get the data that was sent by the client
MOVE LENGTH OF STRING-DATA TO LEN.
CALL "TPSVCSTART" USING TPSVCDEF-REC
TPTYPE-REC
STRING-DATA
TPSTATUS-REC.
IF NOT TPOK
MOVE "TPSVCSTART Failed" TO LOGMSG-TEXT
PERFORM DO-USERLOG
PERFORM EXIT-PROGRAM
END-IF.
IF TPTRUNCATE
MOVE "Data was truncated" TO LOGMSG-TEXT
PERFORM DO-USERLOG
PERFORM EXIT-PROGRAM
END-IF.
MOVE FIRSTSTR TO LOGMSG-TEXT.
PERFORM DO-USERLOG.
MOVE SECONDSTR TO LOGMSG-TEXT.
PERFORM DO-USERLOG.
MOVE THIRDSTR TO LOGMSG-TEXT.
PERFORM DO-USERLOG.
INSPECT FIRSTSTR CONVERTING
"abcdefghijklmnopqrstuvwxyz" TO
"ABCDEFGHIJKLMNOPQRSTUVWXYZ".
INSPECT SECONDSTR CONVERTING
"abcdefghijklmnopqrstuvwxyz" TO
"ABCDEFGHIJKLMNOPQRSTUVWXYZ".
INSPECT THIRDSTR CONVERTING
"abcdefghijklmnopqrstuvwxyz" TO
"ABCDEFGHIJKLMNOPQRSTUVWXYZ".
MOVE "Success" TO LOGMSG-TEXT.
PERFORM DO-USERLOG.
MOVE STRING-DATA TO LOGMSG-TEXT.
PERFORM DO-USERLOG.
SET TPSUCCESS TO TRUE.
COPY TPRETURN REPLACING
DATA-REC BY STRING-DATA.
* Write out a log err messages
DO-USERLOG.
CALL "USERLOG" USING LOGMSG
LOGMSG-LEN
TPSTATUS-REC.
* EXIT PROGRAM
EXIT-PROGRAM.
MOVE "Failed" TO LOGMSG-TEXT.
PERFORM DO-USERLOG.
SET TPFAIL TO TRUE.
COPY TPRETURN REPLACING
DATA-REC BY STRING-DATA.
Thanks & Regards,
Janani. -
Is it possible to Remove the inbuf and outbuf tags from a SALT exposed Tuxedo Service?
Hi All,
Currently I have the need to expose my tuxedo Service in a pre-created WSDL file (with all the fields names and namespaces already defined). Searching the web and the examples presented in the Tuxedo and Salt Package, I was able to configure most of the fields but still can't remove the wrapper inbuf tag.
Is there any parameter or configuration I can use to eliminate this tag so I can expose the SALT generated WSDL the way I want? Or is it a requirement for every tuxedo service to have his input exposed that way by using SALT?
If you need anything else in order to provide an answer for this, please let me know. I'm also open to any sugestions.
Thanks in advance,
Brunno AttorreHi,
You would need to set the environment variable GWWS_WSDL_NO_BUF_WRAPPER="Y" (and restart the GWWS server).
This should prevent the <inbuf> and <outbuf> tags from being added but it may depend upon the SALT release and rolling patch
level you are using(i.e. if it is included or not)
Regards,
Bob Finan -
Can a Tuxedo service send a message to itself?
Hello,
is it possible for a Tuxedo service to send a request to itself?
The scenario is this:
- The same Tuxedo service is provided by multiple processes (for scalability). The processes are single-threaded.
- While handling a request in a transaction (XA transaction is started outside the process), the service code determines that some cached data needs to be refreshed. This refresh needs to be done outside the current transaction.
- The service send an non-transactional async request to itself (the same process). [How?]
- The transactional request completes.
- The non-transactional request is handled and refreshes the cache.
- The next transactional request is handled (by the same process), and uses the refreshed cache data.
Is this possible? The challenge seems to be that the same process gets the non-transactional request. With multiple instances of the service, any instance could normally get the request (eg. when using tpacall()).
Thanks...
RogerHi Roger,
A couple of comments:
1) There isn't any standard way of forcing a request to go to a specific server when the service is offered by multiple servers. The traditional way of handling the need to make a request to a specific server is to explicitly advertise the service with a synonym name that is unique to the server. So to call the BAL service in a particular server with a PID of 1433, the server would advertise the BAL server as BAL_1433 or something similar, and then any requests that had to be made to that particular server would be made to BAL_1433 instead of BAL. Unfortunately this is rather cumbersome and doesn't scale particularly well. One feature we are adding to Tuxedo in an upcoming release is client server affinity. With this feature an application could specify that all requests are routed to the first server that handles a service. Thus subsequent requests that are made to services while in a "session" with the server would always be routed to that server. While this client/server affinity might be a solution in the future, it's not really designed for the scenario you mention, i.e., performing an asynchronous out of band request to the same server.
2) In your scenario under the point where you ask "how?", you could use the above approach, although the call would have to be a tpacall with TPNOTRAN set (which you already indicated) but would also have to set TPNOREPLY as it appears you are planning on performing a tpreturn before processing the asynch request.
3) Obviously another solution would be to make the server multi-threaded and handling the refresh of the cache in a separate thread and not use a tpcall/tpacall to initiate the cache refresh.
4) Although not likely to be an option, the Tuxedo CORBA infrastructure will support what you are trying to do. By activating an object in a process with a process activation policy, you could make a request to that object reference and be guaranteed the request would return to that same server.
5) Finally one other possible solution, although probably inelegant and may not scale as well would be to use data dependent routing and only have a single server offering the service in each group.
As an aside, we are planning on adding a distributed data caching mechanism to Tuxedo in a future release. Yeah, I know that doesn't help right now, but it is certainly something to look forward to! :-)
Regards,
Todd Little
Oracle Tuxedo Chief Architect -
Calling Tuxedo Service using BEA Jolt.
I'm trying to call Tuxedo service from java stored procedure using BEA JOLT.My normal java client works fine but when i use the same client as java stored procedure i get following error message :
can not connect to any //lucy:9021(host:port)
Reason:Nwhdlr:can not open socket
I've successfully loaded all required JOLT jar files using loadjava and created the procedure successfully .Java code is given below :
import bea.jolt.*;
import java.sql.*;
public class JoltToTux
public static void callTuxService() throws Exception
JoltSession session;
JoltSessionAttributes sattr;
JoltRemoteService toupper;
JoltTransaction trans;
String userName=null;
String userPassword=null;
String appPassword=null;
String userRole=null;
String outstr;
try {
sattr = new JoltSessionAttributes();
sattr.setString(sattr.APPADDRESS, "//lucy:9021");
sattr.setInt(sattr.IDLETIMEOUT, 300);
session = new JoltSession(sattr, userName, userRole,userPassword, appPassword);
toupper = new JoltRemoteService ("CB_EXESUB", session);
toupper.setString("CLFY_SUB", "PingSrvr");
toupper.call(null);
System.out.println( "Call to Tuxedo complete" );
outstr = toupper.getStringDef("WF_MESSAGE","" );
System.out.println("return string : " + outstr);
session.endSession();
System.exit(0);
} //end of try
catch (Exception e) {
// System.err.println(e.getMessage());}
e.printStackTrace();
} // end main
public static void main( String args[] ) {
try {
JoltToTux jt = new JoltToTux();
jt.callTuxService();
catch ( Exception e0 ) {
e0.printStackTrace();
} // end ToUpper
thanks
anuragAms,
You can't do that with JOLT. You will need to use the WTC product,
currently in beta - see WTC Questions and Answers
Regards,
Peter.
Got a Question? Ask BEA at http://askbea.bea.com
The views expressed in this posting are solely those of the author, and
BEA
Systems, Inc. does not endorse any of these views.
BEA Systems, Inc. is not responsible for the accuracy or completeness of
the
information provided
and assumes no duty to correct, expand upon, delete or update any of the
information contained in this posting.
Ams wrote:
Hi Manoj,
I want to call a tuxedo service and also want to update
database (using entity beabs) in same transaction so I
can't use AUTOTRAN , Am I right ?
I am using bea.jolt.pool.SessionPool's startTransaction
method to start a transaction and passing this
to SessionPool's call method.
Ams.
"Manoj SASIDHARAN" <[email protected]> wrote:
Hello Ams,
Could u plz give more information abt the usage scenario. Another way
to test
would be to put AUTOTRAN=Y for the service in question.
HTH
regards
MS
"Ams" <[email protected]> wrote:
Hi,
I am calling Tuxedo service from ejb using jolt.
I want the service call in transaction started in ejb.
I am getting following error.
LIBTUX_CAT:481: ERROR: Service xa_start returned -7
Does jolt support transaction ?
Ams
[att1.html] -
Hello All,
I have written a tuxedo service which returns a VIEW via the tpreturn call.
I want to call this service from wls via wtc.
I could not find any info on how to receive VIEW structures from tuxedo
via wtc.
thanks for your help.
regards,
Abhishek.Abhishek,
VIEWs were added to WTC in WLS 7.0.
Please check the following for more info:
http://e-docs.bea.com/wls/docs70/wtc_atmi/Views.html
Bob Finan
Abhishek Srivastava wrote:
Hello All,
I have written a tuxedo service which returns a VIEW via the tpreturn
call.
I want to call this service from wls via wtc.
I could not find any info on how to receive VIEW structures from
tuxedo via wtc.
thanks for your help.
regards,
Abhishek. -
Can i write a tuxedo service using JAVA...does tuxedo provide APIs for that ?
Hi,
You can build any binary executable that calls Java and vice versa, using JNI, but then, manageing a tpreturn(3c) without getting back to the C stub sounds dangerous, when you know what tpreturn(3c) does (longjump). Put your JavaCose Caller C Function in a library, and it can be called from any C code.
Then you need to be aware that you loose some good points of Java: How can you make a ThreadDump in that context?
Also it rises new basic questions: Will Java's Multiple threads interfere with Tuxedo MultiThreaded server-side architecture? How can all the threads of your server safely share the same JVM instance? What about the classloaders? The Database connections? The XA Interface?
But if you do so, be warned about the memory leak problems you may face. Some products use that technology, but have to commit suicide every 10000 requests to avoid memory leaks.
I would strongly advice you to benchmark your executables so as to prevent that from happening...
A++
Lionel
Maybe you are looking for
-
IPod Touch Generation 1 VOLUME!!!!!
i bought the ipod touch when it first came out....1st Generation. And now i have recently bought the new update for it (3.0), but have discovered that the volume bar in the music app has gone, and due to the fact that there a no volume button s on th
-
Where do I see the price of my book?
As the title says, how do I see the price of the book I've created? Is it the price that is showed when I choose the layout? But why is the price for extra pages showed? What happens if I press the Buy button? Do I get to see the price before I confi
-
Open bookmark results in "new tab". More is not possible!
[]Opening a bookmark or entering a web address does not work. The result is only: "New tab". Also opening in the Firefox Help menu results in "New tab". By clicking on "New tab" nothing happens!
-
Links in some emails give error messages.
Using AOL Mail under Firefox I get errors stating that the site has a broken link. This happens only on emails from Ebay saved searches and some from PCH. They open fine when using Mail under AOL. This just started happening. I have been using Firefo
-
How to increase minimum font size in Safari 7
Is there a way to configure the minimum font size in Safari 7 as there was in Safari 6? It's not in the Advanced section of Preferences as it used to be. Thanks.