Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Help unpacking field 62

80 views
Skip to first unread message

Michael John Paje

unread,
Jan 16, 2025, 2:24:41 AMJan 16
to jPOS Users
Hello, I've been stuck on my error for days noww. I badly need help on JPOS packager. So I'm getting this error on unpacking message "Exception org.jpos.iso.IFB_LLHBINARY: Problem unpacking field 0 (java.lang.ArrayIndexOutOfBoundsException: arraycopy: last source index 536 out of bounds for byte[378]) unpacking field=62, consumed=293" 

 the whole msg consist of 378 bytes but the field 62 is the one getting error and the value is below field 62 = "08 00 00 00 00 00 00 00 00" 

 I have this packager and the field 62 is here
<isofieldpackager id="62" name="Custom Payment Service Fields" length="255" class="org.jpos.iso.IFB_LLHBINARY" packager="org.jpos.iso.packager.Base1SubFieldPackager"<isofield id="0" length="8" name="Bit Map" class="org.jpos.iso.IFB_BITMAP"/<isofield id="1" length="1" name="Authorization Characteristics Indicator" class="org.jpos.iso.IFB_LLHCHAR"/<isofield id="2" length="8" name="Transaction Identifier" class="org.jpos.iso.IFB_NUMERIC" pad="true"/<isofield id="3" length="4" name="Validation Code" class="org.jpos.iso.IFB_LLHCHAR"/<isofield id="4" length="1" name="Market-Specific Data Identifier" class="org.jpos.iso.IFB_LLHCHAR"/<isofield id="5" length="2" name="Duration" class="org.jpos.iso.IFB_NUMERIC" pad="true"/<isofield id="6" length="1" name="Reserved" class="org.jpos.iso.IFB_LLHCHAR"/<isofield id="7" length="26" name="Purchase Identifier" class="org.jpos.iso.IFB_LLHCHAR"/<isofield id="16" length="2" name="Reserved" class="org.jpos.iso.IFB_LLHCHAR"/<isofield id="17" length="15" name="Mastercard Interchange Compliance" class="org.jpos.iso.IFB_LLHCHAR"/<isofield id="20" length="10" name="Merchant Verification Value" class="org.jpos.iso.IFB_LLBINARY"/<isofield id="21" length="4" name="Online Risk Assessment Risk Score and Reason Codes" class="org.jpos.iso.IFB_LLHCHAR"/<isofield id="22" length="6" name="Online Risk Assessment Condition Codes" class="org.jpos.iso.IFB_LLHCHAR"/<isofield id="23" length="2" name="Product ID" class="org.jpos.iso.IFB_LLHCHAR"/<isofield id="24" length="6" name="Program Identifier" class="org.jpos.iso.IFB_LLHCHAR"/<isofield id="25" length="1" name="Spend Qualified Indicator" class="org.jpos.iso.IFB_LLHCHAR"/<isofield id="26" length="1" name="Account Status" class="org.jpos.iso.IFB_LLHCHAR"/</isofieldpackager>

Mark Salter

unread,
Jan 16, 2025, 2:42:27 AMJan 16
to jpos-...@googlegroups.com

The exception is showing that at the position in the byte[] that jpos is trying to unpack field 62 the data it found present caused the code the fly off the end of the byte[] pulling out the field value.

This is a likely sign the the bytes and fields leading up to field 62 and the fields indicated by the bitmap were unpacked incorrectly - leaving the processing in the wrong place for 62.
Likely from a difference between the packager you are using and the message.

First check the packager matches the message specification for the fields you can see are present *before* 62.

Then check all the packager field definitions match the specification, which should have been the first job as you picked the packager to use.

I would bet money that you have a fixed length field that your packager that has a different length to the specification.

Googling this group would have found many similar examples and this same guidance, so do try a search next time, it will save you time if a similar question has been asked before - like this.

Have fun

-- 
Mark



-------- Original Message --------
--
--
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 Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/jpos-users/59cc331f-5173-4c7a-9e8b-962717c5eae5n%40googlegroups.com.
signature.asc

Michael John Paje

unread,
Jan 27, 2025, 5:02:23 AMJan 27
to jPOS Users
Good day, Thank you for answering, I already found out the error for that. but now I am having an error when doing follow-up transaction, i'm sending isoMessage a second time. I'm getting this error "java.io.EOFException at java.base/java.io.DataInputStream.readFully(DataInputStream.java:203)" I'm using NACChannel. I also tried doing retries but it I get the same error.

chhil

unread,
Jan 27, 2025, 8:38:52 AMJan 27
to jpos-...@googlegroups.com
Likely your length indicator that prepends the message is being read is incorrect , that possibly means your channel is incorrect. 

Channels add varied ways of prepending a length. 

-chhil

Mark Salter

unread,
Jan 27, 2025, 12:55:40 PMJan 27
to jpos-...@googlegroups.com

Just noticed this was a private reply  - sharing for info to the group, where all exchanges always go please!

--

Mark

On 16/01/2025 09:58, Michael John Paje wrote:
Thank you for answering! found the error it was the field 48, thank you for the insight! 

On Thursday, January 16, 2025 at 3:42:27 PM UTC+8 Mark Salter wrote:
signature.asc

Mark Salter

unread,
Jan 27, 2025, 12:59:28 PMJan 27
to jpos-...@googlegroups.com
On 27/01/2025 10:02, Michael John Paje wrote:
> Good day, Thank you for answering, I already found out the error for
> that. but now I am having an error when doing follow-up transaction,
> i'm sending isoMessage a second time. I'm getting this error

Where are you getting this error please?

While you were checking the Packager end to end matched your spec, you
should check the Channel meets the specification needs too.

Depending on where the error emanates from , will drive further guidance
as Chill says.


--

Mark


signature.asc

Michael John Paje

unread,
Jan 27, 2025, 8:36:55 PMJan 27
to jPOS Users
I'm only getting it on the follow-up transaction which is when I send a message the second time. 

Hmm maybe I'm getting it because field 134 is not on my packager, I just noticed. Alright I'll debug moree. Thank you

Michael John Paje

unread,
Jan 27, 2025, 9:33:26 PMJan 27
to jPOS Users
Still getting error... Maybe it's because I'm using NACChannel to send and the one receiving is socket and not channel. But still wondering why the first message work but the second time doesn't. 

Mark Salter

unread,
Jan 28, 2025, 1:35:37 AMJan 28
to jpos-...@googlegroups.com

Sorry Michael, this isn't helping you or us help you.

You are acting  as an Issuer, but perhaps are able to trigger the send of the second message into your test setup?

Please describe the entire flow here fully.

Focus too on sharing in detail what you mean about Socket versus Channel as that makes the leastcsense so far.

A smart question will help us help you easily, google what that is a follow that guidance back here.

-- 
Mark



-------- Original Message --------
--
--
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 Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
signature.asc
Reply all
Reply to author
Forward
0 new messages