Socket timeout issue since Java update (unable to connect to local server)
See original GitHub issueI’m not sure why this is happening but ever since I updated my Java packages, I’m unable to connect to my local server for testing. I’m on Arch Linux and the update was from openjdk 8.u292-1 (working) to openjdk 8 .u312-2 (not working).
Downgrading the packages resolves the issue but I’m a little hesitant to do that as a permanent solution (log4j security issues for one…)
From the logs, the server seems to start up fine but I get a socket timeout error in the client logs.
INFO 2022-01-28 08:45:23,565 Connect: connecting to server localhost:17171 =>[SwingWorker-pool-5-thread-4] SessionImpl$5.work
WARN 2022-01-28 08:45:53,712 Cannot connect =>[SwingWorker-pool-5-thread-3] SessionImpl.handleCannotConnectException
org.jboss.remoting.CannotConnectException: Error setting up client lease upon performing connect.
at org.jboss.remoting.Client.connect(Client.java:1928)
at org.jboss.remoting.Client.connect(Client.java:737)
at mage.remote.SessionImpl$5.work(SessionImpl.java:429)
at mage.remote.SessionImpl$RemotingTask$1.doInBackground(SessionImpl.java:95)
at mage.remote.SessionImpl$RemotingTask$1.doInBackground(SessionImpl.java:91)
at javax.swing.SwingWorker$1.call(SwingWorker.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at javax.swing.SwingWorker.run(SwingWorker.java:334)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.Exception: Error setting up client lease
at org.jboss.remoting.MicroRemoteClientInvoker.establishLease(MicroRemoteClientInvoker.java:563)
at org.jboss.remoting.Client.setupClientLease(Client.java:2070)
at org.jboss.remoting.Client.connect(Client.java:1924)
... 10 more
Caused by: org.jboss.remoting.InvocationFailureException: Socket timed out. Waited 29972 milliseconds for response while calling on InvokerLocator [bisocket://192.168.21.246:17171/?onewayThreadPool=mage.remote.CustomThreadPool&serializationtype=jboss]; nested exception is:
java.net.SocketTimeoutException: Read timed out
at org.jboss.remoting.transport.socket.SocketClientInvoker.handleException(SocketClientInvoker.java:137)
at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.handleOtherException(MicroSocketClientInvoker.java:1104)
at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:966)
at org.jboss.remoting.transport.bisocket.BisocketClientInvoker.transport(BisocketClientInvoker.java:470)
at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:169)
at org.jboss.remoting.MicroRemoteClientInvoker.establishLease(MicroRemoteClientInvoker.java:529)
... 12 more
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:171)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
at java.io.BufferedInputStream.read(BufferedInputStream.java:265)
at java.io.FilterInputStream.read(FilterInputStream.java:83)
at org.jboss.serial.io.JBossObjectInputStream.read(JBossObjectInputStream.java:193)
at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.readVersion(MicroSocketClientInvoker.java:1366)
at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:920)
... 15 more
INFO 2022-01-28 08:45:53,736 Disconnecting DONE =>[SwingWorker-pool-5-thread-3] SessionImpl.disconnect
INFO 2022-01-28 08:45:53,738 Disconnected from user mode =>[SwingWorker-pool-5-thread-3] MageFrame.disconnected
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
How to resolve java.net.SocketTimeoutException
SocketTimeoutException: Connection timed out) means that it takes too long to get respond from other device and your request expires before getting response....
Read more >Connection Timeout vs. Read Timeout for Java Sockets
From the client side, the “read timed out” error happens if the server is taking longer to respond and send information. This could...
Read more >Getting java.net.SocketTimeoutException: Connection timed ...
I'm developing an android application where I'm sending requests to the web server and parsing JSON objects. Frequently I'm getting java.net.
Read more >How to Fix the Minecraft Server Connection Timed Out Error
Today's article will discuss the best ways to resolve the Minecraft Server Connection Timed Out Error in Windows 10 and 11.
Read more >java.net.SocketTimeoutException: connect timed out Error
This exception is occurring on following condition. Server is slow and default timeout is less, so just put timeout value according to you....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

You must check versions again. Or the commit from openjdk was broken. It changing a serialization code, read and write object data. So it can fail the read operation on some data. If so then xmage client can’t read data from the server -it will be empty.
Xmage have some serialization tests. So you can try to make new one with data that will fail with specific openjdk version.
I’m sure the client/server versions are the same. They get built at the same time in IntelliJ. When I was testing, I was compiling OpenJDK then reloading both server and client with the new OpenJDK version.
I’ll look at the tests though. That’s a good idea. I’ll see if I can find a test case that fails with this new OpenJDK release.