java.io.EOFException getting at client end

28 views
Skip to first unread message

Chandrasekhar Rout

unread,
Nov 14, 2022, 7:16:02 AM11/14/22
to jPOS Users
Hii, 
      when I run my application on external tomcat server it connected successfully with client 
     but when i send msg i am getting following exception in the client application log.
 
java.io.EOFException
    at java.base/java.io.DataInputStream.readFully(DataInputStream.java:202)
    at org.jpos.iso.channel.PostChannel.getMessageLength(PostChannel.java:81)
    at org.jpos.iso.BaseChannel.receive(BaseChannel.java:714)
    at org.isu.main.JpossClientApp.main(JpossClientApp.java:52)


murtuza chhil

unread,
Nov 15, 2022, 2:32:21 AM11/15/22
to jPOS Users

From your stacktrace...

JpossClientApp is receiving a message and trying to unpack it.
The channel you are using is a PostChannel (this is not in anyway related to HTTP Post, I say this because you mention Tomcat Server) it is a Postilion Packager that has a 2 byte length header followed by that length of data.
POStChannel reads the first to bytes and gathers those many bytes from the tcp stream. Looks like there weren't sufficient bytes and caused an EOF.

Please explain your setup and what you are trying to achieve.


-chhil

Chandrasekhar Rout

unread,
Nov 15, 2022, 3:12:23 AM11/15/22
to jpos-...@googlegroups.com
when i run locally both client and server everything works fine . pls see below :
1. client app connected successfully.
2. client send msg server relieve it and prepare ,commit and send response.
below is client log after sending request and receiving response from my jpos  server
<isomsg>
   <!-- org.jpos.iso.packager.EuroPackager -->
   <field id="0" value="0800"/>
   <field id="2" value="3538000000000004"/>
   <field id="3" value="000000"/>
   <field id="4" value="101"/>
   <field id="6" value="000002318814"/>
   <field id="7" value="2023444444"/>
   <field id="11" value="679977"/>
   <field id="12" value="184922"/>
   <field id="13" value="0719"/>
   <field id="19" value="392"/>
   <field id="32" value="00088008003"/>
   <field id="33" value="88070000"/>
   <field id="37" value="230519000197"/>
   <field id="38" value="003831"/>
   <field id="39" value="00"/>
   <field id="41" value="3945  33"/>
   <field id="49" value="978"/>
   <field id="51" value="356"/>
   <field id="55" value="910ADEC0D3F7A88748DE3030"/>
   <field id="61" value="610061500000000999999"/>
   <field id="70" value="001"/>
 </isomsg>

channelorg.jpos.iso.channel.PostChannel@6a41eaa2
response recived from server for request=1
 <isomsg direction="incoming">
   <!-- org.jpos.iso.packager.EuroPackager -->
   <field id="0" value="0810"/>
   <field id="2" value="3538000000000004"/>
   <field id="3" value="000000"/>
   <field id="4" value="000000000101"/>
   <field id="6" value="000002318814"/>
   <field id="7" value="2023444444"/>
   <field id="11" value="679977"/>
   <field id="12" value="184922"/>
   <field id="13" value="0719"/>
   <field id="19" value="392"/>
   <field id="32" value="00088008003"/>
   <field id="33" value="88070000"/>
   <field id="37" value="230519000197"/>
   <field id="38" value="003831"/>
   <field id="39" value="00"/>
   <field id="41" value="3945  33"/>
   <field id="49" value="978"/>
   <field id="51" value="356"/>
   <field id="55" value="910ADEC0D3F7A88748DE3030"/>
   <field id="61" value="610061500000000999999"/>
   <field id="70" value="001"/>
 </isomsg>
Just After receive for echo:
[ In: 0810 679977 3945  33,  In: 0810 679977 3945  33]
 In: 0810 679977 3945  33
 In: 0810 679977 3945  33
2.it is the server log after recieving msg from client .prepare commit and give response
<log realm="Q2.system" at="2022-11-15T13:19:37.384372900">
  <info>
    Q2 started, deployDir=C:\Users\ISU-1325\git\cardissuerswitch\deploy, environment=default
  </info>
</log>
<log realm="Q2.system" at="2022-11-15T13:19:37.789698700" lifespan="396ms">
  <version>
    jPOS 2.1.7 master/7079725 (2022-01-22 18:50:13 UYT)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

jPOS Community Edition, licensed under GNU AGPL v3.0.
This software is probably not suitable for commercial use.
Please see http://jpos.org/license for details.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)

iQEcBAEBAgAGBQJMolHDAAoJEOQyeO71nYtFv74H/3OgehDGEy1VXp2U3/GcAobg
HH2eZjPUz53r38ARPiU3pzm9LwDa3WZgJJaa/b9VrJwKvbPwe9+0kY3gScDE1skT
ladHt+KHHmGQArEutkzHlpZa73RbroFEIa1qmN6MaDEHGoxZqDh0Sv2cpvOaVYGO
St8ZaddLBPC17bSjAPWo9sWbvL7FgPFOHhnPmbeux8SLtnfWxXWsgo5hLBanKmO1
1z+I/w/6DL6ZYZU6bAJUk+eyVVImJqw0x3IEElI07Nh9MC6BA4iJ77ejobj8HI2r
q9ulRPEqH9NR79619lNKVUkE206dVlXo7xHmJS1QZy5v/GT66xBxyDVfTduPFXk=
=oP+v
-----END PGP SIGNATURE-----

  </version>
</log>
2022-11-15 13:19:37.863  INFO 5608 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
<log realm="Q2.system" at="2022-11-15T13:19:37.867132300" lifespan="73ms">
  <info>
    deploy: C:\Users\ISU-1325\git\cardissuerswitch\deploy\10_channel_jpos.xml
  </info>
</log>
2022-11-15 13:19:37.872  INFO 5608 --- [           main] c.e.demo.CardissuerswitchApplication     : Started CardissuerswitchApplication in 1.976 seconds (JVM running for 2.978)
<log realm="Q2.system" at="2022-11-15T13:19:37.873920100" lifespan="6ms">
  <info>
    deploy: C:\Users\ISU-1325\git\cardissuerswitch\deploy\50_xml_server.xml
  </info>
</log>
<log realm="Q2.system" at="2022-11-15T13:19:37.900033600" lifespan="26ms">
  <info>
    deploy: C:\Users\ISU-1325\git\cardissuerswitch\deploy\txnmanager.xml
  </info>
</log>
<log realm="xml-server-8000.server" at="2022-11-15T13:19:37.928591300">
  <iso-server>
    listening on port 8000
  </iso-server>
</log>
<log realm="org.jpos.transaction.TransactionManager" at="2022-11-15T13:19:37.930882500">
  <info>
    start Thread[Thread-7,5,main]
  </info>
</log>
<log realm="org.jpos.transaction.TransactionManager" at="2022-11-15T13:19:37.931139800">
  <info>
    start Thread[Thread-8,5,main]
  </info>
</log>
<log realm="org.jpos.q2.iso.ChannelAdaptor" at="2022-11-15T13:24:38.322685300">
  <warn>
    channel-receiver-jpos-receive
    Read timeout / EOF - reconnecting
  </warn>
</log>
<log realm="xml-server-8000.server.session/127.0.0.1:59762" at="2022-11-15T13:26:20.941543900">
  <session-start/>
</log>
<log realm="xml-server-8000/127.0.0.1:59762" at="2022-11-15T13:26:20.944751200" lifespan="3ms">
  <receive>
    <isomsg direction="incoming">
      <!-- com.example.demo.EuroPackager -->
      <field id="0" value="0800"/>
      <field id="2" value="3538000000000004"/>
      <field id="3" value="000000"/>
      <field id="4" value="000000000101"/>
      <field id="6" value="000002318814"/>
      <field id="7" value="2023444444"/>
      <field id="11" value="679977"/>
      <field id="12" value="184922"/>
      <field id="13" value="0719"/>
      <field id="19" value="392"/>
      <field id="32" value="00088008003"/>
      <field id="33" value="88070000"/>
      <field id="37" value="230519000197"/>
      <field id="38" value="003831"/>
      <field id="39" value="00"/>
      <field id="41" value="3945  33"/>
      <field id="49" value="978"/>
      <field id="51" value="356"/>
      <field id="55" value="393130414445433044334637413838373438444533303330" type="binary"/>
      <field id="61" value="610061500000000999999"/>
      <field id="70" value="001"/>
    </isomsg>
  </receive>
</log>
Space name listenertransient:default
Data received
 <isomsg direction="incoming">
   <!-- com.example.demo.EuroPackager -->
   <field id="0" value="0800"/>
   <field id="2" value="3538000000000004"/>
   <field id="3" value="000000"/>
   <field id="4" value="000000000101"/>
   <field id="6" value="000002318814"/>
   <field id="7" value="2023444444"/>
   <field id="11" value="679977"/>
   <field id="12" value="184922"/>
   <field id="13" value="0719"/>
   <field id="19" value="392"/>
   <field id="32" value="00088008003"/>
   <field id="33" value="88070000"/>
   <field id="37" value="230519000197"/>
   <field id="38" value="003831"/>
   <field id="39" value="00"/>
   <field id="41" value="3945  33"/>
   <field id="49" value="978"/>
   <field id="51" value="356"/>
   <field id="55" value="393130414445433044334637413838373438444533303330" type="binary"/>
   <field id="61" value="610061500000000999999"/>
   <field id="70" value="001"/>
 </isomsg>
sourceorg.jpos.iso.channel.PostChannel@1aeef116
select method of groupselector
mti0800
enter into prepare of cardres
<log realm="xml-server-8000/127.0.0.1:59762" at="2022-11-15T13:26:20.951483100">
  <send>
    <isomsg direction="outgoing">
      <!-- com.example.demo.EuroPackager -->
      <field id="0" value="0810"/>
      <field id="2" value="3538000000000004"/>
      <field id="3" value="000000"/>
      <field id="4" value="000000000101"/>
      <field id="6" value="000002318814"/>
      <field id="7" value="2023444444"/>
      <field id="11" value="679977"/>
      <field id="12" value="184922"/>
      <field id="13" value="0719"/>
      <field id="19" value="392"/>
      <field id="32" value="00088008003"/>
      <field id="33" value="88070000"/>
      <field id="37" value="230519000197"/>
      <field id="38" value="003831"/>
      <field id="39" value="00"/>
      <field id="41" value="3945  33"/>
      <field id="49" value="978"/>
      <field id="51" value="356"/>
      <field id="55" value="393130414445433044334637413838373438444533303330" type="binary"/>
      <field id="61" value="610061500000000999999"/>
      <field id="70" value="001"/>
    </isomsg>
  </send>
</log>
Data receive in prepare
Space nametransient:default
Testing
Data receive in prepare
 <isomsg direction="incoming">
   <!-- com.example.demo.EuroPackager -->
   <field id="0" value="0800"/>
   <field id="2" value="3538000000000004"/>
   <field id="3" value="000000"/>
   <field id="4" value="000000000101"/>
   <field id="6" value="000002318814"/>
   <field id="7" value="2023444444"/>
   <field id="11" value="679977"/>
   <field id="12" value="184922"/>
   <field id="13" value="0719"/>
   <field id="19" value="392"/>
   <field id="32" value="00088008003"/>
   <field id="33" value="88070000"/>
   <field id="37" value="230519000197"/>
   <field id="38" value="003831"/>
   <field id="39" value="00"/>
   <field id="41" value="3945  33"/>
   <field id="49" value="978"/>
   <field id="51" value="356"/>
   <field id="55" value="393130414445433044334637413838373438444533303330" type="binary"/>
   <field id="61" value="610061500000000999999"/>
   <field id="70" value="001"/>
 </isomsg>
send message
sourceorg.jpos.iso.channel.PostChannel@1aeef116
<log realm="xml-server-8000/127.0.0.1:59762" at="2022-11-15T13:26:20.953169600">
  <send>
    <isomsg direction="outgoing">
      <!-- com.example.demo.EuroPackager -->
      <field id="0" value="0810"/>
      <field id="2" value="3538000000000004"/>
      <field id="3" value="000000"/>
      <field id="4" value="000000000101"/>
      <field id="6" value="000002318814"/>
      <field id="7" value="2023444444"/>
      <field id="11" value="679977"/>
      <field id="12" value="184922"/>
      <field id="13" value="0719"/>
      <field id="19" value="392"/>
      <field id="32" value="00088008003"/>
      <field id="33" value="88070000"/>
      <field id="37" value="230519000197"/>
      <field id="38" value="003831"/>
      <field id="39" value="00"/>
      <field id="41" value="3945  33"/>
      <field id="49" value="978"/>
      <field id="51" value="356"/>
      <field id="55" value="393130414445433044334637413838373438444533303330" type="binary"/>
      <field id="61" value="610061500000000999999"/>
      <field id="70" value="001"/>
    </isomsg>
  </send>
</log>
Data receive in cardresponse for commit
Data receive in server for commit
<log realm="org.jpos.transaction.TransactionManager" at="2022-11-15T13:26:20.954743400" lifespan="4ms">
  <commit>
    SimpleTransactionManager-0:idle:1
    <context>
      c.e.d.Constants.REQUEST_KEY:
       <isomsg direction="incoming">
         <!-- com.example.demo.EuroPackager -->
         <field id="0" value="0800"/>
         <field id="2" value="3538000000000004"/>
         <field id="3" value="000000"/>
         <field id="4" value="000000000101"/>
         <field id="6" value="000002318814"/>
         <field id="7" value="2023444444"/>
         <field id="11" value="679977"/>
         <field id="12" value="184922"/>
         <field id="13" value="0719"/>
         <field id="19" value="392"/>
         <field id="32" value="00088008003"/>
         <field id="33" value="88070000"/>
         <field id="37" value="230519000197"/>
         <field id="38" value="003831"/>
         <field id="39" value="00"/>
         <field id="41" value="3945  33"/>
         <field id="49" value="978"/>
         <field id="51" value="356"/>
         <field id="55" value="393130414445433044334637413838373438444533303330" type="binary"/>
         <field id="61" value="610061500000000999999"/>
         <field id="70" value="001"/>
       </isomsg>
     
      c.e.d.Constants.RESOURCE_KEY: org.jpos.iso.channel.PostChannel@1aeef116
      c.e.d.Constants.RESPONSE_KEY:
       <isomsg direction="outgoing">
         <!-- com.example.demo.EuroPackager -->
         <field id="0" value="0810"/>
         <field id="2" value="3538000000000004"/>
         <field id="3" value="000000"/>
         <field id="4" value="000000000101"/>
         <field id="6" value="000002318814"/>
         <field id="7" value="2023444444"/>
         <field id="11" value="679977"/>
         <field id="12" value="184922"/>
         <field id="13" value="0719"/>
         <field id="19" value="392"/>
         <field id="32" value="00088008003"/>
         <field id="33" value="88070000"/>
         <field id="37" value="230519000197"/>
         <field id="38" value="003831"/>
         <field id="39" value="00"/>
         <field id="41" value="3945  33"/>
         <field id="49" value="978"/>
         <field id="51" value="356"/>
         <field id="55" value="393130414445433044334637413838373438444533303330" type="binary"/>
         <field id="61" value="610061500000000999999"/>
         <field id="70" value="001"/>
       </isomsg>
     
    </context>
            prepare: c.e.d.Switch:Switch PREPARED READONLY NO_JOIN
           selector: 'cardresponse'
            prepare: c.e.d.Cardresponse PREPARED
            prepare: c.e.d.IsoServerQ2 PREPARED
             commit: c.e.d.Cardresponse
             commit: c.e.d.IsoServerQ2
     in-transit=0/0, head=2, tail=2, paused=0, outstanding=0, active-sessions=2/2, tps=0, peak=0, avg=0.00, elapsed=5ms
    <profiler>
      prepare: c.e.d.Switch:Switch [0.4/0.4]
      prepare: c.e.d.Cardresponse [1.3/1.8]
      prepare: c.e.d.IsoServerQ2 [2.0/3.8]
       commit: c.e.d.Cardresponse [0.1/4.0]
       commit: c.e.d.IsoServerQ2 [0.1/4.1]
      end [2.6/6.7]
    </profiler>
  </commit>
</log>
<log realm="xml-server-8000/127.0.0.1:59762" at="2022-11-15T13:26:20.957859300" lifespan="9ms">
  <receive>
    <peer-disconnect/>
  </receive>
</log>
<log realm="xml-server-8000.server.session/127.0.0.1:59762" at="2022-11-15T13:26:20.958027200">
  <session-end/>
</log>
<log realm="org.jpos.q2.iso.ChannelAdaptor" at="2022-11-15T13:29:48.718833600">
  <warn>
    channel-receiver-jpos-receive
    Read timeout / EOF - reconnecting
  </warn>
</log>
but when I deploy my server application in linux server or external tomcat .client application connect with server application .then i send req from client app .pls see the below log of client and server
server log running on external tomcat or linux server
client log:
Just before send for echo:
 <isomsg>
   <!-- org.jpos.iso.packager.EuroPackager -->
   <field id="0" value="0800"/>
   <field id="2" value="3538000000000004"/>
   <field id="3" value="000000"/>
   <field id="4" value="101"/>
   <field id="6" value="000002318814"/>
   <field id="7" value="2023444444"/>
   <field id="11" value="679977"/>
   <field id="12" value="184922"/>
   <field id="13" value="0719"/>
   <field id="19" value="392"/>
   <field id="32" value="00088008003"/>
   <field id="33" value="88070000"/>
   <field id="37" value="230519000197"/>
   <field id="38" value="003831"/>
   <field id="39" value="00"/>
   <field id="41" value="3945  33"/>
   <field id="49" value="978"/>
   <field id="51" value="356"/>
   <field id="55" value="910ADEC0D3F7A88748DE3030"/>
   <field id="61" value="610061500000000999999"/>
   <field id="70" value="001"/>
 </isomsg>

channelorg.jpos.iso.channel.PostChannel@6a41eaa2
response recived from server for request=1

java.io.EOFException
at java.base/java.io.DataInputStream.readFully(DataInputStream.java:202)
at org.jpos.iso.channel.PostChannel.getMessageLength(PostChannel.java:81)
at org.jpos.iso.BaseChannel.receive(BaseChannel.java:714)
at org.isu.main.JpossClientApp.main(JpossClientApp.java:72)
2.server log (wont response anything)
10.0\webapps\cardissuerswitch-0.0.1-SNAPSHOT.war]
15-Nov-2022 13:38:57.009 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
15-Nov-2022 13:38:57.238 WARNING [main] org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [197] milliseconds.
15-Nov-2022 13:38:57.254 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [C:\Program Files\Apache Software Foundation\Tomcat 10.0\webapps\cardissuerswitch-0.0.1-SNAPSHOT.war] has finished in [5,585] ms
15-Nov-2022 13:38:57.269 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [C:\Program Files\Apache Software Foundation\Tomcat 10.0\webapps\generatecsv-1-0.0.1-SNAPSHOT.war]
15-Nov-2022 13:38:58.476 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
15-Nov-2022 13:38:58.492 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [C:\Program Files\Apache Software Foundation\Tomcat 10.0\webapps\generatecsv-1-0.0.1-SNAPSHOT.war] has finished in [1,223] ms
15-Nov-2022 13:38:58.492 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Program Files\Apache Software Foundation\Tomcat 10.0\webapps\docs]
15-Nov-2022 13:38:58.508 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Program Files\Apache Software Foundation\Tomcat 10.0\webapps\docs] has finished in [16] ms
15-Nov-2022 13:38:58.508 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Program Files\Apache Software Foundation\Tomcat 10.0\webapps\examples]
15-Nov-2022 13:38:58.844 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Program Files\Apache Software Foundation\Tomcat 10.0\webapps\examples] has finished in [336] ms
15-Nov-2022 13:38:58.844 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Program Files\Apache Software Foundation\Tomcat 10.0\webapps\host-manager]
15-Nov-2022 13:38:58.875 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Program Files\Apache Software Foundation\Tomcat 10.0\webapps\host-manager] has finished in [31] ms
15-Nov-2022 13:38:58.875 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Program Files\Apache Software Foundation\Tomcat 10.0\webapps\manager]
15-Nov-2022 13:38:58.919 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Program Files\Apache Software Foundation\Tomcat 10.0\webapps\manager] has finished in [28] ms
15-Nov-2022 13:38:58.919 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Program Files\Apache Software Foundation\Tomcat 10.0\webapps\ROOT]
15-Nov-2022 13:38:58.935 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Program Files\Apache Software Foundation\Tomcat 10.0\webapps\ROOT] has finished in [16] ms
15-Nov-2022 13:38:58.935 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8443"]
15-Nov-2022 13:38:58.952 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["https-openssl-nio-8000"]
15-Nov-2022 13:38:58.952 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-9000"]
15-Nov-2022 13:38:58.970 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [7382] milliseconds


--
--
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 on the web visit https://groups.google.com/d/msgid/jpos-users/d57056e0-b307-4235-992e-834a4d333f7bn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages