Error establishing JRMP connection

I get the following exception trace:

java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is: java.net.SocketTimeoutException: Read timed out at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:293) at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:190) 

I read several forums about this, but did not get clarity about the root cause of this exception. Is this due to one of the following reasons?

  • Not enough memory.
  • An RMI call causes failures due to an increase in the number of requests to the server, forcing one of them to wait and call timeouts for this request.
  • Incompatible version of jre or everything related to the version of JRE.
  • Any network related problem.
  • Associated with a firewall.
+7
source share
4 answers
  • Not enough memory.

Not at the client. Perhaps on the server, if this leads to a failure of thread allocation, for example.

  1. An RMI call causes failures due to an increase in the number of requests to the server, forcing one of them to wait and call timeouts for this request.

Not. The error occurs during the connection setup phase, long before the server-side implementation of the method is started.

  1. incompatible version of jre or anything related to the version of JRE.

Not.

  1. Any network related problem.

Yes.

  1. Associated with a firewall.

Not. This will cause a connection timeout or, in some obsolete cases, a connection failure, rather than a read timeout.

+2
source

I get this error when an SSH client from outside the local network containing an SSH server tries to connect to the server and RMI is enabled to allow the client to execute RMI methods on the server. The reason is the unreachable (missing route) server. It seems that all these cases are related to this reason.

0
source

I have the same error on the client side. The server is available and I can open the port via telnet. When I looked at it with Wireshark on the client and server side, I see the following:

  • TCP connection established

    • SYN
    • SYN, ACK
    • ACK
  • Client sends: JRMI, Version 2, Stream Protocol

  • Server response: JRMI, ProtocolAck - But this package has never been on the client side

In my case, this is a connection to the MagicDraw client for the license server. For other colleagues in other places, this helps to use proxies: http.proxyHost=xxxx -Dhttp.proxyPort=8080 and the client communicates via HTTP. Perhaps this may help you to omit this problem. https://docs.oracle.com/javase/7/docs/platform/rmi/spec/rmi-arch6.html

I cannot be specific as I do not have access to the Magic Draw source code.

0
source

Set CATALINA_OPTS as indicated in the startup file in tomcat

 CATALINA_OPTS=-Djava.awt.headless=true -Xmx128M -server -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9091 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=localhost 

Here the port number is not a server. Specify a different port number, for example, 9091.1099, etc. And the host name, for example localhost or 198.168.128.72

Running jconsole as

 jconsole 198.168.128.72:9091 

here the port number is not the server port number. This is the JMX port specified in CATALINA_OPTS .

-2
source

All Articles