Unpacking field 62 with ISO87BPackager

154 views
Skip to first unread message

Dragan Krstić

unread,
Sep 1, 2013, 5:00:57 AM9/1/13
to jpos-...@googlegroups.com
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.

chhil

unread,
Sep 1, 2013, 1:14:14 PM9/1/13
to jpos-users

Not sure if this will help, but try a LL packager. The 4 wide binary length will probably get interpreted  correctly.

You have yours setup with 3 L's

-chhil

--
--
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
 
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Dragan Krstic

unread,
Sep 2, 2013, 4:47:00 PM9/2/13
to jpos-...@googlegroups.com
Found it.
It was the unexpected header that broke message decoding.

Thanks anyway.
--
Dragan Krstić
gsm: +381 (0)63 223 580

Alejandro Revilla

unread,
Sep 2, 2013, 4:48:48 PM9/2/13
to jPOS Users

If you use NACChannel, and you set an appropriate header (such as 6000000000), jPOS should take care of this issue for you.


--
@apr

Reply all
Reply to author
Forward
0 new messages