Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ProgramCall results in Read timed out #225

Closed
Bratmaxxe119 opened this issue Dec 18, 2024 · 3 comments
Closed

ProgramCall results in Read timed out #225

Bratmaxxe119 opened this issue Dec 18, 2024 · 3 comments

Comments

@Bratmaxxe119
Copy link

Hi,

i am currently using jt400.jar (11.1). After a specific time (maybe 10-20 minutes), program calls do not work anymore and the following exception occurs:

Mi Dez 18 09:33:58:713 MEZ 2024 run(): Caught IOException: java.net.SocketTimeoutException: Read timed out at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.socketRead(Unknown Source) at java.net.SocketInputStream.read(Unknown Source) at java.net.SocketInputStream.read(Unknown Source) at com.ibm.as400.access.DataStream.readFromStream(DataStream.java:54) at com.ibm.as400.access.ClientAccessDataStream.construct(ClientAccessDataStream.java:61) at com.ibm.as400.access.AS400ThreadedServer.run(AS400ThreadedServer.java:359) at java.lang.Thread.run(Unknown Source) Mi Dez 18 09:33:58:714 MEZ 2024 receive(): Read daemon exception: java.net.SocketTimeoutException: Read timed out at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.socketRead(Unknown Source) at java.net.SocketInputStream.read(Unknown Source) at java.net.SocketInputStream.read(Unknown Source) at com.ibm.as400.access.DataStream.readFromStream(DataStream.java:54) at com.ibm.as400.access.ClientAccessDataStream.construct(ClientAccessDataStream.java:61) at com.ibm.as400.access.AS400ThreadedServer.run(AS400ThreadedServer.java:359) at java.lang.Thread.run(Unknown Source) Mi Dez 18 09:33:58:715 MEZ 2024 Lost connection to remote command server: java.net.SocketTimeoutException: Read timed out at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.socketRead(Unknown Source) at java.net.SocketInputStream.read(Unknown Source) at java.net.SocketInputStream.read(Unknown Source) at com.ibm.as400.access.DataStream.readFromStream(DataStream.java:54) at com.ibm.as400.access.ClientAccessDataStream.construct(ClientAccessDataStream.java:61) at com.ibm.as400.access.AS400ThreadedServer.run(AS400ThreadedServer.java:359) at java.lang.Thread.run(Unknown Source) Mi Dez 18 09:33:58:716 MEZ 2024 Send end job data stream failed: java.net.SocketException: Connection reset by peer: socket write error at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(Unknown Source) at java.net.SocketOutputStream.write(Unknown Source) at com.ibm.as400.access.DataStream.write(DataStream.java:338) at com.ibm.as400.access.AS400EndJobDS.write(AS400EndJobDS.java:56) at com.ibm.as400.access.AS400ThreadedServer.forceDisconnect(AS400ThreadedServer.java:246) at com.ibm.as400.access.AS400ImplRemote.disconnectServer(AS400ImplRemote.java:727) at com.ibm.as400.access.RemoteCommandImplRemote.disconnectServer(RemoteCommandImplRemote.java:834) at com.ibm.as400.access.RemoteCommandImplRemote.runProgramOffThread(RemoteCommandImplRemote.java:608) at com.ibm.as400.access.RemoteCommandImplRemote.runProgram(RemoteCommandImplRemote.java:532) at com.ibm.as400.access.ProgramCall.run(ProgramCall.java:792) Mi Dez 18 09:33:58:719 MEZ 2024 forceDisconnect calling readDaemon_.interrupt

I checked the state of the as400 object and connection, which is still alive.
How can i prevent this error?

Br,
Bratmaxxe

@Bratmaxxe119
Copy link
Author

Added example

PGM_Call.txt

@nadiramra
Copy link
Member

If connection is ended on server side, you will get this error, even if you check via toolbox if connection is alive because the old implementation of the isAlive method did not check the read-side of the connection. Get the newest release which corrects that problem. In addition, there is a new method to keep connections alive, setStayAlive() on the AS400 class.

@Bratmaxxe119
Copy link
Author

Hi,

many thanks for your advice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants