iso exceptions

54 views
Skip to first unread message

mwyc...@gmail.com

unread,
Nov 24, 2009, 3:13:04 AM11/24/09
to jPOS Users
Good day all,

Hope you doing fine.

I have some issue regarding JPOS iso exceptions, many times when you
get a problem on unpacking fields,
the logs usually report a different field instead of the actual field
that has the problem.
Foreinstance, I have this piece of stack trace, where the system
reports a problem while unpacking Field 20,
but when you analyse the BITMAP, you realise that field 20 actually
doesn't exist.
I wonder what causes this kind of behaviour, please advise.

Below is part of stack trace.

<log realm="z4-server-PostBridge.server.channel/192.168.20.225:9080"
at="Thu Nov 19 12:41:09 GMT+03:00 2009.687">
<receive>
<iso-exception>
org.jpos.iso.IFA_NUMERIC: Problem unpacking field 20
<nested-exception>
java.lang.ArrayIndexOutOfBoundsException: 164
at org.jpos.iso.AsciiInterpreter.uninterpret(AsciiInterpreter.java:
88)
at org.jpos.iso.ISOStringFieldPackager.unpack
(ISOStringFieldPackager.java:204)
at org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:229)
at org.jpos.iso.ISOMsgFieldPackager.unpack(ISOMsgFieldPackager.java:
107)
at org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:229)
at org.jpos.iso.ISOMsg.unpack(ISOMsg.java:322)
at org.jpos.iso.BaseChannel.receive(BaseChannel.java:531)
at org.jpos.iso.ISOServer$Session.run(ISOServer.java:123)
at org.jpos.util.ThreadPool$PooledThread.run(ThreadPool.java:100)
</nested-exception>
org.jpos.iso.ISOException: org.jpos.iso.IFA_NUMERIC: Problem
unpacking field 20 (java.lang.ArrayIndexOutOfBoundsException: 164)
at org.jpos.iso.ISOStringFieldPackager.unpack
(ISOStringFieldPackager.java:209)
.
.
.
at org.jpos.util.ThreadPool$PooledThread.run(ThreadPool.java:100)
</iso-exception>
--- data ---
0000 30 34 32 31 F2 3E 44 95 2E E0 81 20 00 00 00 42
0421.>D.... ...B
0010 14 00 00 22 31 36 36 33 39 36 32 39 30 30 30
30 ..."166396290000
0020 30 30 30 30 33 30 33 38 32 30 30 30 30 30 30 30
0000303820000000
0030 30 30 30 30 30 30 30 30 31 31 31 39 31 31 32 38
0000000011191128
0040 34 37 30 30 30 34 32 37 31 31 32 38 34 37 31 31
4700042711284711
0050 31 39 31 34 31 32 31 31 31 39 36 30 31 32 30 30
1914121119601200
0060 30 30 37 43 30 30 30 30 30 30 30 30 43 30 30 30
007C00000000C000
0070 30 30 30 30 30 30 36 36 33 39 36 32 39 32 32 36
0000006639629226
0080 33 39 36 32 39 30 30 30 30 30 30 30 30 33 30 3D
396290000000030=
0090 31 34 31 32 3D 30 30 30 30 31 32 31 31 32 38 34
1412=00001211284
00a0 37 31 31 32 39 30 31 36 38 32 33 33 33 34 34 34
7112901682333444

When I break down the BITMAP,
MTI - 30343231
BITMAP - F23E44952EE08120 0000004214000022

The primary bitmap does not indicate existance of field 20, but the
iso exceptions is refering to field 2o.

I will grateful for any assistance,

thanks&regards,

Victor Salaman

unread,
Nov 24, 2009, 3:51:55 AM11/24/09
to jpos-...@googlegroups.com

Your packager is not understanding the data being read.


--
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,
Nov 24, 2009, 4:18:16 AM11/24/09
to jpos-...@googlegroups.com
mwyc...@gmail.com wrote:

> I have some issue regarding JPOS iso exceptions, many times when you
> get a problem on unpacking fields,
> the logs usually report a different field instead of the actual field
> that has the problem.
The exception will be thrown at the time a problem is noticed, most
often on finding a length that is too big for the field, finding a
length that exceeds the remaining message bytes or running off the end
trying to process a field that is not present.

> Foreinstance, I have this piece of stack trace, where the system
> reports a problem while unpacking Field 20,
> but when you analyse the BITMAP, you realise that field 20 actually
> doesn't exist.
The the packager is taking the wrong piece of message bytes as the
bitmap - you have a misalignment between your packager and the message.
Perhaps what you 'see' as the bitmap is not what you have told jPos is
the bitmap.

Perhaps also confirm that this failing message is not malformed in some
way, it *might* be the sending system that has a problem?

You can add a logger to the packager to see what bytes are going into
the various fields, if you have already check that your packager matches
the interface structure.

--
Mark

mwyc...@gmail.com

unread,
Nov 25, 2009, 3:17:05 AM11/25/09
to jPOS Users
Thanks for all the ideas,

> You can add a logger to the packager to see what bytes are going into
> the various fields, if you have already check that your packager matches
> the interface structure.

How can I add a logger to my packager?
I already have this piece code in my PostPackager class, is this what
you meant?

public void setLogger(Logger logger, String s)
{
super.setLogger(logger, s);
p127.setLogger(logger, s + ".PostPrivatePackager");
}
I also use this to do the hexdump for the msg;
System.out.println(ISOUtil.hexdump(isomsg.pack()));

How else can I be able to print out or dump the incoming message,
before it gets to
the point where the iso-exceptions are thrown?

> The the packager is taking the wrong piece of message bytes as the
> bitmap - you have a misalignment between your packager and the message.

How can I correct this misalignment?
Meanwhile, I did configure my packager to match the Interface
structure.

thanks&regards,


On Nov 24, 12:18 pm, Mark Salter <marksal...@talktalk.net> wrote:

Mark Salter

unread,
Nov 25, 2009, 4:33:11 AM11/25/09
to jpos-...@googlegroups.com
mwyc...@gmail.com wrote:

>> You can add a logger to the packager to see what bytes are going into
>> the various fields, if you have already check that your packager matches
>> the interface structure.
>
> How can I add a logger to my packager?
Perhaps "give your packager a logger" is a better way to describe it?

Logger logger = new Logger();
logger.addListener (new SimpleLogListener (System.out));
packager.setLogger (logger, "Packager");

>> The the packager is taking the wrong piece of message bytes as the
>> bitmap - you have a misalignment between your packager and the message.
>
> How can I correct this misalignment?
Make sure the packager you are using completely matches the interface
you are asking it to deal with.

> Meanwhile, I did configure my packager to match the Interface
> structure.
And?


--
Mark

mwyc...@gmail.com

unread,
Nov 26, 2009, 2:01:22 AM11/26/09
to jPOS Users
Thanks Mark,

Let me proceed with adding the Logger to my packager.
> Logger logger = new Logger();
> logger.addListener (new SimpleLogListener (System.out));
> packager.setLogger (logger, "Packager");

Will this piece of code out put for me the incoming message before it
gets to the iso-exception handler??

As for the alignment of the packager with the Interface interchange
spec, I did that already.

best regards,

On Nov 25, 12:33 pm, Mark Salter <marksal...@talktalk.net> wrote:

Mark Salter

unread,
Nov 26, 2009, 2:36:41 AM11/26/09
to jpos-...@googlegroups.com
mwyc...@gmail.com wrote:

>> Logger logger = new Logger();
>> logger.addListener (new SimpleLogListener (System.out));
>> packager.setLogger (logger, "Packager");
>
> Will this piece of code out put for me the incoming message before it
> gets to the iso-exception handler??

This will allow the packager to output the data and subsequent fields
as it packs and unpacks the data for/from the Channel

--
Mark
Reply all
Reply to author
Forward
0 new messages