Hi, all.
I am trying to unpack following message with ISO87BPackager:
00ec600060800702003038058020c0020400000000000000055500008317021508300071006000376766966628721261d14032011950852100000f313131313131313132323232323232322020202020202001465f2a0209785f340100820219808407a0000000043060950500000080009a031308309c01009f02060000000005559f03060000000000009f090200029f10120110a00002220000000000000000000000ff9f1a0206889f1e0831323334353637369f26081c51d51a3233cbe59f2701809f3303e008089f34031f03009f3501229f360200f29f3704043729d19f41030000840006303030303834
Message (manually decomposed) is:
len 00ec
hdr 6000608007
mti 0200
bmp 3038058020c00204
f0 000000
f4 000000000555
f11 000083
f12 170215
f13 0830
f22 0071
f24 0060
f25 00
f35 376766966628721261d14032011950852100000f
f41 3131313131313131
f42 323232323232323220202020202020
f55 0146 5f2a0209785f340100820219808407a0000000043060950500000080009a031308309c01009f02060000000005559f03060000000000009f090200029f10120110a00002220000000000000000000000ff9f1a0206889f1e0831323334353637369f26081c51d51a3233cbe59f2701809f3303e008089f34031f03009f3501229f360200f29f3704043729d19f4103000084
f62 0006 303030303834
I am getting the following exception:
org.jpos.iso.IFB_LLLCHAR: Problem unpacking field 62
<nested-exception>
java.lang.ArrayIndexOutOfBoundsException: 236
at org.jpos.iso.AsciiInterpreter.uninterpret(AsciiInterpreter.java:55)
at org.jpos.iso.ISOStringFieldPackager.unpack(ISOStringFieldPackager.java:173)
at org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:233)
at org.jpos.iso.ISOMsg.unpack(ISOMsg.java:416)
at org.jpos.iso.BaseChannel.unpack(BaseChannel.java:901)
at org.jpos.iso.BaseChannel.receive(BaseChannel.java:669)
at org.jpos.iso.ISOServer$Session.run(ISOServer.java:131)
at org.jpos.util.ThreadPool$PooledThread.run(ThreadPool.java:71)
I am using 1.6.8 version of jPOS, and BcdPrefixer is returning 2305 as len when ISOStringFieldPackager begins unpacking from offset 209.
While debugging i found out that after throwing exception at line 173 in ISOStringFieldPackager len becomes set to 6.
public int unpack(ISOComponent c, byte[] b, int offset) throws ISOException
{
try
{
int len = prefixer.decodeLength(b, offset);
if (len == -1)
{
// The prefixer doesn't know how long the field is, so use
// maxLength instead
len = getLength();
}
int lenLen = prefixer.getPackedLength();
173 String unpacked = interpreter.uninterpret(b, offset + lenLen, len);
c.setValue(unpacked);
return lenLen + interpreter.getPackedLength(len);
} catch(Exception e)
{
throw new ISOException(makeExceptionMessage(c, "unpacking"), e);
}
}
I would appreciate any help on this.