exception while using HexChannel

126 views
Skip to first unread message

pugazhendhi t

unread,
May 10, 2012, 1:29:05 AM5/10/12
to jpos-...@googlegroups.com


Hi i am getting the following exception when i try to run the sample i have downloaded to understand jpos...
By seeing the log i understood something pbm in Packaging Can anyone help in this  pls

it will be  thankful..


Code:
ISOPackager p = new GenericPackager("cfg/edc2_iso87HEX.xml");
           
            // create and set field for message
            ISOMsg m = new ISOMsg();
            m.setMTI("0200");
            m.set("3", "888888");
            m.set("11", "123456");
            cardId = cardId + "=10041011765710800000";
            m.set("35",cardId);
            m.set("41",tid);
            m.set("42", mid);
            String field48 = "FF21027567FF2203000000FF25091655D7C5A50A1B2C7BFF260414061231FF290720100519115436FF2F06051911543608FF450143FF4B06500000000000FF64080000000000000000";
            m.set(48,ISOUtil.hex2byte(field48));
           
            // set package for message
            m.setPackager(p);
           
           
            Logger logger = new Logger();
            logger.addListener (new SimpleLogListener (System.out));
             
            // set channel for message with server address, port and package
            ISOChannel channel = new HEXChannel(host,port,p,ISOUtil.hex2byte("6000010002"));
           
            ((LogSource)channel).setLogger (logger, "test-channel");

            // connect to loyalty manage system server
            channel.connect();

            // send message
            channel.send(m);

            // receive response
            ISOMsg r = channel.receive();
                        System.out.println(r);
           
            channel.disconnect();




Client Side error :

java.io.EOFException
    at java.io.DataInputStream.readFully(DataInputStream.java:197)
    at org.jpos.iso.channel.HEXChannel.getMessageLength(HEXChannel.java:93)
    at org.jpos.iso.BaseChannel.receive(BaseChannel.java:644)
    at org.hcmus.jpos.Client.redeem(Client.java:53)
    at org.hcmus.client.BarCodePanel.actionPerformed(BarCodePanel.java:195)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
    at java.awt.Component.processMouseEvent(Component.java:6505)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
    at java.awt.Component.processEvent(Component.java:6270)
    at java.awt.Container.processEvent(Container.java:2229)
    at java.awt.Component.dispatchEventImpl(Component.java:4861)
    at java.awt.Container.dispatchEventImpl(Container.java:2287)
    at java.awt.Component.dispatchEvent(Component.java:4687)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
    at java.awt.Container.dispatchEventImpl(Container.java:2273)
    at java.awt.Window.dispatchEventImpl(Window.java:2713)
    at java.awt.Component.dispatchEvent(Component.java:4687)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:707)
    at java.awt.EventQueue.access$000(EventQueue.java:101)
    at java.awt.EventQueue$3.run(EventQueue.java:666)
    at java.awt.EventQueue$3.run(EventQueue.java:664)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
    at java.awt.EventQueue$4.run(EventQueue.java:680)
    at java.awt.EventQueue$4.run(EventQueue.java:678)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:677)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)


In gate way side :


<log realm="hex-gateway-receiver.server.session/127.0.0.1" at="Thu May 10 10:50:16 IST 2012.557">
  <session-start/>
</log>
<log realm="channel/127.0.0.1:49988" at="Thu May 10 10:50:16 IST 2012.573" lifespan="15ms">
  <receive>
    <iso-exception>
      org.jpos.iso.IFB_LLLCHAR: Problem unpacking field 55 (java.lang.RuntimeException: Required 6245 but just got 29 bytes) unpacking field=55, consumed=71
      org.jpos.iso.ISOException: org.jpos.iso.IFB_LLLCHAR: Problem unpacking field 55 (java.lang.RuntimeException: Required 6245 but just got 29 bytes) unpacking field=55, consumed=71
    at org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:261)
    at org.jpos.iso.ISOMsg.unpack(ISOMsg.java:416)
    at org.jpos.iso.BaseChannel.unpack(BaseChannel.java:903)
    at org.jpos.iso.BaseChannel.receive(BaseChannel.java:671)
    at org.jpos.iso.ISOServer$Session.run(ISOServer.java:130)
    at org.jpos.util.ThreadPool$PooledThread.run(ThreadPool.java:71)
    </iso-exception>
    --- header ---
    0000  60 00 01 00 02 02 00 20  20 00                    `......  .

    --- data ---
    0000  00 20 C1 00 08 88 88 88  12 34 56 37 11 11 11 11  . .......4V7....
0010  11 11 11 11 D1 00 41 01  17 65 71 08 00 00 00 00  ......A..eq.....
0020  00 00 01 00 00 00 00 00  00 00 10 00 32 FF 21 02  ............2.!.
0030  72 07 FF 22 03 00 00 00  FF 25 09 16 55 D7 C5 A5  r..".....%..U...
0040  0A 1B 2C 7B FF 2F 06 62  45 41 16 22 13 00 23 FF  ..,{./.bEA."..#.
0050  3C 14 00 00 00 20 00 00  00 00 00 00 00 00 00 00  <.... ..........
0060  00 00 00 00 00 00                                 ......

  </receive>
</log>
<log realm="hex-gateway-receiver.server.session/127.0.0.1" at="Thu May 10 10:50:16 IST 2012.588">
  <session-error>
    <iso-exception>
      org.jpos.iso.IFB_LLLCHAR: Problem unpacking field 55 (java.lang.RuntimeException: Required 6245 but just got 29 bytes) unpacking field=55, consumed=71
      org.jpos.iso.ISOException: org.jpos.iso.IFB_LLLCHAR: Problem unpacking field 55 (java.lang.RuntimeException: Required 6245 but just got 29 bytes) unpacking field=55, consumed=71
    at org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:261)
    at org.jpos.iso.ISOMsg.unpack(ISOMsg.java:416)
    at org.jpos.iso.BaseChannel.unpack(BaseChannel.java:903)
    at org.jpos.iso.BaseChannel.receive(BaseChannel.java:671)
    at org.jpos.iso.ISOServer$Session.run(ISOServer.java:130)
    at org.jpos.util.ThreadPool$PooledThread.run(ThreadPool.java:71)
    </iso-exception>
  </session-error>
</log>
<log realm="hex-gateway-receiver.server.session/127.0.0.1" at="Thu May 10 10:50:16 IST 2012.588">
  <session-end/>
</log>

Mark Salter

unread,
May 10, 2012, 2:31:49 AM5/10/12
to jpos-...@googlegroups.com
On 10/05/2012 06:29, pugazhendhi t wrote:
>
>
> Hi i am getting the following exception when i try to run the sample i
> have downloaded to understand jpos...
From here :-

http://code.google.com/p/lmssystem/source/browse/trunk/

perhaps?

This is a user of jpos, not jPOS per say, you might need to ask them,
not us for support :-)


> ISOMsg m = new ISOMsg();
> m.setMTI("0200");
> m.set("3", "888888");
> m.set("11", "123456");
> cardId = cardId + "=10041011765710800000";
> m.set("35",cardId);
> m.set("41",tid);
> m.set("42", mid);
> String field48 =
> "FF21027567FF2203000000FF25091655D7C5A50A1B2C7BFF260414061231FF290720100519115436FF2F06051911543608FF450143FF4B06500000000000FF64080000000000000000";
> m.set(48,ISOUtil.hex2byte(field48));
>
> // set package for message
> m.setPackager(p);
>
>
The above 'test' ISOMsg is being sent to *something*...

>
> Client Side error :
>
> java.io.EOFException
> at java.io.DataInputStream.readFully(DataInputStream.java:197)
> at org.jpos.iso.channel.HEXChannel.getMessageLength(HEXChannel.java:93)
> at org.jpos.iso.BaseChannel.receive(BaseChannel.java:644)
> at org.hcmus.jpos.Client.redeem(Client.java:53)
> at org.hcmus.client.BarCodePanel.actionPerformed(BarCodePanel.java:195)

... the response it is sending back does not match the Channel or the
Packager you are using.

The Packager is unknown to me; *But* what is generating the response
this code does not like? That is the question to answer yourself first
and nothing really to do with the code you have shared.


--
I hv pbm!
Mark

Pugazhendhi T

unread,
May 10, 2012, 2:51:45 AM5/10/12
to jpos-...@googlegroups.com
How to deploy this project ...

whether anything wrong in deploying ....

or any version pbm could be the reason for unable to run this sample ..

http://code.google.com/p/lmssystem/source/browse/trunk/


Mark Salter

unread,
May 10, 2012, 7:48:18 PM5/10/12
to jpos-...@googlegroups.com
On 10/05/2012 07:51, Pugazhendhi T wrote:
> How to deploy this project ...
Ask the project owners, read their documentation?

>
> whether anything wrong in deploying ....
Sorry?

>
> or any version pbm could be the reason for unable to run this sample ..
pbm?

Why not ask the authors/project owners, raise an issue or try and answer
the questions I posed you?

>
> http://code.google.com/p/lmssystem/source/browse/trunk/
>

and as always :-

http://www.catb.org/~esr/faqs/smart-questions.html

Oh and :-

http://code.google.com/p/lmssystem/


--
Mark
Reply all
Reply to author
Forward
0 new messages