Problem to Getting ISORequest from Transaction Context in Txn Manager for Some Transactions

174 views
Skip to first unread message

sridhar

unread,
Dec 8, 2011, 1:33:57 PM12/8/11
to jpos-...@googlegroups.com
Hi,

We have faced problem for Transaction Context .

We have sent multiple json requests by the help of Apache Jakarta JMeter.

we have used Apache Jakarta JMeter , through which at a time we can sent
Multiple Transactions from Multipl Users.

Our Rest JSON Web Service sent the requests to Q2 Server by converting json
to ISOMsg and also received the ISOMsg and sent to Jakrata JMeter by
converting ISOMsg to JSON.

In this process, we successfully done the transaction end to end from VT to
Gateway through Web Services.

But we have faced the problems when multiple users at a time hit the
requests to Q2 Server.

We have gone through Following steps to handle the Transactions in Q2
Server.
1.Q2 Server received the requests by ISOMsg Request Listener.
2.ISOMsg Request Listener put the ISO Request and ISO Source in Context.
3.we put the Context into Transaction Manager Acquirer Space.
4.All the Transaction Participants under the Acquirer Transaction Manager
acessed the Context by extending Transaction Participant.
5.In this Process we have handled the Transactions.

But When We hit multiple transactions and we acessed the IsoRequest in
Transaction Participant by getting it from Transaction Context,
it is returning null for some Transactions.
that is we have not found the ISORequest from Transaction Context.
these are happening in very small time interval.

We are going to released in Production.
In Production How it will handled the multiple transactions from Multiple
Users.

Please Guide us ,How can we Resolved the Issue.

--
View this message in context: http://jpos.1045706.n5.nabble.com/Problem-to-Getting-ISORequest-from-Transaction-Context-in-Txn-Manager-for-Some-Transactions-tp5059716p5059716.html
Sent from the jPOS - Users mailing list archive at Nabble.com.

Mark Salter

unread,
Dec 8, 2011, 2:21:04 PM12/8/11
to jpos-...@googlegroups.com
On 08/12/2011 18:33, sridhar wrote:

> We have gone through Following steps to handle the Transactions in Q2
> Server.

Can you share your TransactionManager config?

>
> But When We hit multiple transactions and we acessed the IsoRequest in
> Transaction Participant by getting it from Transaction Context,
> it is returning null for some Transactions.

Is the ISOSource *also* null?

Are you certain that you packager and Channel are correct?

You can add Loggers to most if not all of your components, to check that
at the ISO level everything is working.

What version of jpos-ee are you using?

> We are going to released in Production.
> In Production How it will handled the multiple transactions from Multiple
> Users.

If nothing changes, then I would guess your set-up will fail there too?

I would imagine going into production with this error is not possible.

Please check your license conditions too.

--
Mark

sridhar

unread,
Dec 8, 2011, 11:23:51 PM12/8/11
to jpos-...@googlegroups.com

We have Used XMLChannel and XMLPackager both in client and server.
Sir, These are the configuration for Server and Transaction Manager.
Can You confirm us how the problem is happening for certain Transactions.

When We Traced , it found that we can't found the ISO Request from
Transaction Context.
We got the following Error at the time of getting Request from Context.

Error At the Time of getting ISO Request from Context to Validate Amount:-

ISOException in
com.transactionmgr.acquirer.txnparticipants.MerchVelocityParticipant :
java.lang.NullPointerException

Error for Sending Response for that particular Transaction as mentioned
above:-

<send>
<iso-exception>
unconnected ISOChannel
org.jpos.iso.ISOException: unconnected ISOChannel
at org.jpos.iso.BaseChannel.send(BaseChannel.java:519)
at
com.payhub.transactionmgr.acquirer.txnparticipants.AcquirerResponse.prepare(AcquirerResponse.java:67)
at
org.jpos.transaction.TransactionManager.prepare(TransactionManager.java:417)
at
org.jpos.transaction.TransactionManager.prepare(TransactionManager.java:468)
at org.jpos.transaction.TransactionManager.run(TransactionManager.java:248)
at java.lang.Thread.run(Thread.java:619)

Server Configuration:
--------------------
<server class="org.jpos.q2.iso.QServer" logger="Q2" name="simulator_100">
<attr name="port" type="java.lang.Integer">8081</attr>
<attr name="minSessions" type="java.lang.Integer">100</attr>
<attr name="maxSessions" type="java.lang.Integer">150</attr>

<channel class="org.jpos.iso.channel.XMLChannel" logger="Q2"
packager="org.jpos.iso.packager.XMLPackager">
</channel>

<request-listener class="com.payhub.isomsglistner.ISOMsgRequestListener"
logger="Q2">
</request-listener>

</server>

Transaction Manager Configuration:
-----------------------------------

<txnmgr-acquirer class="com.payhub.transactionmgr.acquirer.AcquirerTxnMgr"
logger="Q2">
<property name="queue" value="TXNMGRQ" />
<property name="sessions" value="50" />
<property name="persistent-space" value="tspace:txnmgr" />
<property name="debug" value="true" />

<participant
class="com.payhub.transactionmgr.acquirer.txnswitch.AcquirerSwitch"
logger="Q2">
<property name="TRANSACTION_REQUEST" value="TransactionRequestType" />
<property name="ISSUER_AUTH" value="InsertDatabase,Response" />
<property name="ISSUER_BATCH" value="InsertDatabase,Response" />
</participant>

<group name="TransactionRequestType">
<participant
class="com.payhub.transactionmgr.acquirer.txnparticipants.TransactionRequestType"
logger="Q2">
<property name="AUTH" value="TransactionCardType" />
</participant>
</group>

<group name="TransactionCardType">
<participant
class="com.payhub.transactionmgr.acquirer.txnparticipants.TransactionCardType"
logger="Q2">
<property name="CREDIT" value="CreditTransaction" />
<property name="DEBIT" value="DebitTransaction" />
</participant>
</group>


<group name="InsertDatabase">
<participant
class="com.payhub.transactionmgr.acquirer.txnparticipants.UpdateTransaction"
logger="Q2"/>
</group>

<group name="Response">
<participant
class="com.payhub.transactionmgr.acquirer.txnparticipants.AcquirerResponse"
logger="Q2"/>
</group>


</txnmgr-acquirer>

--
View this message in context: http://jpos.1045706.n5.nabble.com/Problem-to-Getting-ISORequest-from-Transaction-Context-in-Txn-Manager-for-Some-Transactions-tp5059716p5060721.html

Mark Salter

unread,
Dec 9, 2011, 2:21:30 AM12/9/11
to jpos-...@googlegroups.com
On 09/12/2011 04:23, sridhar wrote:
>
> We have Used XMLChannel and XMLPackager both in client and server.
Ok, great. I just wanted to eliminate the chance of an error on your
handling/definition of the interface that might be generating odd results.

> Sir, These are the configuration for Server and Transaction Manager.
> Can You confirm us how the problem is happening for certain Transactions.
>
> When We Traced , it found that we can't found the ISO Request from
> Transaction Context.
> We got the following Error at the time of getting Request from Context.
>
> Error At the Time of getting ISO Request from Context to Validate Amount:-
>
> ISOException in
> com.transactionmgr.acquirer.txnparticipants.MerchVelocityParticipant :
> java.lang.NullPointerException

Is there any more detail (length) on this Exception at all?

I'm not sure I recognise this class at all? How is it related to the
Exception in the log below?

>
> Error for Sending Response for that particular Transaction as mentioned
> above:-
>
> <send>
> <iso-exception>
> unconnected ISOChannel
> org.jpos.iso.ISOException: unconnected ISOChannel
> at org.jpos.iso.BaseChannel.send(BaseChannel.java:519)
> at
> com.payhub.transactionmgr.acquirer.txnparticipants.AcquirerResponse.prepare(AcquirerResponse.java:67)
> at
> org.jpos.transaction.TransactionManager.prepare(TransactionManager.java:417)
> at
> org.jpos.transaction.TransactionManager.prepare(TransactionManager.java:468)
> at org.jpos.transaction.TransactionManager.run(TransactionManager.java:248)
> at java.lang.Thread.run(Thread.java:619)
>
>

Is the Channel being disconnected by the remote end? Why, do you know,
perhaps they did not like the previous response ?
What does the response look like on this send; what about the previous one?
Is the request null and this response null?

Is there a third party that might have detail to add as to what is
happening?

--
Mark

sridhar

unread,
Dec 9, 2011, 3:24:42 AM12/9/11
to jpos-...@googlegroups.com
Hi Sir, We have got only NULL pointer Exception in Transaction Participant . Because when we try to got ISO request from Context. i think that IsoRequest will not present in Context. So that it will throw null pointer exception. This is the Coding for ISOMsg Request Listener. public boolean process(final ISOSource isoSource, final ISOMsg isoMsg){ logger = new TxnLogger(isoSource); Space space = SpaceFactory.getSpace(); Context context=new Context(); context.put("ISOSOURCE", isoSource); context.put("REQUEST_MSG", isoMsg); space.out("TXNMGRQ", context,1200000); Space space1 = SpaceFactory.getSpace("tspace:demo"); space1.put("demo", context,1200000); return true; } Sir, For Testing. We have created two spaces: 1. one for Transaction Manager ( Space space = SpaceFactory.getSpace();) 2 .Second One for Testing Purpose.( Space space1 = SpaceFactory.getSpace("tspace:demo");) we put the context into Transaction Manager Space and at the same time we also put the same context into space1. But in prepare method of Transaction Participants for certain Transactions, We do not get the ISO request from the Context. and we got every ISO request from space1 that is we manually put the Context into space1. Sir I am confusing , 1. Actually when we put the context into Transaction Manager, contexts are properly inserted into space or not. 2. we have configured the space in transaction manager is, But in ISOMsg request Listener we put the context into space. Space space = SpaceFactory.getSpace(); So, How the spaces are different how they communicate with each other. 3. is there any way that,when we put the context in ISOMsg Request Listener so that it automatically get in Transaction Participants . Sir ,Please Guide me , so that i can solve the issue as soon as possible.

View this message in context: Re: [jpos-users] Problem to Getting ISORequest from Transaction Context in Txn Manager for Some Transactions

sridhar

unread,
Dec 9, 2011, 3:25:33 AM12/9/11
to jpos-...@googlegroups.com
Hi Sir, We have got only NULL pointer Exception in Transaction Participant . Because when we try to got ISO request from Context. i think that IsoRequest will not present in Context. So that it will throw null pointer exception. This is the Coding for ISOMsg Request Listener. public boolean process(final ISOSource isoSource, final ISOMsg isoMsg){ logger = new TxnLogger(isoSource); Space space = SpaceFactory.getSpace(); Context context=new Context(); context.put("ISOSOURCE", isoSource); context.put("REQUEST_MSG", isoMsg); space.out("TXNMGRQ", context,1200000); Space space1 = SpaceFactory.getSpace("tspace:demo"); space1.put("demo", context,1200000); return true; } Sir, For Testing. We have created two spaces: 1. one for Transaction Manager ( Space space = SpaceFactory.getSpace();) 2 .Second One for Testing Purpose.( Space space1 = SpaceFactory.getSpace("tspace:demo");) we put the context into Transaction Manager Space and at the same time we also put the same context into space1. But in prepare method of Transaction Participants for certain Transactions, We do not get the ISO request from the Context. and we got every ISO request from space1 that is we manually put the Context into space1. Sir I am confusing , 1. Actually when we put the context into Transaction Manager, contexts are properly inserted into space or not. 2. we have configured the space in transaction manager is, But in ISOMsg request Listener we put the context into space. Space space = SpaceFactory.getSpace(); So, How the spaces are different how they communicate with each other. 3. is there any way that,when we put the context in ISOMsg Request Listener so that it automatically get in Transaction Participants . Sir ,Please Guide me , so that i can solve the issue as soon as possible.

View this message in context: Re: [jpos-users] Problem to Getting ISORequest from Transaction Context in Txn Manager for Some Transactions

sridhar

unread,
Dec 9, 2011, 3:48:18 AM12/9/11
to jpos-...@googlegroups.com
Hi Sir,
We have got only NULL pointer Exception in Transaction Participant .
Because when we try to got ISO request from Context.

I think that IsoRequest will not present in Context. So that it will throw
null pointer exception.

-----Original Message-----
From: jpos-...@googlegroups.com [mailto:jpos-...@googlegroups.com] On
Behalf Of Mark Salter
Sent: Friday, December 09, 2011 12:52 PM
To: jpos-...@googlegroups.com
Subject: Re: [jpos-users] Problem to Getting ISORequest from Transaction
Context in Txn Manager for Some Transactions

--
Mark

--
jPOS is licensed under AGPL - free for community usage for your open-source
project. Licenses are also available for commercial usage.
Please support jPOS, contact: sa...@jpos.org

You received this message because you are subscribed to the "jPOS Users"
group.
Please see http://jpos.org/wiki/JPOS_Mailing_List_Readme_first
To post to this group, send email to jpos-...@googlegroups.com
To unsubscribe, send email to jpos-users+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/jpos-users

Mark Salter

unread,
Dec 9, 2011, 5:10:17 PM12/9/11
to jpos-...@googlegroups.com
Sridhar, can you have a go at answering my questions below please?

Mark Salter

unread,
Dec 9, 2011, 5:40:47 PM12/9/11
to jpos-...@googlegroups.com
On 09/12/2011 08:48, sridhar wrote:
> Hi Sir,
> We have got only NULL pointer Exception in Transaction Participant .
> Because when we try to got ISO request from Context.
I asked as I wondered if the ISOSource was also null, indicating that
the context you are retrieving them from is totally empty and perhaps a
different context?

>
> I think that IsoRequest will not present in Context. So that it will throw
> null pointer exception.

The full exception trace will show a strong hint of what object or
reference was null...

>
> This is the Coding for ISOMsg Request Listener.
>
> public boolean process(final ISOSource isoSource, final ISOMsg isoMsg){
> logger = new TxnLogger(isoSource);
> Space space = SpaceFactory.getSpace();
> Context context=new Context();
> context.put("ISOSOURCE", isoSource);
> context.put("REQUEST_MSG", isoMsg);
> space.out("TXNMGRQ", context,1200000);

So one (default) space gets a context onto queue TXNMGRQ...


> Space space1 = SpaceFactory.getSpace("tspace:demo");
> space1.put("demo", context,1200000); return true;

and another space gets a reference on a queue called demo too.

[Thinks] - is this a separate copy or a duplicate reference to the same
item...
... within a single VM, they is only *one* context!

Also *beware*, you are using put which places an object at the head of
the queue and *discards* all other objects in that queue. I think you
should be using space.out instead!

> }
>
> Sir, For Testing. We have created two spaces:
> 1. one for Transaction Manager ( Space space = SpaceFactory.getSpace();)
> 2 .Second One for Testing Purpose.( Space space1 =
> SpaceFactory.getSpace("tspace:demo");)

Ok, two spaces with a queue in each holding *one* context object. Each
queue holds *only* the *last* object put there (others are thrown away
if there were any)!

>
> we put the context into Transaction Manager Space and at the same time we
> also put the same context into space1.

Agreed and as you .put you empty the space's queue of any that were
already there - use .out instead.

> But in prepare method of Transaction Participants for certain Transactions,
>

Ok, so some transactions are fed into TransactionManager but not all.

>
> We do not get the ISO request from the Context. and we got every ISO request
> from space1 that is we manually put the Context into space1. Sir I am
> confusing ,
>
> 1. Actually when we put the context into Transaction Manager, contexts are
> properly inserted into space or not.

If you put an object on a queue, it will be there until it timesout or
is get.

> 2. we have configured the space in transaction manager is, But in ISOMsg
> request Listener we put the context into space. Space space =
> SpaceFactory.getSpace();

Because you have not specified a space for the TransactionManager to use
it uses the default space which is the same.

>
> So, How the spaces are different how they communicate with each other.

The spaces are in a single java VM and each holds a queue on which are
two references to the same context - but only the last object .put!

>
> 3. is there any way that,when we put the context in ISOMsg Request Listener
> so that it automatically get in Transaction Participants .

Placing a context on the queue that a TransactionManager is listening on
*is* the way.

So in summary :-

- don't use space.put unless you really mean to.
- don't do anything with the context in one queue that affects the
object and might render it useless in the other queue.
- try using space.out instead; I suspect this is the issue.


--
Mark

Reply all
Reply to author
Forward
0 new messages