May I know what port is used by Java RMI connection?
If I want to connect a Java client application to a Java server application using RMI connection, what port I need to open at the server machine so that the client application can connect to it?
I want to set up a firewall in the server machine but I don't know which port I should open.
java.rmi.activation.port This property is used to set the TCP port number on which this VM should communicate with rmid (by default, rmid listens on port 1098, but can be set to listen on a different port by using the -port option on the rmid command line).
The RMI services use certain default ports. The default ports are left open on the firewall on cluster nodes and remote collector nodes. Note: Ports 3091 to 3094 ports are opened in firewall by vRealize Operations for Horizon.
Actually, it uses UDP, despite the docs claiming it's TCP.
On top of the TCP/IP layer, RMI uses a wire-level protocol called Java Remote Method Protocol (JRMP), which works like this: Objects that require remote behavior should extend the RemoteObject class, typically through the UnicastRemoteObject subclass.
RMI generally won't work over a firewall, since it uses unpredictable ports (it starts off on 1099, and then runs off with a random port after that).
In these situations, you generally need to resort to tunnelling RMI over HTTP, which is described well here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With