I am trying to setup a testing sample using jpos-ee simulator.
I set up server simulator using a VAPChannel and GenericPackager with
configuration base1.xml. Connect VTS200 (visa test suit tool) to the
server, fire an authorisation msg, and get OK response. All works fine.
The VST can generate msg one at a time, and needed intervention
(clicking/pressing send button), which is not good for automation. So I
tried to replace the VTS with jpos-ee client simulator. Trouble is I
was not successful :-(
I setup the client simulator to use a matching VAPChannel and
GenericPackager with base1.xml configuration. I also changed the
TestRunner.java to used GenericPackager as well:
protected void initService() throws ISOException {
//packager = new XMLPackager();
packager = new GenericPackager("cfg/packager/base1.xml");
}
But I keep getting message unpackacging errors:
===============================================
<log realm="org.jpos.simulator.TestRunner" at="Fri May 13 11:32:01
GMT+08:00 200
5.479">
<error>
<iso-exception>
org.jpos.iso.IFE_CHAR: Problem unpacking field 38
<nested-exception>
java.lang.ArrayIndexOutOfBoundsException: 239
at org.jpos.iso.ISOUtil.ebcdicToAsciiBytes(ISOUtil.java:231)
at org.jpos.iso.ISOUtil.ebcdicToAscii(ISOUtil.java:218)
at
org.jpos.iso.EbcdicInterpreter.uninterpret(EbcdicInterpreter.java:71)
at
org.jpos.iso.ISOStringFieldPackager.unpack(ISOStringFieldPackager.jav
a:204)
at
org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:229)
at org.jpos.iso.ISOMsg.unpack(ISOMsg.java:322)
at
org.jpos.simulator.TestRunner.getMessage(TestRunner.java:173)
at org.jpos.simulator.TestRunner.initSuite(TestRunner.java:148)
at org.jpos.simulator.TestRunner.run(TestRunner.java:75)
at java.lang.Thread.run(Unknown Source)
</nested-exception>
org.jpos.iso.ISOException: org.jpos.iso.IFE_CHAR: Problem
unpacking field
38 (java.lang.ArrayIndexOutOfBoundsException: 239)
at
org.jpos.iso.ISOStringFieldPackager.unpack(ISOStringFieldPackager.jav
a:209)
at
org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:229)
at org.jpos.iso.ISOMsg.unpack(ISOMsg.java:322)
at
org.jpos.simulator.TestRunner.getMessage(TestRunner.java:173)
at org.jpos.simulator.TestRunner.initSuite(TestRunner.java:148)
at org.jpos.simulator.TestRunner.run(TestRunner.java:75)
at java.lang.Thread.run(Unknown Source)
Nested:java.lang.ArrayIndexOutOfBoundsException: 239
at org.jpos.iso.ISOUtil.ebcdicToAsciiBytes(ISOUtil.java:231)
at org.jpos.iso.ISOUtil.ebcdicToAscii(ISOUtil.java:218)
at
org.jpos.iso.EbcdicInterpreter.uninterpret(EbcdicInterpreter.java:71)
at
org.jpos.iso.ISOStringFieldPackager.unpack(ISOStringFieldPackager.jav
a:204)
at
org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:229)
at org.jpos.iso.ISOMsg.unpack(ISOMsg.java:322)
at
org.jpos.simulator.TestRunner.getMessage(TestRunner.java:173)
at org.jpos.simulator.TestRunner.initSuite(TestRunner.java:148)
at org.jpos.simulator.TestRunner.run(TestRunner.java:75)
at java.lang.Thread.run(Unknown Source)
</iso-exception>
</error>
</log>
==============================================
Running the whole thing using XMLChannel and XMLPackager is just fine.
And since the server simulator when configured for VTS client works OK
too, then I must have messed up my client simulator. :-(
Has anyone sucessfully simulating Visa Client using jpos-ee's client
simulator? I would much appreciate any help/pointer here (a simple
sample script would be great!).
Thanks,
/bernard
Thanks Alejandro!!
My error was actually my replacing of the XMLPackager with Base1
GenericPakacger in TestRunner.java. All I needed to workout were to
simply match the server simulator & client simulator channels correctly
(+ their respective packagers), there were no need to change the
TestRunner.java at all.
Neat Stuffs!
ps. I notice that the jpos-ee download comes with xerces-1.2.3.jar.
shouldn't we use a more recent one? Is the jar is intentionally there
for backward compatibility purpose (jdk 1.3)?
Thanks,
/bernard
OK I see.
Perhaps updating to xerces-2.6.2.jar to reduce the jar size?
xerces-2.6.2.jar size = 988 kb
xerces-1.2.3.jar size = 1465 kb
> BTW, I've added a new target to 'build.xml' called 'singlejar'
> that creates a huge jpos-ee.jar with all required jars. That task
> will benefit from not having xerces around. If you want to test
> it, you can 'ant update' your SDK installation.
>
I just run ant update task from the root of jpos-ee. The build file
still does not has 'singlejar' task. Perhaps I should wait abit longger
....
Thanks,
/bernard
> Could be an temporary solution, can you give it a try?
> (if clientsimulator works then that means XMLPackager is
> working).
Replacing xerces-1.2.3.jar with xerces-2.6.2.jar on jdk-1.4 or greater
is OK. Not sure (not tested) on older jdk though.
>> I just run ant update task from the root of jpos-ee. The build file
>> still does not has 'singlejar' task. Perhaps I should wait abit
longger
>> ....
> Oops, my fault. Please 'ant update' again.
OK, got it already. Thanks.