ASCIIChannel Invalid message length

999 views
Skip to first unread message

Hipólito López

unread,
Nov 29, 2013, 10:58:38 PM11/29/13
to jpos-...@googlegroups.com
Hi to all,
I'm getting a hard time to find out why I'm getting this error when try to read a message from host:
"org.jpos.iso.ISOException: Invalid message length"

I know this is a problem with the length of the message, but according to the host LOG the message is ok. This is my channel:
<?xml version="1.0" encoding="UTF-8"?>
<channel-adaptor class="org.jpos.q2.iso.ChannelAdaptor" logger="Q2" 
        name="auth-channel"> 
<channel class="org.jpos.iso.channel.ASCIIChannel" 
logger="Q2" 
packager="org.jpos.iso.packager.ISO87APackager"
                 header="020131129223100ISO0060000450000"
                 override-header="true">
<property name="host" value="localhost"/> 
   <property name="port" value="1717" /> 
</channel>
<in>auth-send</in> 
        <out>auth-receive</out> 
</channel-adaptor>

I'm able to send the message ok, but when I got the response I got the length error, the message from host is:
<00880082020131129233809ISO006000045081082200000020000000400000000000000092521031601530100301>
According to the ASCIIChannel the first 4 bytes are the length (0088), then the header and the ISO message, and I think is ok.
do I'm missing something? any help?
Thanks in advance.

...q2.log...
  <receive>
    <isomsg direction="incoming">
      <!-- org.jpos.iso.packager.ISO87APackager -->
      <header>3030383230323031333131323932333338303949534F303036303030303435</he
ader>
      <field id="0" value="0810"/>
      <field id="7" value="0925210316"/>
      <field id="11" value="015301"/>
      <field id="39" value="00"/>
      <field id="70" value="301"/>
    </isomsg>
  </receive>
</log>
<log realm="channel/127.0.0.1:1717" at="Fri Nov 29 23:38:09 BOT 2013.224">
  <receive>
    <iso-exception>
      Invalid message length
      org.jpos.iso.ISOException: Invalid message length
        at org.jpos.iso.channel.ASCIIChannel.getMessageLength(ASCIIChannel.java:
103)
        at org.jpos.iso.BaseChannel.receive(BaseChannel.java:665)
        at org.jpos.q2.iso.ChannelAdaptor$Receiver.run(ChannelAdaptor.java:319)
        at java.lang.Thread.run(Thread.java:722)
    </iso-exception>
  </receive>
</log>

chi...@gmail.com

unread,
Nov 30, 2013, 4:54:07 AM11/30/13
to jpos-users
Here is a thought, since the <receive>  is visible and displays a correctly unpacked message, I don't think there is a problem there. May be the sender is sending more bytes then necessary which causes the channel to treat it as a new message trailing the existing one or the sender is sending more data after sending the response which is not valid (may be a 0 byte ping packet). See if you can add a TCP sniffer to see the data exchanged on the line or add a isoutil.hexdump in the basechannels receive method or where it determines the message length by grabbing the bytes.
-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/6d46f708-3b40-4b5a-9e15-bd7c43c5ad8f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Reply all
Reply to author
Forward
0 new messages