org.jpos.iso.IFA_NUMERIC: Problem unpacking field 0

1,268 views
Skip to first unread message

derin...@gmail.com

unread,
Feb 14, 2017, 5:18:35 AM2/14/17
to jPOS Users
I was able to carry out my Key request which was successful, but on trying to carry out transaction on same system, i am having this the exception below.
Will sincerely appreciate your assistance pls.

My key exchange is below

<log realm="server-channel/196.632.103.73:5042" at="2017-02-14T10:49:35.154" lifespan="6ms">
 
<send>
   
<isomsg direction="outgoing">
     
<!-- org.jpos.iso.packager.GenericPackager[config/genpackager.xml] -->
     
<field id="0" value="0800"/>
     
<field id="3" value="9A0000"/>
     
<field id="7" value="0214104927"/>
     
<field id="11" value="775146"/>
     
<field id="12" value="104927"/>
     
<field id="13" value="0214"/>
     
<field id="41" value="2057XR41"/>
   
</isomsg>
 
</send>
</log>
<log realm="server-channel/196.632.103.73:5042" at="2017-02-14T10:49:35.289" lifespan="126ms">
 
<receive>
   
<isomsg direction="incoming">
     
<!-- org.jpos.iso.packager.GenericPackager[config/genpackager.xml] -->
     
<field id="0" value="0810"/>
     
<field id="7" value="0214104927"/>
     
<field id="11" value="775146"/>
     
<field id="12" value="104927"/>
     
<field id="13" value="0214"/>
     
<field id="39" value="00"/>
     
<field id="41" value="2057XR41"/>
     
<field id="53" value="F2DB6F406F6E5690F839D7599A1D2EFB10DF390000000000000000000000000000000000000000000000000000000000" type="binary"/>
   
</isomsg>
 
</receive>
</log>



while my transaction is below


<log realm="server-channel/196.632.103.73:5042" at="2017-02-14T10:49:36.426" lifespan="2ms">
 
<send>
   
<isomsg direction="outgoing">
     
<!-- org.jpos.iso.packager.GenericPackager[config/genpackager.xml] -->
     
<field id="0" value="0200"/>
     
<field id="2" value="506107_________1061"/>
     
<field id="3" value="001000"/>
     
<field id="4" value="0000050000"/>
     
<field id="7" value="0214104935"/>
     
<field id="11" value="776291"/>
     
<field id="12" value="104935"/>
     
<field id="13" value="0214"/>
     
<field id="14" value="____"/>
     
<field id="18" value="9399"/>
     
<field id="22" value="051"/>
     
<field id="23" value="001"/>
     
<field id="25" value="00"/>
     
<field id="26" value="04"/>
     
<field id="28" value="D00000000"/>
     
<field id="32" value="506107"/>
     
<field id="35" value="519899______8014=____________________"/>
     
<field id="37" value="2057XR776291"/>
     
<field id="40" value="226"/>
     
<field id="41" value="20390060"/>
     
<field id="42" value="203900000000033"/>
     
<field id="43" value="Flat 236, Justine Street"/>
     
<field id="49" value="566"/>
     
<field id="52" value="AA55AA55" type="binary"/>
     
<field id="55" value="[WIPED]"/>
     
<field id="123" value="211201513344002"/>
     
<field id="128" value="47fc6fcef2f697bf8115cfc52d4281a22cd920d4496b895a7c040bbc0696761d"/>
   
</isomsg>
 
</send>
</log>
Response waiting


<log realm="server-channel/196.6.103.73:5042" at="2017-02-14T10:49:36.531" lifespan="99ms">
 
<receive>
   
<iso-exception>
      org.jpos.iso.IFA_NUMERIC: Problem unpacking field 0
     
<nested-exception>
      java.lang.RuntimeException: Required 4 but just got 1 bytes
 at org.jpos.iso.AsciiInterpreter.uninterpret(AsciiInterpreter.java:56) at org.jpos.iso.AsciiInterpreter.uninterpret(AsciiInterpreter.java:56)
 at org.jpos.iso.ISOStringFieldPackager.unpack(ISOStringFieldPackager.java:182)
 at org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:267)
 at org.jpos.iso.ISOMsg.unpack(ISOMsg.java:467)
 at org.jpos.iso.BaseChannel.unpack(BaseChannel.java:968)
 at org.jpos.iso.BaseChannel.receive(BaseChannel.java:738)
 at com.device.ISOMessages.ISOMessage.sendTransaction(ISOMessage.java:285)
 at com.device.ISOMessages.ISOPurchase.doTransaction(ISOPurchase.java:46)
 at devicePOS.devicePOS.doBillPayment(devicePOS.java:62)
 at devicePOS.devicePOS.TestTransaction(devicePOS.java:67)
 at devicePOS.devicePOS.main(devicePOS.java:29)
     
</nested-exception>
      org.jpos.iso.ISOException: org.jpos.iso.IFA_NUMERIC: Problem unpacking field 0 (java.lang.RuntimeException: Required 4 but just got 1 bytes)
 at org.jpos.iso.ISOStringFieldPackager.unpack(ISOStringFieldPackager.java:187)
 at org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:267)
 at org.jpos.iso.ISOMsg.unpack(ISOMsg.java:467)
 at org.jpos.iso.BaseChannel.unpack(BaseChannel.java:968)
 at org.jpos.iso.BaseChannel.receive(BaseChannel.java:738)
 at com.nibbs.ISOMessages.ISOMessage.sendTransaction(ISOMessage.java:285)
 at com.nibbs.ISOMessages.ISOPurchase.doTransaction(ISOPurchase.java:46)
 at devicePOS.devicePOS.doBillPayment(devicePOS.java:62)
 at devicePOS.devicePOS.TestTransaction(devicePOS.java:67)
 at devicePOS.devicePOS.main(devicePOS.java:29)
Nested:java.lang.RuntimeException: Required 4 but just got 1 bytes
 at org.jpos.iso.AsciiInterpreter.uninterpret(AsciiInterpreter.java:56)
 at org.jpos.iso.ISOStringFieldPackager.unpack(ISOStringFieldPackager.java:182)
 at org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:267)
 at org.jpos.iso.ISOMsg.unpack(ISOMsg.java:467)
 at org.jpos.iso.BaseChannel.unpack(BaseChannel.java:968)
 at org.jpos.iso.BaseChannel.receive(BaseChannel.java:738)
 at com.device.ISOMessages.ISOMessage.sendTransaction(ISOMessage.java:285)
 at com.device.ISOMessages.ISOPurchase.doTransaction(ISOPurchase.java:46)
 at devicePOS.devicePOS.doBillPayment(devicePOS.java:62)
 at devicePOS.devicePOS.TestTransaction(devicePOS.java:67)
 at devicePOS.devicePOS.main(devicePOS.java:29)
   
</iso-exception>
14-02-2017 10:49:36,535 INFO  (com.device.ISOMessages.ISOMessage:92) - doTransaction: ISOException:  org.jpos.iso.IFA_NUMERIC: Problem unpacking field 0
BUILD SUCCESSFUL (total time: 12 seconds)



Mark Salter

unread,
Feb 14, 2017, 3:12:39 PM2/14/17
to jpos-...@googlegroups.com
On 14/02/17 10:18, derin...@gmail.com wrote:
> Will sincerely appreciate your assistance pls.
Search this mailing list for the steps to help you determine what might
be wrong.

Adding a Logger to you Channel and Packager could help - as previous
guidance you will find will indicate.


--
Mark

chhil

unread,
Feb 16, 2017, 2:41:01 PM2/16/17
to jpos-...@googlegroups.com
As Mark suggested, add loggers to get more details. Also you may want to dump the raw data received by the channel.
Maybe the host does not like the message and is responding with data that does not follow the packager.
Do check to make sure its not something with the data/fields you are sending e.g. field 2 and field 35 don't have the same pan.

-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 Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+unsubscribe@googlegroups.com.
To post to this group, send email to jpos-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/2ddafdf0-ee45-47cd-87c3-d76cd5fa5fee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ese Kelvin

unread,
Aug 31, 2018, 2:37:51 PM8/31/18
to jPOS Users
Hello Derin,

Please were you able to solve this issue? If yes, what is the solution? below is the error message my application is showing. when I try to do a 0200 request

 org.jpos.iso.IFA_LLNUM: Problem unpacking field 2 (org.jpos.iso.ISOException: Field length 61 too long. Max: 19) unpacking field=2, consumed=20
      org.jpos.iso.ISOException: org.jpos.iso.IFA_LLNUM: Problem unpacking field 2 (org.jpos.iso.ISOException: Field length 61 too long. Max: 19) unpacking field=2, consumed=20
at org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:265)
at org.jpos.iso.ISOMsg.unpack(ISOMsg.java:420)
at org.jpos.iso.BaseChannel.unpack(BaseChannel.java:924)
at org.jpos.iso.BaseChannel.receive(BaseChannel.java:692)


When I dumped the raw ISO Message this is what I got 5452414E53414354494F4E204552524F52 which I know is not correct because the MTI is not showing on the response.

Alejandro Revilla

unread,
Aug 31, 2018, 2:39:51 PM8/31/18
to jPOS Users
Are you sure IFA_LLNUM is the appropriate field packager for field 2? Perhaps it's packed BCD and you should use IFB_LLNUM?

You have to carefully read the spec.



Ese Kelvin

unread,
Aug 31, 2018, 4:20:42 PM8/31/18
to jpos-...@googlegroups.com
Hello Alejandro,

Thanks for your response, I have been using the application with IFB_LLNUM for field 2 and it was working fine. But all of a sudden it stopped working and that was when I started getting the error I posted earlier. 

But I just tried using your suggestion  which is the IFB_LLNUM and I got the following error below. 


<log realm="nibss-channel/196.6.103.72:5043" at="Fri Aug 31 20:59:35 WAT 2018.358" lifespan="203ms">
  <receive>
    <iso-exception>
      org.jpos.iso.IFB_LLNUM: Problem unpacking field 2 (org.jpos.iso.ISOException: Field length 34 too long. Max: 19) unpacking field=2, consumed=20
      org.jpos.iso.ISOException: org.jpos.iso.IFB_LLNUM: Problem unpacking field 2 (org.jpos.iso.ISOException: Field length 34 too long. Max: 19) unpacking field=2, consumed=20
at org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:265)
at org.jpos.iso.ISOMsg.unpack(ISOMsg.java:420)
--
--
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 post to this group, send email to jpos-...@googlegroups.com.

Alejandro Revilla

unread,
Aug 31, 2018, 4:29:26 PM8/31/18
to jPOS Users
Perhaps the problem is not related to the packager but the channel, probably a header.

I suggest you add a logger at the packager level. If you're using Q2, you just need to add a property:

   <property name="packager-logger" value="Q2" />

at the same level you have your 'packager-config' property.




On Fri, Aug 31, 2018 at 5:19 PM, Ese Kelvin <eseke...@gmail.com> wrote:
Hello Alejandro,

Thanks for your response, I have been using the application with IFB_LLNUM for field 2 and it was working fine. But all of a sudden it stopped working and that was when I started getting the error I posted earlier. 

But I just tried using your suggestion  which is the IFB_LLNUM and I got the following error below. 


<log realm="nibss-channel/196.6.103.72:5043" at="Fri Aug 31 20:59:35 WAT 2018.358" lifespan="203ms">
  <receive>
    <iso-exception>
      org.jpos.iso.IFB_LLNUM: Problem unpacking field 2 (org.jpos.iso.ISOException: Field length 34 too long. Max: 19) unpacking field=2, consumed=20
      org.jpos.iso.ISOException: org.jpos.iso.IFB_LLNUM: Problem unpacking field 2 (org.jpos.iso.ISOException: Field length 34 too long. Max: 19) unpacking field=2, consumed=20
at org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:265)
at org.jpos.iso.ISOMsg.unpack(ISOMsg.java:420)

On Fri, Aug 31, 2018 at 7:39 PM Alejandro Revilla <a...@jpos.org> wrote:
Are you sure IFA_LLNUM is the appropriate field packager for field 2? Perhaps it's packed BCD and you should use IFB_LLNUM?

You have to carefully read the spec.



--
--
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+unsubscribe@googlegroups.com.

--
--
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+unsubscribe@googlegroups.com.

To post to this group, send email to jpos-...@googlegroups.com.

Ese Kelvin

unread,
Sep 5, 2018, 11:12:00 AM9/5/18
to jpos-...@googlegroups.com
Hello Alejandro Revilla,

I am not using Q2, so I have been unable to add this  "<property name="packager-logger" value="Q2" />" to the channel.xml file. Please is there any other way I can be able to add logger to my application? below is my code snippet

         String stan = String.valueOf(System.currentTimeMillis() % 1000000);
         m.setMTI("0200");
         m.set(2,pan);
         m.set(3, "00"+acctType+"00");
         m.set(4, Utils.leftPad(amount, '0', 10));
        m.set(7, curDateTime);
        m.set(11, Utils.leftPad(stan, '0', 6));    
        m.set(12, curTime); 
        m.set(14, expiryDate);       
        m.set(13, curDate);         
        m.set(18, "6012");        
        m.set(22, "051");
        m.set(23, Utils.leftPad(sequenceNo, '0', 3));
        m.set(25, "00");        
        m.set(26, "03");  
       m.set(28, "D00000000");   
       m.set(32, pan.substring(0,6));     
       m.set(35, track2);       
        m.set(37, terminalId.substring(0,6)+Utils.leftPad(stan, '0', 6));    
        m.set(41, terminalId);
        m.set(42, "203900000000033");
        m.set(43, "PLOT 1161,Mem Drive,CBDABUJA ABNG");
        m.set(49, "566");    
        m.set(52,pinBlock1);   
        m.set(55,  fld55); 
        m.set(123, "211201513344002");
        m.set(128, "");
        m = setMessageHash(m);

       nibssChannel.connect();
       nibssChannel.send(m);
       byte[] dump = m.pack();
       System.out.print("RESULT : " + new String(dump));





To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.

--
--
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.

--
--
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 post to this group, send email to jpos-...@googlegroups.com.

Tobi Olanrewaju

unread,
Sep 5, 2018, 12:03:38 PM9/5/18
to jpos-users
Hi Ese,

Just like Alejandro said before, you can add the logger where you're creating the channel. Example is:

            SimpleLogListener logListener = new SimpleLogListener();
            
            Logger logger = Logger.getLogger("nibss-logger");
            logger.addListener(logListener);
            
            xmlc = new XMLChannel("localhost", 8000, new XMLPackager());
            xmlc.setTimeout(60*1000);
            xmlc.setLogger(logger, ""); 

Cheers, 

Ese Kelvin

unread,
Sep 5, 2018, 12:44:34 PM9/5/18
to jpos-...@googlegroups.com
Hello Mr Tobi, 

Good day sir and thanks for your response. After I added a logger to the channel the application was able to log the following error below.


<send>
    <isomsg direction="outgoing">
      <!-- org.jpos.iso.packager.GenericPackager[config/basic.xml] -->
      <field id="0" value="0200"/>
      <field id="2" value="539983______0077"/>
      <field id="3" value="001000"/>
      <field id="4" value="0000000020"/>
      <field id="7" value="0905173933"/>
      <field id="11" value="573664"/>
      <field id="12" value="173933"/>
      <field id="13" value="0905"/>
      <field id="14" value="____"/>
      <field id="18" value="6012"/>
      <field id="22" value="051"/>
      <field id="23" value="001"/>
      <field id="25" value="00"/>
      <field id="26" value="03"/>
      <field id="28" value="D00000000"/>
      <field id="32" value="539983"/>
      <field id="35" value="539983______0077=___________________"/>
      <field id="37" value="201149573664"/>
      <field id="41" value="201149AJ"/>
      <field id="42" value="203900000000033"/>
      <field id="43" value="PLOT 1161,Mem Drive,CBDABUJA ABNG"/>
      <field id="49" value="566"/>
      <field id="52" value="[WIPED]"/>
      <field id="55" value="[WIPED]"/>
      <field id="123" value="211201513344002"/>
      <field id="128" value="06bff70aed179517220d2afe1f252c2a536267e6ab7f61ad132571b28aaf50cd"/>
    </isomsg>
  </send>
</log>
<log realm="nibss-channel/196.6.103.72:5043" at="Wed Sep 05 17:39:33 WAT 2018.988" lifespan="52ms">
  <receive>
    <iso-exception>
      org.jpos.iso.IFA_LLNUM: Problem unpacking field 2 (org.jpos.iso.ISOException: Field length 61 too long. Max: 19) unpacking field=2, consumed=20
      org.jpos.iso.ISOException: org.jpos.iso.IFA_LLNUM: Problem unpacking field 2 (org.jpos.iso.ISOException: Field length 61 too long. Max: 19) unpacking field=2, consumed=20
at org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:265)
at org.jpos.iso.ISOMsg.unpack(ISOMsg.java:420)
at org.jpos.iso.BaseChannel.unpack(BaseChannel.java:924)
at org.jpos.iso.BaseChannel.receive(BaseChannel.java:692)
at com.nibbs.ISOMessages.ISOMessage.sendTransaction(ISOMessage.java:292)
at com.nibbs.ISOMessages.ISOPurchase.doTransaction(ISOPurchase.java:46)
at mposnibbs.MPosNibbs.doBillPayment(MPosNibbs.java:120)
at mposnibbs.MPosNibbs.TestTransaction(MPosNibbs.java:126)
at mposnibbs.MPosNibbs.main(MPosNibbs.java:82)
    </iso-exception>
    --- data ---
    0000  35 34 35 32 34 31 34 45  35 33 34 31 34 33 35 34  5452414E53414354
0010  34 39 34 46 34 45 32 30  34 35 35 32 35 32 34 46  494F4E204552524F
0020  35 32                                             52

  </receive>
</log>


chhil

unread,
Sep 5, 2018, 1:49:46 PM9/5/18
to jpos-...@googlegroups.com
Did the receiver receive the message as you intended?
Ask the receiver if they see the fields you sent.
Ask the receiver the message they sent in the response.
They will probably tell you they didn't.
Are there any headers prepended to the message and have you accounted for that in the channel?
What channel are you using?


-chhil

Tobi Olanrewaju

unread,
Sep 5, 2018, 1:56:01 PM9/5/18
to jpos-users
Hi Ese,

It looks like there is an issue with the response coming back from the server. That response message doesn't look like an ISO8583 message and interestingly, converting the response (5452414E53414354494F4E204552524F) to text returned :

cap10mycap10

unread,
May 9, 2023, 6:59:37 PM5/9/23
to jPOS Users
I am trying to send a 0800 message to Nibss with the code below

private ISOMsg sendRequestToNibss(ISOMsg isoMsg) throws Exception {
try {
MUX mux = QMUX.getMUX("my_mux");
printOut(isoMsg.pack());
ISOMsg msg = mux.request(isoMsg, 300000);
msg.dump(System.out, "");
return msg;
} catch (ISOException ex) {
log.info("########################### Failing to connect: {}", ex.getMessage());
ex.printStackTrace();
throw new IOException(ex.getMessage());
}
}

but I am not receiving anything, looks like the channel is timing out.


<log realm="Q2.system" at="2023-05-10T00:50:31.053445" lifespan="4ms">
  <info>
    deploy: /Users/cap10mycap10/IdeaProjects/jpos-decoder/deploy/p30_txnmng.xml
  </info>
</log>
<log realm="" at="2023-05-10T00:50:31.059137">
  <unpack>
    3038303032323338303030303030383030303030394730303030303530393034333334303030303032333034333334303035303932313031504C3531
    <bitmap>{3, 7, 11, 12, 13, 41}</bitmap>
    <unpack fld="3" packager="org.jpos.iso.IFA_NUMERIC">
      <!-- PROCESSING CODE -->
      <value>9G0000</value>
    </unpack>
    <unpack fld="7" packager="org.jpos.iso.IFA_NUMERIC">
      <!-- TRANSMISSION DATE AND TIME -->
      <value>0509043340</value>
    </unpack>
    <unpack fld="11" packager="org.jpos.iso.IFA_NUMERIC">
      <!-- SYSTEM TRACE AUDIT NUMBER -->
      <value>000023</value>
    </unpack>
    <unpack fld="12" packager="org.jpos.iso.IFA_NUMERIC">
      <!-- TIME, LOCAL TRANSACTION -->
      <value>043340</value>
    </unpack>
    <unpack fld="13" packager="org.jpos.iso.IFA_NUMERIC">
      <!-- DATE, LOCAL TRANSACTION -->
      <value>0509</value>
    </unpack>
    <unpack fld="41" packager="org.jpos.iso.IF_CHAR">
      <!-- CARD ACCEPTOR TERMINAL IDENTIFICACION -->
      <value>2101PL51</value>
    </unpack>
  </unpack>
</log>
<isomsg>
  <!-- zw.co.jugaad.jposdecoder.txnmanager.NibssPackager -->
  <field id="0" value="0800"/>
  <field id="3" value="9G0000"/>
  <field id="7" value="0509043340"/>
  <field id="11" value="000023"/>
  <field id="12" value="043340"/>
  <field id="13" value="0509"/>
  <field id="41" value="2101PL51"/>
</isomsg>
<log realm="" at="2023-05-10T00:50:31.059590">
  <pack>
    3038303032323338303030303030383030303030394730303030303530393034333334303030303032333034333334303035303932313031504C3531
  </pack>
</log>
<isomsg>
  <!-- zw.co.jugaad.jposdecoder.txnmanager.NibssPackager -->
  <field id="0" value="0800"/>
  <field id="3" value="9G0000"/>
  <field id="7" value="0509043340"/>
  <field id="11" value="000023"/>
  <field id="12" value="043340"/>
  <field id="13" value="0509"/>
  <field id="41" value="2101PL51"/>
</isomsg>
2023-05-10 00:50:31.060  INFO 40824 --- [           main] z.c.j.j.JposDecoderApplication           : Started JposDecoderApplication in 1.02 seconds (JVM running for 1.276)
<log realm="org.jpos.transaction.TransactionManager" at="2023-05-10T00:50:31.061177">
  <info>
    start Thread[#64,Thread-7,5,main]
  </info>
</log>
<log realm="org.jpos.transaction.TransactionManager" at="2023-05-10T00:50:31.061265">
  <info>
    start Thread[#63,Thread-6,5,main]
  </info>
</log>
<log realm="org.jpos.q2.iso.ChannelAdaptor" at="2023-05-10T00:50:31.482870">
  <warn>
    channel-receiver-jpos-receive
    Read timeout / EOF - reconnecting
  </warn>
</log>
java.lang.NullPointerException: Cannot invoke "org.jpos.iso.ISOMsg.dump(java.io.PrintStream, String)" because "msg" is null
at zw.co.jugaad.jposdecoder.JposDecoderApplication.sendRequestToNibss(JposDecoderApplication.java:131)
at zw.co.jugaad.jposdecoder.JposDecoderApplication.testConnection(JposDecoderApplication.java:66)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:578)
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:577)
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:358)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1623)

I am using the PostChannel to establish connection with the host.

Anyone with some pointers?

Andrés Alcarraz

unread,
May 9, 2023, 7:36:47 PM5/9/23
to jpos-...@googlegroups.com

There are lots of possible reasons for not getting a response.

One of them is if the other system just didn't respond, and that could also be for a number of reasons, it didn't like the message, the channel is not aligned and is expecting more bytes, etc.

Can you ask the other side what they see?
Can you show us your configuration?, e.g, the channel configuration, the timeout you see is because the channel didn't receive anything from the other side during the configured timeout of the channel.

What is the connection of your issue with the message you are responding to?

murtuza chhil

unread,
May 9, 2023, 10:13:37 PM5/9/23
to jPOS Users
It the capability is there, ask them to send you a 0800 message and analyze it for length and bytes. Or ask them why they disconnected on your request.

You got a   Read timeout / EOF - reconnecting, they disconnected, in all likelihood because they did not like what you sent them.

-chhil

cap10mycap10

unread,
May 10, 2023, 2:10:55 AM5/10/23
to jPOS Users
here is my channel.xml


<?xml version="1.0" ?>

<channel-adaptor name='jpos-channel' class="org.jpos.q2.iso.ChannelAdaptor" logger="Q2">
<channel class="org.jpos.iso.channel.PostChannel"
packager="zw.co.jugaad.jposdecoder.txnmanager.NibssPackager">
<!-- <channel class="org.jpos.iso.channel.PostChannel"-->
<!-- packager="org.jpos.iso.packager.GenericPackager"-->
<!-- type="server"-->
<!-- logger="Q2"-->
<!-- realm="xml-server-44000">-->
<!-- <property name="packager-config" value="file:cfg/packager/nibss.xml"/>-->
<property name="host" value="196.6.103.X"/>
<property name="port" value="5035"/>
<property name="connection-timeout" value="15000"/>
<property name="timeout" value="300000"/>
<property name="keep-alive" value="true"/>
</channel>
<in>jpos-send</in>
<out>jpos-receive</out>
<ready>jpos-channel.ready</ready>
<unhandled>jpos-unhandled</unhandled>
<reconnect-delay>10000</reconnect-delay>
</channel-adaptor>


and the sample 0800: 003c3038303032323338303030303030383030303030394730303030303530393034333334303030303032333034333334303035303932313031504C3531

It looks like they are appending 003c to the message

Regards

chhil

unread,
May 10, 2023, 2:38:38 AM5/10/23
to jpos-...@googlegroups.com
Your message is 60 bytes long , thats 0x3c in hex.
038303032323338303030303030383030303030394730303030303530393034333334303030303032333034333334303035303932313031504C3531

NacChannel/PostChannel is correct.

Your field packagers may be incorrect.

-chhil





You received this message because you are subscribed to a topic in the Google Groups "jPOS Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jpos-users/j54GkdF1V1Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jpos-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/968db7f9-6fd2-4875-9c97-1606dc272385n%40googlegroups.com.

cap10mycap10

unread,
May 10, 2023, 3:00:01 AM5/10/23
to jPOS Users
Thanks @chhil,  I have made changes to the ISO87APackager for field 64 and field128,  however, I am not understanding how i would customize the packager for the message length field.  Does it mean i will have to bump MTI to field id 1, and if i do that it will now go against the spec.

protected ISOFieldPackager fld[] = {
/*000*/ new IFA_NUMERIC ( 4, "MESSAGE LENGTH INDICATOR"),
/*001*/ new IFA_NUMERIC ( 4, "MESSAGE TYPE INDICATOR"),
/*002*/ new IFA_BITMAP ( 16, "BIT MAP"),
/*003*/ new IFA_LLNUM ( 19, "PAN - PRIMARY ACCOUNT NUMBER"),

I have gone through https://andyorrock.typepad.com/paymentsystems/2006/09/implementing_th.html on how to create a custom packager.

Regards

chhil

unread,
May 10, 2023, 3:58:45 AM5/10/23
to jpos-...@googlegroups.com
You don't need to worry about the message length.
```
/*000*/ new IFA_NUMERIC ( 4, "MESSAGE LENGTH INDICATOR"),
```
Should not be configured, ISOMsg is independent of the headers that precede it.

This is why the packagers provided by jpos havent changed, pick a packager or write your own and use appropriate channel or write your own if its not available out of the box.


Channel packs the  isomsg to get a byte array.
The channel then determines the length of the byte array and prepends the length based on how it needs to be (postpack will prepend 2 byte length header).
The message gets sent.

On the receiving side , the channels will read the first 2 bytes, use it to determine the length , then read those many bytes and does n aisomsg unpack to create the isomsg object and pass it up.

At sending time BaseChannel (Base class of all channels)
https://github.com/jpos/jPOS/blob/master/jpos/src/main/java/org/jpos/iso/BaseChannel.java#L598-L605

At receiving time
https://github.com/jpos/jPOS/blob/master/jpos/src/main/java/org/jpos/iso/BaseChannel.java#L702

The sample message you provided, can it be unpacked ? (after removal of the length header from the packager).
If not fix the field packagers. I don't think your 800 message has fields 64 and 128, so ading those in wont fix anything for the 0800 atleast.

-chhil




cap10mycap10

unread,
May 10, 2023, 4:05:47 AM5/10/23
to jPOS Users
Thanks @chhil.  I thought maybe that was the issue why I am not getting the response back.  Yes i can unpack the message with the packager when i remove the 2 bytes for length.  the field 64 and 128 are for the 0200 messages.  Let me get some feedback from the switch operator on why i am not getting any responses.

Regards
Reply all
Reply to author
Forward
0 new messages