It's a misalignment of your packager field definitions. Go field by field to make sure you have defined it correctly.
Were fields prior to this field unpacked properly with correct values?
You can take the hex dump, convert it to a byte array, pass it into a isomsg object which has the packaged assigned and unpack it. In the catch part of the exception you can dump the isomsg to see till where it was unpacked and if it had the correct values. There are multiple examples in the older posts which you can search for.
Or
Share your packager for users of this from to assist you further.
-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
Join us in IRC at http://webchat.freenode.net/?channels=jpos
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/e2424f69-dc65-4691-a224-de22920ad673%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hello,
If I take the hex part of the dump and try to unpack it
public static void main(String[] args) {
// The hex data from your email, includes the header and data part concatenated.
String hex ="49534F373031303030303031323130FE7200218AC1E208000000000000000131363532393631363030303136333136303930303030303030303030303039393935303030303030303039393935303030303030303039393935303031363037303931343539363130303030303030303634333231363037303931343539303531363037303936313130303030303030303030303131303030303030303030303034363830373633343537383639303931303030303030313632373035353234313632303730303034355030393030363030303139305036393031353632373035353234313632303730305031333030363030363433323034353337343052653030303030393033393030332020205858585830303030";
ISOMsg m = new ISOMsg();
try {
GenericPackager p = new GenericPackager("C:\\temp\\custom.xml");// Your packager xml used here
m.setPackager(p);
m.unpack(ISOUtil.hex2byte(hex));
m.dump(System.out, "Worked");
}
catch (ISOException ex) {
m.dump(System.out, "");// will tell you till where the message was unpacked
ex.printStackTrace();
}
}
Output
<isomsg direction="none">
<!-- org.jpos.iso.packager.GenericPackager[C:\temp\custom.xml] -->
<header>49534F373031303030303031323130</header>
<field id="0" value="þr�!"/>
<field id="5" value="961600016316"/>
<field id="7" value="0900000000"/>
<field id="9" value="00009995"/>
<field id="10" value="00000000"/>
<field id="16" value="9995"/>
<field id="17" value="0000"/>
<field id="18" value="0000"/>
<field id="19" value="999"/>
<field id="23" value="500"/>
<field id="29" value="160"/>
</isomsg>
org.jpos.iso.ISOException: org.jpos.iso.IFA_LLLBINARY: Problem unpacking field 96 (java.lang.ArrayIndexOutOfBoundsException) unpacking field=96, consumed=94
at org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:284)
at org.jpos.iso.ISOMsg.unpack(ISOMsg.java:460)
at Test.main(Test.java:21)
As you can see that field 0 (MTI is not correct). As Mark had mentioned , your header is including the response MTI 1210.
Which means your bitmap got shifted by 4 bytes as it considers the first 4 bytes of the data as the MTI instead.
So if I change the header length in the packager to 11 the output looks better but still has a problem
<isomsg direction="none">
<!-- org.jpos.iso.packager.GenericPackager[C:\temp\custom.xml] -->
<header>49534F3730313030303030</header>
<field id="0" value="1210"/>
<field id="2" value="5296160001631609"/>
<field id="3" value="000000"/>
<field id="4" value="000000999500"/>
<field id="5" value="000000999500"/>
<field id="6" value="000000999500"/>
<field id="7" value="1607091459"/>
<field id="10" value="61000000"/>
<field id="11" value="006432"/>
<field id="12" value="160709145905"/>
<field id="15" value="160709"/>
<field id="27" value="6"/>
<field id="32" value="00000000000"/>
<field id="33" value="00000000000"/>
<field id="37" value="468076345786"/>
<field id="39" value="909"/>
<field id="41" value="1000000162705524"/>
<field id="42" value="1620700045P0900"/>
</isomsg>
org.jpos.iso.ISOException: org.jpos.iso.IFA_LLLCHAR: Problem unpacking field 48 (java.lang.RuntimeException: Required 600 but just got 69 bytes) unpacking field=48, consumed=206
at org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:284)
at org.jpos.iso.ISOMsg.unpack(ISOMsg.java:460)
at Test.main(Test.java:21)
You should go through these fields and check if the data looks correct based on what is expected. So it could parse till 42 but that does not mean the values parsed were correct. Possibly a bad packager in the earlier fields has caused a misalignment later.
I assume pan, field 2 is a test pan and not a live one.
-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
Join us in IRC at http://webchat.freenode.net/?channels=jpos
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/8766d816-ae2b-4b38-95d9-f961e22b0baf%40googlegroups.com.
You should never have to modify the jpos code like you do unless you are using it incorrectly.
if (!(fld[0] == null) && !(fld[0] instanceof ISOBitMapPackager) && consumed==15)
.....
Below I change the header and pack it and it works fine. On a side note, your field 49/50/51 dont look correct, those need to be ISO Currencies. Your field 55 shows a bit set but no data, which too does not look correct.
import org.jpos.iso.ISOException;
import org.jpos.iso.ISOMsg;
import org.jpos.iso.ISOUtil;
import org.jpos.iso.packager.GenericPackager;
public class Test {
public static void main(String[] args) {
String hex = "49534F373031303030303031323130FE7200218AC1E208000000000000000131363532393631363030303136333136303930303030303030303030303039393935303030303030303039393935303030303030303039393935303031363037303931343539363130303030303030303634333231363037303931343539303531363037303936313130303030303030303030303131303030303030303030303034363830373633343537383639303931303030303030313632373035353234313632303730303034355030393030363030303139305036393031353632373035353234313632303730305031333030363030363433323034353337343052653030303030393033393030332020205858585830303030";
ISOMsg m = new ISOMsg();
try {
GenericPackager p = new GenericPackager("C:\\temp\\custom.xml");
m.setPackager(p);
m.unpack(ISOUtil.hex2byte(hex));
m.dump(System.out, "Working"); // after changing definition of field 41 to 8 from 16
m.setHeader("ISO70122222".getBytes());// test updated header
m.set(3, "111111");// test updated processing code
m.pack(); //packing works fine
m.dump(System.out, "Update And Pack>");
}
catch (ISOException ex) {
m.dump(System.out, "");
ex.printStackTrace();
}
}
}
Output
Working<isomsg direction="none">
Working <!-- org.jpos.iso.packager.GenericPackager[C:\temp\custom.xml] -->
Working <header>49534F3730313030303030</header>
Working <field id="0" value="1210"/>
Working <field id="2" value="5296160001631609"/>
Working <field id="3" value="000000"/>
Working <field id="4" value="000000999500"/>
Working <field id="5" value="000000999500"/>
Working <field id="6" value="000000999500"/>
Working <field id="7" value="1607091459"/>
Working <field id="10" value="61000000"/>
Working <field id="11" value="006432"/>
Working <field id="12" value="160709145905"/>
Working <field id="15" value="160709"/>
Working <field id="27" value="6"/>
Working <field id="32" value="00000000000"/>
Working <field id="33" value="00000000000"/>
Working <field id="37" value="468076345786"/>
Working <field id="39" value="909"/>
Working <field id="41" value="10000001"/>
Working <field id="42" value="627055241620700"/>
Working <field id="48" value="P09006000190P69015627055241620700P13006006432"/>
Working <field id="49" value="045"/>
Working <field id="50" value="374"/>
Working <field id="51" value="0Re"/>
Working <field id="55" value="" type="binary"/>
Working <field id="61" value="039003 "/>
Working <field id="128" value="XXXX0000"/>
Working</isomsg>
Update And Pack><isomsg direction="none">
Update And Pack> <!-- org.jpos.iso.packager.GenericPackager[C:\temp\custom.xml] -->
Update And Pack> <header>49534F3730313232323232</header>
Update And Pack> <field id="0" value="1210"/>
Update And Pack> <field id="2" value="5296160001631609"/>
Update And Pack> <field id="3" value="111111"/>
Update And Pack> <field id="4" value="000000999500"/>
Update And Pack> <field id="5" value="000000999500"/>
Update And Pack> <field id="6" value="000000999500"/>
Update And Pack> <field id="7" value="1607091459"/>
Update And Pack> <field id="10" value="61000000"/>
Update And Pack> <field id="11" value="006432"/>
Update And Pack> <field id="12" value="160709145905"/>
Update And Pack> <field id="15" value="160709"/>
Update And Pack> <field id="27" value="6"/>
Update And Pack> <field id="32" value="00000000000"/>
Update And Pack> <field id="33" value="00000000000"/>
Update And Pack> <field id="37" value="468076345786"/>
Update And Pack> <field id="39" value="909"/>
Update And Pack> <field id="41" value="10000001"/>
Update And Pack> <field id="42" value="627055241620700"/>
Update And Pack> <field id="48" value="P09006000190P69015627055241620700P13006006432"/>
Update And Pack> <field id="49" value="045"/>
Update And Pack> <field id="50" value="374"/>
Update And Pack> <field id="51" value="0Re"/>
Update And Pack> <field id="55" value="" type="binary"/>
Update And Pack> <field id="61" value="039003 "/>
Update And Pack> <field id="128" value="XXXX0000"/>
Update And Pack></isomsg>
-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
Join us in IRC at http://webchat.freenode.net/?channels=jpos
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/fd2015f8-8f37-47c2-9c42-886319ee3172%40googlegroups.com.
In addition to previous post. I would like to mention that, I forgot to mention that , I tried changing the headerLength = 11, in the xml, but I am not able to see any kind of response in the logs, therefore I am continuing with headerLength=15.
On Saturday, July 9, 2016 at 9:14:32 PM UTC+5:30, DPR wrote:
--
--
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
Join us in IRC at http://webchat.freenode.net/?channels=jpos
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/2f443d06-197a-46ef-abd4-5d1d3be7013e%40googlegroups.com.
Test code update to show you that your message doesn’t have a field 35 and your bitmap is getting skewed due to not handling the header correctly.
I am afraid I wont be of much help till you don’t do basic debugging using the hexdump and your continued use of your hacked channel extension.
// Hex data from the error from org.jpos.iso.IFA_LLCHAR: Problem unpacking field 35 (org.jpos.iso.ISOException: Field length 61 too long. Max: 37) unpacking field=35, consumed=118
String hex = "49534F373031303030303031323130FE7200218EC1E208000000000000000131363532393631363030303136333136303930303030303030303030303035393539303030303030303035393539303030303030303035393539303031363037313131303338363130303030303030303634343031363037313131303338353531363037313136313130303030303030303030303131303030303030303030303034363832333335333530383530323134333330303036323730353532343136323037303030313030343533373038325030393030363030303139305036393031353136323037303030313030343533375031333030363030363434305030323030324E525039343030363030303030315039373030344F4E55535038373030313435303435303435303431323282023800950500000480009A031607119C01005F2A0203569F3303E0F8C85F3401009F34034203009F02060000005959009F03060000000000009F10120110A080012200005D7600000000000000FF9F1A0203569F1E0838333230314943439F2608468514872AF6B46F9F2701809F360200DA9F37042C1A3B9B3030393033393030333030303431324533304438";
ISOMsg m = new ISOMsg();
try {
GenericPackager p = new GenericPackager("C:\\temp\\custom.xml");
m.setPackager(p);
Logger l = new Logger();
l.addListener(new SimpleLogListener());
p.setLogger(l,"Test"); // added logger for packager
m.unpack(ISOUtil.hex2byte(hex));
m.dump(System.out, "Working"); // after changing definition of field 41 to 8 from 16
}
catch (ISOException ex) {
m.dump(System.out, "");
ex.printStackTrace();
}
Output. By adding the logger for the packager, you can see which bits are set in the bitmap.
<log realm="Test" at="Mon Jul 11 19:33:36 IST 2016.343" lifespan="21ms">
<unpack>
49534F373031303030303031323130FE7200218EC1E208000000000000000131363532393631363030303136333136303930303030303030303030303035393539303030303030303035393539303030303030303035393539303031363037313131303338363130303030303030303634343031363037313131303338353531363037313136313130303030303030303030303131303030303030303030303034363832333335333530383530323134333330303036323730353532343136323037303030313030343533373038325030393030363030303139305036393031353136323037303030313030343533375031333030363030363434305030323030324E525039343030363030303030315039373030344F4E55535038373030313435303435303435303431323282023800950500000480009A031607119C01005F2A0203569F3303E0F8C85F3401009F34034203009F02060000005959009F03060000000000009F10120110A080012200005D7600000000000000FF9F1A0203569F1E0838333230314943439F2608468514872AF6B46F9F2701809F360200DA9F37042C1A3B9B3030393033393030333030303431324533304438
<bitmap>{1, 2, 3, 4, 5, 6, 7, 10, 11, 12, 15, 27, 32, 33, 37, 38, 39, 41, 42, 48, 49, 50, 51, 55, 61, 128}</bitmap>
<unpack fld="2" packager="org.jpos.iso.IFA_LLNUM">
<value>5296160001631609</value>
</unpack>
<unpack fld="3" packager="org.jpos.iso.IFA_NUMERIC">
<value>000000</value>
</unpack>
<unpack fld="4" packager="org.jpos.iso.IFA_NUMERIC">
<value>000000595900</value>
</unpack>
<unpack fld="5" packager="org.jpos.iso.IFA_NUMERIC">
<value>000000595900</value>
</unpack>
<unpack fld="6" packager="org.jpos.iso.IFA_NUMERIC">
<value>000000595900</value>
</unpack>
<unpack fld="7" packager="org.jpos.iso.IFA_NUMERIC">
<value>1607111038</value>
</unpack>
<unpack fld="10" packager="org.jpos.iso.IFA_NUMERIC">
<value>61000000</value>
</unpack>
<unpack fld="11" packager="org.jpos.iso.IFA_NUMERIC">
<value>006440</value>
</unpack>
<unpack fld="12" packager="org.jpos.iso.IFA_NUMERIC">
<value>160711103855</value>
</unpack>
<unpack fld="15" packager="org.jpos.iso.IFA_NUMERIC">
<value>160711</value>
</unpack>
<unpack fld="27" packager="org.jpos.iso.IFA_NUMERIC">
<value>6</value>
</unpack>
<unpack fld="32" packager="org.jpos.iso.IFA_LLNUM">
<value>00000000000</value>
</unpack>
<unpack fld="33" packager="org.jpos.iso.IFA_LLNUM">
<value>00000000000</value>
</unpack>
<unpack fld="37" packager="org.jpos.iso.IF_CHAR">
<value>468233535085</value>
</unpack>
<unpack fld="38" packager="org.jpos.iso.IF_CHAR">
<value>021433</value>
</unpack>
<unpack fld="39" packager="org.jpos.iso.IFA_NUMERIC">
<value>000</value>
</unpack>
<unpack fld="41" packager="org.jpos.iso.IF_CHAR">
<value>62705524</value>
</unpack>
<unpack fld="42" packager="org.jpos.iso.IF_CHAR">
<value>162070001004537</value>
</unpack>
<unpack fld="48" packager="org.jpos.iso.IFA_LLLCHAR">
<value>P09006000190P69015162070001004537P13006006440P02002NRP94006000001P97004ONUSP870014</value>
</unpack>
<unpack fld="49" packager="org.jpos.iso.IF_CHAR">
<value>504</value>
</unpack>
<unpack fld="50" packager="org.jpos.iso.IF_CHAR">
<value>504</value>
</unpack>
<unpack fld="51" packager="org.jpos.iso.IF_CHAR">
<value>504</value>
</unpack>
<unpack fld="55" packager="org.jpos.iso.IFA_LLLBINARY">
<value type='binary'>82023800950500000480009A031607119C01005F2A0203569F3303E0F8C85F3401009F34034203009F02060000005959009F03060000000000009F10120110A080012200005D7600000000000000FF9F1A0203569F1E0838333230314943439F2608468514872AF6B46F9F2701809F360200DA9F37042C1A3B9B</value>
</unpack>
<unpack fld="61" packager="org.jpos.iso.IFA_LLLCHAR">
<value>039003000</value>
</unpack>
<unpack fld="128" packager="org.jpos.iso.IF_CHAR">
<value>412E30D8</value>
</unpack>
</unpack>
</log>
Working<isomsg direction="none">
Working <!-- org.jpos.iso.packager.GenericPackager[C:\temp\custom.xml] -->
Working <header>49534F3730313030303030</header>
Working <field id="0" value="1210"/>
Working <field id="2" value="5296160001631609"/>
Working <field id="3" value="000000"/>
Working <field id="4" value="000000595900"/>
Working <field id="5" value="000000595900"/>
Working <field id="6" value="000000595900"/>
Working <field id="7" value="1607111038"/>
Working <field id="10" value="61000000"/>
Working <field id="11" value="006440"/>
Working <field id="12" value="160711103855"/>
Working <field id="15" value="160711"/>
Working <field id="27" value="6"/>
Working <field id="32" value="00000000000"/>
Working <field id="33" value="00000000000"/>
Working <field id="37" value="468233535085"/>
Working <field id="38" value="021433"/>
Working <field id="39" value="000"/>
Working <field id="41" value="62705524"/>
Working <field id="42" value="162070001004537"/>
Working <field id="48" value="P09006000190P69015162070001004537P13006006440P02002NRP94006000001P97004ONUSP870014"/>
Working <field id="49" value="504"/>
Working <field id="50" value="504"/>
Working <field id="51" value="504"/>
Working <field id="55" value="82023800950500000480009A031607119C01005F2A0203569F3303E0F8C85F3401009F34034203009F02060000005959009F03060000000000009F10120110A080012200005D7600000000000000FF9F1A0203569F1E0838333230314943439F2608468514872AF6B46F9F2701809F360200DA9F37042C1A3B9B" type="binary"/>
Working <field id="61" value="039003000"/>
Working <field id="128" value="412E30D8"/>
Working</isomsg>
--
--
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
Join us in IRC at http://webchat.freenode.net/?channels=jpos
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/0b6e7026-d2bf-4fab-a317-13ba938f0e22%40googlegroups.com.