Unpacking exception

89 views
Skip to first unread message

Fahimeh

unread,
Jun 20, 2010, 5:30:21 AM6/20/10
to jPOS Users
Hi.
I hope everything is ok for you.

When my client (POS device) sending data to server i got a exception.
I think the server couldn't unpacking data correctly.
I don't know why!
How can i solve this problem?!

That is the importent part of my server class:

/
***************************************************************************************/
ServerChannel channel = new NCCChannel(new ISO87APackager(), null);
((LogSource) channel).setLogger(logger, "channel");
ISOServer server = new ISOServer(3200, channel, null);
/
**************************************************************************************/


and the exception :


<iso-exception>
org.jpos.iso.IF_CHAR: Problem unpacking field 51
<nested-exception>
java.lang.StringIndexOutOfBoundsException: String index out of
range: 115
at java.lang.String.checkBounds(String.java:401)
at java.lang.String.<init>(String.java:442)
at
org.jpos.iso.LiteralInterpreter.uninterpret(LiteralInterpreter.java:
51)
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)
</nested-exception>
org.jpos.iso.ISOException: org.jpos.iso.IF_CHAR: Problem
unpacking field 51 (java.lang.StringIndexOutOfBoundsException: String
index out of range: 115)
at
org.jpos.iso.ISOStringFieldPackager.unpack(ISOStringFieldPackager.java:
178)
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)
Nested:java.lang.StringIndexOutOfBoundsException: String index out of
range: 115
at java.lang.String.checkBounds(String.java:401)
at java.lang.String.<init>(String.java:442)
at
org.jpos.iso.LiteralInterpreter.uninterpret(LiteralInterpreter.java:
51)
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)
</iso-exception>
.
.
.
--- data ---
0000 60 00 01 00 07 02 20 70 3C 05 80 00 C0 00 0A 08 `.....
p<.......
0010 0E 74 B8 AC 00 00 00 00 00 00 00 00 21 00 22
56 .t..........!."V
0020 14 47 39 03 11 91 03 00 10 00 01 00 30 31 30
32 .G9.........0102
0030 30 31 34 37 52 46 30 30 31 30 31 30 20 20 20 20
0147RF001010
0040 20 20 20 00 05 32 2E 30 2E 30 00 38 30 30 30 30 ..
2.0.0.80000
0050 30 30 30 30 30 30 35 30 30 31 30 32 30 31 34 37
0000005001020147
0060 30 30 30 35 30 37 30 30 30 30 30 30 30 30 30 36
0005070000000006
0070 32 31
.
.
.
<session-error>
<iso-exception>
org.jpos.iso.IF_CHAR: Problem unpacking field 51
<nested-exception>
java.lang.StringIndexOutOfBoundsException: String index out of
range: 115
at java.lang.String.checkBounds(String.java:401)
at java.lang.String.<init>(String.java:442)
at
org.jpos.iso.LiteralInterpreter.uninterpret(LiteralInterpreter.java:
51)
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)
</nested-exception>
org.jpos.iso.ISOException: org.jpos.iso.IF_CHAR: Problem
unpacking field 51 (java.lang.StringIndexOutOfBoundsException: String
index out of range: 115)
at
org.jpos.iso.ISOStringFieldPackager.unpack(ISOStringFieldPackager.java:
178)
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)
Nested:java.lang.StringIndexOutOfBoundsException: String index out of
range: 115
at java.lang.String.checkBounds(String.java:401)
at java.lang.String.<init>(String.java:442)
at
org.jpos.iso.LiteralInterpreter.uninterpret(LiteralInterpreter.java:
51)
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)
</iso-exception>
</session-error>

Mark Salter

unread,
Jun 20, 2010, 1:57:39 PM6/20/10
to jpos-...@googlegroups.com
On 20/06/2010 10:30, Fahimeh wrote:
> How can i solve this problem?!
Add a Logger to your Packager and also make sure you have made sure your
packager (ISO87APackager) matches the structure of the message you are
receiving field for field.

--
Mark

chhil

unread,
Jun 20, 2010, 9:28:37 PM6/20/10
to jpos-users
Your packager is not aligned with the data element type.
Try to use your ISOMsg object and put field 51 and see what the dump
looks like and how it differs from the data you are receiving, this
should help you fix the format of that field.

-chhil

> --
> 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,
Jun 21, 2010, 2:09:27 AM6/21/10
to jpos-...@googlegroups.com
On 21/06/2010 02:28, chhil wrote:
> Try to use your ISOMsg object and put field 51 and see what the dump
> looks like and how it differs from the data you are receiving, this
> should help you fix the format of that field.
I suspect it might be a field before 51 that is pushing things out of
alignment, but the advise given is by chhil and myself should help you
find it.

But please do check each field for a match to the interface
specification it will save you problems.

--
Mark

Fahimeh Khaki

unread,
Jun 21, 2010, 2:26:10 AM6/21/10
to jpos-...@googlegroups.com
Hi Mark.
Thanks for your attention.
I understand what shoud i do.
 
Reply all
Reply to author
Forward
0 new messages